Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5
    • Fix Version/s: 1.8.6, 2.0-beta-3
    • Component/s: None
    • Labels:
      None

      Description

      When I apply the spread operator to a List containing a single null and use the result of that as an argument to .curry, an NPE is thrown with 1.8.x but not with 1.7.10.

      script1.groovy
      c = { x ->
          println "X is ${x}"
      }
      
      args = [42]
      
      c = c.curry(*args)
      
      c()
      
      script2.groovy
      c = { x, y ->
          println "X is ${x}"
          println "Y is ${y}"
      }
      
      args = [42, 2112]
      
      c = c.curry(*args)
      
      c()
      
      script3.groovy
      c = { x, y ->
          println "X is ${x}"
          println "Y is ${y}"
      }
      
      args = [null, null]
      
      c = c.curry(*args)
      
      c()
      

      (This next script is the problematic one...)

      script4.groovy
      c = { x ->
          println "X is ${x}"
      }
      
      args = [null]
      
      c = c.curry(*args)
      
      c()
      

      With Groovy 1.7.10:

      curry $ groovy -version
      Groovy Version: 1.7.10 JVM: 1.6.0_29
      curry $ 
      curry $ groovy script1
      X is 42
      curry $ 
      curry $ groovy script2
      X is 42
      Y is 2112
      curry $ 
      curry $ groovy script3
      X is null
      Y is null
      curry $ 
      curry $ groovy script4
      X is null
      curry $
      

      With Groovy 1.8.5:

      curry $ groovy -version
      Groovy Version: 1.8.5 JVM: 1.6.0_29 Vendor: Apple Inc. OS: Mac OS X
      curry $ groovy script1
      X is 42
      curry $ groovy script2
      X is 42
      Y is 2112
      curry $ groovy script3
      X is null
      Y is null
      curry $ groovy script4
      Caught: java.lang.NullPointerException
      java.lang.NullPointerException
      	at script4.run(script4.groovy:7)
      

        Activity

        Jeff Brown created issue -
        Jochen Theodorou made changes -
        Field Original Value New Value
        Fix Version/s 2.0-beta-3 [ 18244 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Paul King [ paulk ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.8.6 [ 18245 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12734185 ] Default workflow, editable Closed status [ 12745983 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12973754 ] Default workflow, editable Closed status [ 12980896 ]

          People

          • Assignee:
            Paul King
            Reporter:
            Jeff Brown
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development