rewrite icon indicating copy to clipboard operation
rewrite copied to clipboard

Regenerate antlr code with 4.10.1

Open traceyyoshima opened this issue 3 years ago • 6 comments

Update ANTLR generated files to be compatible with version 4.10.1.

traceyyoshima avatar Apr 11 '22 19:04 traceyyoshima

We are unable to move to antlr 4.10.0 because the runtime was compiled against java 11 (even though the target and source were set to Java 8).

This manifests in the following error when running our tests in rewrite-java-8:

Caused by:
        java.lang.NoSuchMethodError: java.nio.CharBuffer.flip()Ljava/nio/CharBuffer;

I've submitted a PR to the antlr project to fix this issue.

https://github.com/antlr/antlr4/pull/3648

tkvangorder avatar Apr 12 '22 00:04 tkvangorder

Update: ANTLR is pinned back to 4.9.3.

There are several downstream projects that have dependencies that are not compatible with antlr 4.10.1.

  • rewrite-maven-plugin: checkstyle
  • graphql-java

traceyyoshima avatar Apr 18 '22 19:04 traceyyoshima

Posterity, this issue is blocked by https://github.com/graphql-java/graphql-java/issues/2809.

traceyyoshima avatar Jun 02 '22 17:06 traceyyoshima

It appears checkstyle is now updated.

https://github.com/checkstyle/checkstyle/commit/1e862ff74bcfd34eaa10d8e0bb7c11abf26d8927

tkvangorder avatar Jun 02 '22 17:06 tkvangorder

So the only downstream dependency that is preventing this is the graphql project?

tkvangorder avatar Jun 02 '22 17:06 tkvangorder

So the only downstream dependency that is preventing this is the graphql project?

Yes. checkstyle was updated pretty quickly, but graphql-java has essentially stated it's not a priority.

traceyyoshima avatar Jun 02 '22 18:06 traceyyoshima

I (probably) ran into this issue, using the org.openrewrite.recipe:rewrite-recipe-bom:1.12.3:

ANTLR Tool version 4.9.3 used for code generation does not match the current runtime version 4.10.1
ANTLR Runtime version 4.9.3 used for parser compilation does not match the current runtime version 4.10.1

Overriding the Antlr version to 4.9.3 helps.

Are there any plans to upgrade to a newer Antlr version?

rsynek avatar Nov 28 '22 15:11 rsynek