Groovy
  1. Groovy
  2. GROOVY-1586

verify error / NPE with & operator

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Affects Version/s: 1.0-RC-1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      C:\>groovy -v
      Groovy Version: 1.0-RC-01 JVM: 1.6.0-b105

      Description

      C:\>groovy -e "i=0;j=1;((i = 1) == 3) & ((j = 2) == 2)"
      Caught: java.lang.VerifyError: (class: script_from_command_line, method: run signature: ()Ljava/lang/Object Expecting to find object/array on stack

      With jdk 150_09 and 142_09 the same one liner seems to cause a null pointer exception.

        Issue Links

          Activity

          Antti Karanta created issue -
          Jochen Theodorou made changes -
          Field Original Value New Value
          Assignee Guillaume Laforge [ guillaume ] Jochen Theodorou [ blackdrag ]
          Jochen Theodorou made changes -
          Description
          C:\>groovy -e "i=0;j=1;((i = 1) == 3) & ((j = 2) == 2)"
          Caught: java.lang.VerifyError: (class: script_from_command_line, method: run signature: ()Ljava/lang/Object;) Expecting to find object/array on stack

            With jdk 150_09 and 142_09 the same one liner seems to cause a null pointer exception.

          C:\>groovy -e "i=0;j=1;((i = 1) == 3) & ((j = 2) == 2)"
          Caught: java.lang.VerifyError: (class: script_from_command_line, method: run signature: ()Ljava/lang/Object;) Expecting to find object/array on stack

            With jdk 150_09 and 142_09 the same one liner seems to cause a null pointer exception.

          Priority Major [ 3 ] Critical [ 2 ]
          Hide
          Paul King added a comment -

          > groovy --version
          Groovy Version: 1.0-RC-02-SNAPSHOT JVM: 1.4.2_12-b03
          > groovy -e "i=0;j=1;((i = 1) == 3) & ((j = 2) == 2)"
          2 was unexpected at this time.

          Show
          Paul King added a comment - > groovy --version Groovy Version: 1.0-RC-02-SNAPSHOT JVM: 1.4.2_12-b03 > groovy -e "i=0;j=1;((i = 1) == 3) & ((j = 2) == 2)" 2 was unexpected at this time.
          Hide
          Antti Karanta added a comment -

          Hmm, that's really strange.

          I just tried again and realized that this problem only manifests itself w/ the native launcher when launching from the command line. The .bat launcher acts as you showed.

          So, I suspected it was something w/ the native launcher. Strange enough, it looks that the params are passed to the groovy java side without problems, so I don't know what is causing it.

          However, when one runs

          i=0;j=1;((i = 1) == 3) & ((j = 2) == 2)
          go

          in the groovysh groovy shell, the problem again manifests itself. And groovy shell doesn't have anything to do w/ the native launcher.

          So, could you try to run the above snippet in groovysh? This would help to define whether this is just something in my environment.

          Show
          Antti Karanta added a comment - Hmm, that's really strange. I just tried again and realized that this problem only manifests itself w/ the native launcher when launching from the command line. The .bat launcher acts as you showed. So, I suspected it was something w/ the native launcher. Strange enough, it looks that the params are passed to the groovy java side without problems, so I don't know what is causing it. However, when one runs i=0;j=1;((i = 1) == 3) & ((j = 2) == 2) go in the groovysh groovy shell, the problem again manifests itself. And groovy shell doesn't have anything to do w/ the native launcher. So, could you try to run the above snippet in groovysh? This would help to define whether this is just something in my environment.
          Jochen Theodorou made changes -
          Link This issue duplicates GROOVY-1651 [ GROOVY-1651 ]
          Hide
          Jochen Theodorou added a comment -

          closed as duplicate, see linked issue

          Show
          Jochen Theodorou added a comment - closed as duplicate, see linked issue
          Jochen Theodorou made changes -
          Resolution Duplicate [ 3 ]
          Status Open [ 1 ] Closed [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12730716 ] Default workflow, editable Closed status [ 12742643 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12972612 ] Default workflow, editable Closed status [ 12980377 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          34d 1h 55m 1 Jochen Theodorou 15/Jan/07 07:08

            People

            • Assignee:
              Jochen Theodorou
              Reporter:
              Antti Karanta
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development