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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.0
    • 2.4.1
    • groovy-runtime

    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

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

            Dates

              Created:
              Updated:
              Resolved: