Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4918

GetEffectivePojoPropertySite#acceptGetProperty may produce a NullPointerException when provided with a null 'receiver' object

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.0
    • Fix Version/s: 2.4.1
    • Component/s: groovy-runtime
    • Labels:

      Description

      When given a null receiver object, line 51 of org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite may produce a NullPointerException when trying to invoke java.lang.Object#getClass.
      It seems that the commented-out if statement on line 50 handles this case by checking the receiver object with instanceof.
      Although if fixed, a NullPointerException will eventually be thrown by the NullCallSite object when trying to access a property of the null object, the exception thrown by NullCallSite is much more descriptive.

        Attachments

        1. groovy-4918.zip
          51 kB
          Jochen Kemnade

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              noamt Noam Y. Tenne
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: