groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Sun (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-8598) Possible bug in AstBuilder Antlr4
Date Wed, 23 May 2018 07:40:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-8598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Sun resolved GROOVY-8598.
--------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/groovy/commit/a26c190f9a70b0c430004d80c56e37703c2edfe8

> Possible bug in AstBuilder Antlr4
> ---------------------------------
>
>                 Key: GROOVY-8598
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8598
>             Project: Groovy
>          Issue Type: Bug
>          Components: parser-antlr4
>            Reporter: Daniel Sun
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 2.6.0-alpha-4, 3.0.0-alpha-3
>
>
> From dev mailing list(http://groovy.329449.n5.nabble.com/Possible-bug-in-AstBuilder-Antlr4-tt5750881.html):
>  
> Hi Daniel,
> I think I have found a bug in the antlr4 AstBuilder class.
> Add this line:
> import groovy.transform.CompileStatic
> before this one in a GString template: [https://github.com/melix/groovy-core/blob/d9656842908acb403599cf574f509aea2737be47/subprojects/groovy-groovydoc/src/main/resources/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html#L27]
> And run GroovyDocToolTest. Some tests will fail with:
> java.lang.ClassCastException: org.codehaus.groovy.ast.ImportNode cannot be cast to org.codehaus.groovy.ast.stmt.Statement
>     at org.apache.groovy.parser.antlr4.AstBuilder.visitBlockStatement(AstBuilder.java:4074)
>     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
>     at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
>     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
>     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
>     at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
>     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
>     at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
>     at org.apache.groovy.parser.antlr4.AstBuilder.visitBlockStatements(AstBuilder.java:4058)
>     at org.apache.groovy.parser.antlr4.AstBuilder.visitBlockStatementsOpt(AstBuilder.java:4045)
>     at org.apache.groovy.parser.antlr4.AstBuilder.visitClosure(AstBuilder.java:3715)
>     at org.apache.groovy.parser.antlr4.AstBuilder.visitClosurePrmrAlt(AstBuilder.java:3120)
>     at org.apache.groovy.parser.antlr4.AstBuilder.visitClosurePrmrAlt(AstBuilder.java:356)



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

Mime
View raw message