groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8505) ArrayIndexOutOfBoundsException with @Nullable change
Date Fri, 23 Mar 2018 14:23:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-8505?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16411453#comment-16411453
] 

Paul King commented on GROOVY-8505:
-----------------------------------

I think we are seeing this:
https://gitlab.ow2.org/asm/asm/issues/317788

There will be synthetic parameters for the parent class and outer class references fields
like fileResolver but the annotation array only has the annotations for the single explicit
parameter. Groovy 2.4.15 moves to a later version of ASM that I believe should have this fixed.
I haven't checked whether we need to do anything on our side as well.

> ArrayIndexOutOfBoundsException with @Nullable change
> ----------------------------------------------------
>
>                 Key: GROOVY-8505
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8505
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.12
>         Environment: See https://scans.gradle.com/s/gr3dszv44wkfg/console-log#L476 for
execution details.
>            Reporter: Lóránt Pintér
>            Priority: Major
>
> *Steps to reproduce:*
> {code}
> $ git clone [https://github.com/gradle/gradle
> $ cd gradle
> $ git checkout c8e7ac4adb2f72390ed681eb8bfdaa41111baa8e
> $ ./gradlew :core:compileTestGroovy
> $ # ^ This version works
> $ git revert --no-commit head
> $ ./gradlew :core:compileTestGroovy
> $ # ^ This will fail
> {code}
> The reverted commit is this:
> https://github.com/gradle/gradle/pull/4682/commits/c8e7ac4adb2f72390ed681eb8bfdaa41111baa8e
> It removes a {{@Nullable}} annotation from a constructor parameter. If the annotation
is present (i.e. the commit is reverted), {{./gradlew :core:compileTestGroovy}} will produce
the following exception:
> {code}
> java.lang.ArrayIndexOutOfBoundsException: 1
>         at org.codehaus.groovy.vmplugin.v5.Java5.makeParameters(Java5.java:451)
>         at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:382)
>         at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:280)
>         at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1009)
>         at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1004)
>         at org.codehaus.groovy.ast.ClassNode.getSuperClass(ClassNode.java:998)
>         at org.codehaus.groovy.ast.ClassNode.isDerivedFrom(ClassNode.java:941)
>         at org.codehaus.groovy.classgen.asm.InvocationWriter.castToNonPrimitiveIfNecessary(InvocationWriter.java:863)
>         at org.codehaus.groovy.classgen.asm.OperandStack.doConvertAndCast(OperandStack.java:345)
>         at org.codehaus.groovy.classgen.asm.OperandStack.doGroovyCast(OperandStack.java:282)
>         at org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.evaluateEqual(BinaryExpressionHelper.java:344)
>         at org.codehaus.groovy.classgen.AsmClassGenerator.visitDeclarationExpression(AsmClassGenerator.java:637)
>         at org.codehaus.groovy.ast.expr.DeclarationExpression.visit(DeclarationExpression.java:89)
>         at org.codehaus.groovy.classgen.asm.StatementWriter.writeExpressionStatement(StatementWriter.java:613)
>         at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeExpressionStatement(OptimizingStatementWriter.java:366)
>         at org.codehaus.groovy.classgen.AsmClassGenerator.visitExpressionStatement(AsmClassGenerator.java:624)
>         at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:42)
>         at org.codehaus.groovy.classgen.asm.StatementWriter.writeBlockStatement(StatementWriter.java:85)
>         at org.codehaus.groovy.classgen.asm.OptimizingStatementWriter.writeBlockStatement(OptimizingStatementWriter.java:159)
>         at org.codehaus.groovy.classgen.AsmClassGenerator.visitBlockStatement(AsmClassGenerator.java:570)
>         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:434)
>         at org.codehaus.groovy.classgen.AsmClassGenerator.visitConstructorOrMethod(AsmClassGenerator.java:387)
>         at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:126)
>         at org.codehaus.groovy.classgen.AsmClassGenerator.visitMethod(AsmClassGenerator.java:511)
>         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:233)
>         at org.codehaus.groovy.control.CompilationUnit.call(CompilationUnit.java:825)
>         at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
>         at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
>         at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
>         at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
>         at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:537)
>         at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:175)
> {code}
> The change actually happens in Java code that the Groovy compilation depends on.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message