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 {
          }
      
      }
      

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user paulk-asert opened a pull request:

          https://github.com/apache/groovy/pull/550

          GROOVY-8203: Add @Newify will cause ?. operator NPE

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/paulk-asert/groovy groovy8203

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/groovy/pull/550.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #550


          commit 8b4316c8f5ee70cbac2c71d465ecaf3048182676
          Author: paulk <paulk@asert.com.au>
          Date: 2017-05-25T07:26:54Z

          GROOVY-8203: Add @Newify will cause ?. operator NPE


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user paulk-asert opened a pull request: https://github.com/apache/groovy/pull/550 GROOVY-8203 : Add @Newify will cause ?. operator NPE You can merge this pull request into a Git repository by running: $ git pull https://github.com/paulk-asert/groovy groovy8203 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/550.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #550 commit 8b4316c8f5ee70cbac2c71d465ecaf3048182676 Author: paulk <paulk@asert.com.au> Date: 2017-05-25T07:26:54Z GROOVY-8203 : Add @Newify will cause ?. operator NPE
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/groovy/pull/550

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/groovy/pull/550
          Hide
          paulk Paul King added a comment -

          Proposed PR merged. Thanks for spotting the issue.

          Show
          paulk Paul King added a comment - Proposed PR merged. Thanks for spotting the issue.

            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:

                Development