Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
2.7.3
-
None
-
Tried on JDK 1.6. Should affect 1.5 as well
-
Important
Description
OGNLRuntime.findParameterTypes(Class type, Method m) caches the parameter types based on the method only. This is incorrect as further calls to the same inherited method (possibly through different child classes with different generic type specification) will always yield parameter types for the first call.
The cache should use the class on which the method is called or it will not be able to handle generic parameter types correctly.
e.g.
Class GenericParent<T> { public void save(T entity){}}
Class StringChild<String> {}
Class LongChild<Long> {}
OGNLRuntime.findParameterTypes(Class type, Method m) should return String.class for StringChild and Long.class for LongChild.
See attached test-case for details