Uploaded image for project: 'Commons OGNL (Dormant)'
  1. Commons OGNL (Dormant)
  2. OGNL-152

OGNLRuntime doesn't handle parameterized method arguments correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.7.3
    • 3.0
    • Core Runtime
    • 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

      Attachments

        Activity

          People

            lukasz03 Disabled - L-u-k-a-s-z Lenart - OpenSymphony
            anshuman Anshuman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: