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

NPE in OptimizingStatementWriter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8-beta-4
    • 1.8-beta-4
    • Compiler
    • None

    Description

      With the very latest (but not any earlier) 1.8-beta-4 snapshot, I'm getting the following exception when compiling spock-core (1.8 branch on GitHub). No transforms are involved here.

      [10:44:57]: [org.spockframework:spock-core] Caused by: java.lang.NullPointerException
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter$OptVisitor.visitBinaryExpression(OptimizingStatementWriter.java:467)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:49)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.CodeVisitorSupport.visitReturnStatement(CodeVisitorSupport.java:73)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitReturnStatement(ClassCodeVisitorSupport.java:210)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter$OptVisitor.visitReturnStatement(OptimizingStatementWriter.java:370)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:47)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter$OptVisitor.visitBlockStatement(OptimizingStatementWriter.java:492)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:101)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:112)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1056)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter$OptVisitor.visitClass(OptimizingStatementWriter.java:365)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.setNodeMeta(OptimizingStatementWriter.java:343)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:127)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.control.CompilationUnit$13.call(CompilationUnit.java:754)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:948)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:533)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:511)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:488)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:467)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.gmaven.runtime.v1_7.ClassCompilerFeature$ClassCompilerImpl.compile(ClassCompilerFeature.java:148)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.gmaven.plugin.compile.AbstractCompileMojo.compile(AbstractCompileMojo.java:200)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.gmaven.plugin.compile.AbstractCompileMojo.process(AbstractCompileMojo.java:164)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.gmaven.plugin.ComponentMojoSupport.doExecute(ComponentMojoSupport.java:60)
      [10:44:57]: [org.spockframework:spock-core] 	at org.codehaus.gmaven.plugin.MojoSupport.execute(MojoSupport.java:69)
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            pniederw Peter Niederwieser
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: