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

OgnlRuntime.findClosestMatchingMethod does not check for null List

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.3, 3.0
    • None
    • ExpressionCompiler
    • None
    • JDK 1.6 + Groovy 1.7.2

    Description

      When OgnlRuntime.findClosestMatchingMethod calls getDeclaredMethods on line 2029, it does not check for a null return value from the invocation. When evaluating a nested property on a Groovy object, the "metaClass" property Groovy makes on objects causes getDeclaredMethods to not find a callable method (as determined by isCallableMethod) for that property.

      The result is that getDeclaredMethods returns null and the for-loop raises a NPE.

      In my test cases, I successfully evaluated an OGNL expression against Groovy objects by emulating what the result of OgnlRuntime.findClosestMatchingMethod would have done had it not raised the NPE. The (admittingly very simple) expression evaluated as expected.

      Attachments

        Activity

          People

            jkuhnert Jesse Kuhnert
            stevev Steve Vickers
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: