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 05:12:00 GMT

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

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

I haven't had time to track down what is causing the problem (wild guess: we're not handling
it correctly when the annotation class is on java classpath but not groovy one?) but if I
side-step the AIOOB exception the build then fails in :internalIntegTesting:compileGroovy
with:
{noformat}
General error during canonicalization: Comparison method violates its general contract!

java.lang.IllegalArgumentException: Comparison method violates its general contract!
        at java.util.TimSort.mergeLo(TimSort.java:777)
        [...snip...]
        at java.util.Collections.sort(Collections.java:175)
        at org.codehaus.groovy.transform.trait.TraitComposer.applyTrait(TraitComposer.java:202)
        at org.codehaus.groovy.transform.trait.TraitComposer.doExtendTraits(TraitComposer.java:111)
{noformat}
I don't yet know whether that is caused by my side-step hack or some other changes on 2.4.15-SNAPSHOT.
That task runs fine for me with 2.4.12.

> 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