Comments (9)
Are you sure it's about the line 170?
from ognl.
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.
The best option I see is to drop that constructor..
from ognl.
If no meaningful or 'cheap' default implementation for MemberAccess can be provided I tend to agree.
from ognl.
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.
Also please be aware that 3.2.x line is still a work-in-progress - maybe I should express that better
from ognl.
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.
Good idea, if no objections let's do it :)
from ognl.
OGNL 3.2.14 is out
from ognl.
Related Issues (20)
- IllegalArgumentException when calling Ognl.getValue(Object, Object, Class) HOT 1
- Should this null-check be here? HOT 2
- Varargs method not found if no varargs are given HOT 2
- Developer Guide uses deprecated code HOT 4
- The 3.2.18 version of ognl.Ognl#getValue(..) is not easy to use at all HOT 3
- "Two vararg methods with same score" for resteasy ClientWebTarget.request() HOT 13
- Move OGNL under a dedicated organisation HOT 10
- java.lang.ArithmeticException: / by zero HOT 3
- Illegal reflective access warning when using "_parameter.containsKey() and Collections.singletonMap HOT 6
- OGNL issues with java 16 and 17 HOT 9
- Struts2 2.5 and struts2-jquery-plugin HOT 2
- In 3.3.3 (and before) compileExpression fails without add-opens on Java 17 HOT 13
- 如何解决安全问题。How ognl solve safety problem HOT 5
- Ognl.createDefaultContext(Object, ClassResolver) throws "IllegalArgumentException" HOT 4
- method with varargs invoked result exception: java.lang.ArrayStoreException HOT 6
- Most unit tests no longer running? HOT 2
- Cannot call static method through interface? HOT 8
- Request for posting of Maven signing key(s) HOT 2
- Dependency Dashboard
- Ognl choosing method on unexported class rather than exported interface
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ognl.