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

Fails to compile method with parenthesis in function name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.16, 2.4.17
    • 2.4.19
    • bytecode

    Description

      Groovy 2.4.16 upgraded ASM from 6.0 to 6.1.x, which introduced this regression: https://gitlab.ow2.org/asm/asm/issues/317868 

      This causes compilation to fail on methods names that have parentheses in them. The error thrown is:

      java.lang.IllegalArgumentException
      	at groovyjarjarasm.asm.Frame.getAbstractTypeFromDescriptor(Frame.java:335)
      	at groovyjarjarasm.asm.Frame.push(Frame.java:544)
      	at groovyjarjarasm.asm.Frame.execute(Frame.java:1036)
      	at groovyjarjarasm.asm.MethodWriter.visitInvokeDynamicInsn(MethodWriter.java:1062)
      	at org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter.finishIndyCall(InvokeDynamicWriter.java:121)
      	at org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter.makeIndyCall(InvokeDynamicWriter.java:157)
      	at org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter.makeCachedCall(InvokeDynamicWriter.java:97)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:430)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:137)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.makeInvokeMethodCall(InvocationWriter.java:121)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:497)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:814)
      	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
      	at org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter.makeIndyCall(InvokeDynamicWriter.java:141)
      	at org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter.makeCachedCall(InvokeDynamicWriter.java:97)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:430)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:137)
      	at org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter.writeNormalConstructorCall(InvokeDynamicWriter.java:190)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeConstructor(InvocationWriter.java:610)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorCallExpression(AsmClassGenerator.java:865)
      	at org.codehaus.groovy.ast.expr.ConstructorCallExpression.visit(ConstructorCallExpression.java:46)
      	at org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter.prepareIndyCall(InvokeDynamicWriter.java:112)
      	at org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter.makeIndyCall(InvokeDynamicWriter.java:130)
      	at org.codehaus.groovy.classgen.asm.indy.InvokeDynamicWriter.makeCachedCall(InvokeDynamicWriter.java:97)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:430)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.makeCall(InvocationWriter.java:137)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.makeInvokeMethodCall(InvocationWriter.java:121)
      	at org.codehaus.groovy.classgen.asm.InvocationWriter.writeInvokeMethod(InvocationWriter.java:497)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethodCallExpression(AsmClassGenerator.java:814)
      	at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:70)
      	at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluateCompareExpression(BinaryExpressionHelper.java:488)
      	at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.eval(BinaryExpressionHelper.java:133)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBinaryExpression(AsmClassGenerator.java:685)
      	at org.codehaus.groovy.ast.expr.BinaryExpression.visit(BinaryExpression.java:51)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBooleanExpression(AsmClassGenerator.java:807)
      	at org.codehaus.groovy.ast.expr.BooleanExpression.visit(BooleanExpression.java:42)
      	at org.codehaus.groovy.classgen.asm.AssertionWriter.writeAssertStatement(AssertionWriter.java:98)
      	at org.codehaus.groovy.classgen.asm.StatementWriter.writeAssert(StatementWriter.java:570)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitAssertStatement(AsmClassGenerator.java:633)
      	at org.codehaus.groovy.ast.stmt.AssertStatement.visit(AssertStatement.java:50)
      	at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:93)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:613)
      	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
      	at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:93)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:613)
      	at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:71)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:104)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:115)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitStdMethod(AsmClassGenerator.java:477)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:413)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:126)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:554)
      	at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1081)
      	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:53)
      	at org.codehaus.groovy.classgen.AsmClassGenerator.visitClass(AsmClassGenerator.java:259)
      	at org.codehaus.groovy.control.CompilationUnit$17.call(CompilationUnit.java:848)
      	at org.codehaus.groovy.control.CompilationUnit$17.call(CompilationUnit.java:865)
      	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624)
      )

      The fix is to upgrade ASM to version 7.1.

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              astral303 Oleg Rekutin
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h
                  3h