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

NPE in ognl.OgnlRuntime.findParameterTypes(Class type, Method m)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.7.2, 2.7.3
    • 3.0
    • Core Runtime
    • None
    • Patch

    Description

      Using the 2.7.3 snapshot, I've noticed the chain intereceptor in Struts wasn't setting the value of a property with a List type.

      After debugging, I saw that at NPE was thrown:

      java.lang.NullPointerException

      at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:103)

      at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)

      at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)

      at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2225)

      at ognl.ASTProperty.setValueBody(ASTProperty.java:127)

      at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)

      at ognl.SimpleNode.setValue(SimpleNode.java:301)

      at ognl.Ognl.setValue(Ognl.java:737)

      at com.opensymphony.xwork2.util.OgnlUtil.copy(OgnlUtil.java:270)

      at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:107)

      In ognl.OgnlRuntime.findParameterTypes(Class type, Method m),

      the parameter types are beeing extracted from the generic parameter types of the method.

      The problem is that the posibility of a type to be a ParameterizedType is ignored, so paramType is null when

      ognl.OgnlRuntime.resolveType(ParameterizedType param, TypeVariable var, TypeVariable[] declaredTypes)

      is called.

      Attachments

        Activity

          People

            lukasz03 Disabled - L-u-k-a-s-z Lenart - OpenSymphony
            shadow Andrei Ivanov
            Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: