[jira] [Created] (OGNL-233) ClassCacheHandler should return a handler with a key that is the nearest class (interface) to the forClass in the hierarchy tree
Azuo Lee created OGNL-233:
Summary: ClassCacheHandler should return a handler with a key that is the nearest class (interface) to the forClass in the hierarchy tree
URL: https://issues.apache.org/jira/browse/OGNL-233 Project: Commons OGNL
Issue Type: Bug
Components: Core Runtime
Reporter: Azuo Lee
ClassCacheHandler enumerates over the forClass's interfaces and superclasses to find a match key class. But consider the following senario:
interface A implements java.util.Collection
class B extends java.util.AbstractList implements A
Now if ClassCacheHandler.getHandler(B, handlers) is invoked, and assuming handlers is an empty ClassCache, according to the current enumeration logic used by ClassCacheHandler, classes (interfaces) will be enumerated in the following order:
if both java.util.Collection and java.util.List are present as keys in the handlers, since java.util.Collection is enumerated first, then it will be matched, instead of java.util.List.
The expected behaviour should be java.util.List is matched, because it is nearer to class B in the hierarchy tree.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira