Comments (12)
It can be only related to #19
from ognl.
Hi.
#19 was originally made by me. I'll take a look into that issue...
Sorry for the late reply it seems somehow my github email notification's dont work and I just disovered this by chance...
from ognl.
@marvkis great, thanks a lot!
from ognl.
Okay, I have an idea what's going wrong:
Initially in AstMethod.getChildrenClasses() implementation for ASTList I already had a parametrized array as returning type that hold's the information about the appropriate carried class types. But as this didn't reflect ASTList's real behavior - returning an ArrayList - this wasn't the right way so I changed it to return a list. List itself is a generic type, but as far as I know a 'Class' can't be parametrized easily so the 'inner' type information got lost and so the method weighting can't make a clean decision...
Have to dig into that... but it must work somehow, when refactoring into a class the returning types are parametrized...
from ognl.
After some investigation:
The "Generics" approach is the wrong way. I started an approach to use a "typed class carrier" but it was the wrong way. It worked quite well for "compiled" OGNL commands, but it failed during interpretation - Interpretation is done on live objects and not on classes, and due to "Generics Type Erasure" generics type information is only available during compilation and not any more during run time. So i abandoned this approach - it's still here for whom it might interest: Issue-23-Generics
So, as always if you ran into the wrong direction, change your perspective: What does java itself when it has to call avg()
with a java.util.List
argument? And indeed, it chooses the avg(Iterable...)
method.
And it didn't work because the OgnlRuntime.isTypeCompatible()
bailed out with an exception to early instead of continuing if there is a better matching method.
I also had to change the method weighting and matching a bit with the 'Generics Type Erasure' in mind: A java.util.List
only will match to an Object[]
array during runtime. With this in mind all Unit-Tests worked again.
Btw: sa-ChristianNiessner is my 'work' account and marvkis my personal / private account. I did this during work hours so the credit is for my company ;)
from ognl.
@marvkis aka sa-ChristianNiessner
please provide your company name and I will used in Version Notes :)
from ognl.
@lukaszlenart it is 'secadm GmbH' - http://www.secadm.de/ . thanks a lot.
@danielfernandez Was this discovered in an unit test of thymeleaf or during runtime? Can you do further 'real life' tests?
@lukaszlenart can you test it within struts to see if the changes perform fine or bring up another issues?
thanks!
from ognl.
Do we already have a snapshot for this? if so, what's OGNL's Maven snapshots repository?
from ognl.
@danielfernandez just pushed it to https://oss.sonatype.org/content/repositories/snapshots/
from ognl.
I can confirm all Thymeleaf tests pass with 3.1.5-SNAPSHOT
, including the dozen tests that fail with 3.1.4
from ognl.
Fixed with #24
from ognl.
3.1.5 is under way to the Central, thanks @sa-ChristianNiessner and @danielfernandez !
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.