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

Add @Newify will cause ?. operator NPE

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.4.11
    • Fix Version/s: 2.4.12
    • Component/s: xforms
    • Labels:
    • Environment:
      Win 8.1, Oracle JDK 8u121, Groovy 2.4.11
    • Flags:
      Important

      Description

      Hi, guys:

      When I add @Newify annotation to a class and then use ?. operator, I'll get a NPE, please see the sample code as below:

      Z.groovy
      @Newify(A)
      class Z {
      
          static void main(String... args) {
              def a
              a?.get('b')
          }
      
          class A {
          }
      
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                digitarts Huabin Zhang
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: