-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OGNLContext deprecated constructor crashes #81
Comments
Are you sure it's about the line 170? |
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 |
The best option I see is to drop that constructor.. |
If no meaningful or 'cheap' default implementation for MemberAccess can be provided I tend to agree. |
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. |
Also please be aware that 3.2.x line is still a work-in-progress - maybe I should express that better |
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 The updated exception could be something like:
|
Good idea, if no objections let's do it :) |
- Drops OgnlContext(Map values) constructor that always fails with an Exception. - Additional comments for remaining two constructors. - Changed constructor to ensure _values Map can no longer be null. - Added comments to setValues(Map value) and getValues() for clarity. - Added @OverRide annotations to Map interface methods.
…ue81Fix Proposed fix for Issue #81 (deprecated constructor always throws an exception)
OGNL 3.2.14 is out |
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'.The text was updated successfully, but these errors were encountered: