Giter VIP home page Giter VIP logo

Comments (9)

lukaszlenart avatar lukaszlenart commented on August 12, 2024

Are you sure it's about the line 170?

from ognl.

deved65 avatar deved65 commented on August 12, 2024

Sorry, I messed it up. It is line 140 with a RuntimeException. In line 120 the extensive constructor is invoked with null reference for parameter memberAccess. In line 137 is a null reference check on memberAccess which in turn always must lead to the RuntimeException.

from ognl.

lukaszlenart avatar lukaszlenart commented on August 12, 2024

The best option I see is to drop that constructor..

from ognl.

deved65 avatar deved65 commented on August 12, 2024

If no meaningful or 'cheap' default implementation for MemberAccess can be provided I tend to agree.

from ognl.

lukaszlenart avatar lukaszlenart commented on August 12, 2024

Yeah... that's why I have removed the default implementation from the main code and moved it into tests - it was quite often used to replace a framework's specific implementation by hackers. And that's why OGNL 3.2.x requires to provide your own implementation, even as a copy of the default one based on the one used in tests.

from ognl.

lukaszlenart avatar lukaszlenart commented on August 12, 2024

Also please be aware that 3.2.x line is still a work-in-progress - maybe I should express that better

from ognl.

JCgH4164838Gh792C124B5 avatar JCgH4164838Gh792C124B5 commented on August 12, 2024

Hi.

Dropping the single-argument constructor: https://github.com/jkuhnert/ognl/blob/6de4049f093eb643332bbf14090006fac516393c/src/main/java/ognl/OgnlContext.java#L121 that will now always fail with an exception seems reasonable to me.

At the same time, would it be beneficial to replace the generic RuntimeException exception: https://github.com/jkuhnert/ognl/blob/6de4049f093eb643332bbf14090006fac516393c/src/main/java/ognl/OgnlContext.java#L144
with a more specific IllegalArgumentException instead ?

The updated exception could be something like:

throw new IllegalArgumentException("MemberAccess implementation must be provided - null not permitted!");

from ognl.

lukaszlenart avatar lukaszlenart commented on August 12, 2024

Good idea, if no objections let's do it :)

from ognl.

lukaszlenart avatar lukaszlenart commented on August 12, 2024

OGNL 3.2.14 is out

from ognl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.