You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In current release 3.2.11 and master the deprecated constructor public OgnlContext(Map values) in line 117 is unusable and should be removed immediately (or fixed). Currently it will always leads to a NullPointerException in line 170 of the class. To my understanding functionality marked with 'deprecated' should no longer be used (as it will be removed in a future release), but should not be unusable 'by concept'.
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.
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.
Activity
lukaszlenart commentedon Sep 25, 2019
Are you sure it's about the line 170?
deved65 commentedon Sep 26, 2019
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.lukaszlenart commentedon Sep 26, 2019
The best option I see is to drop that constructor..
deved65 commentedon Sep 28, 2019
If no meaningful or 'cheap' default implementation for MemberAccess can be provided I tend to agree.
lukaszlenart commentedon Sep 28, 2019
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.
lukaszlenart commentedon Oct 3, 2019
Also please be aware that 3.2.x line is still a work-in-progress - maybe I should express that better
JCgH4164838Gh792C124B5 commentedon Feb 8, 2020
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:
lukaszlenart commentedon Feb 23, 2020
Good idea, if no objections let's do it :)
Proposed fix for Issue orphan-oss#81:
Merge pull request #101 from JCgH4164838Gh792C124B5/localOGNL_3_2_Iss…
lukaszlenart commentedon Mar 12, 2020
OGNL 3.2.14 is out