RFR: 8332497: javac prints an AssertionError when annotation processing runs on program with module imports [v13]
Chen Liang
liach at openjdk.org
Wed May 22 20:22:03 UTC 2024
On Wed, 22 May 2024 19:55:16 GMT, Evemose <duke at openjdk.org> wrote:
>> Fix is pretty simple: visitModuleImport in com.sun.tools.javac.tree.TreeScanner has notbeen overriden, so defaulted to Visitor::visitModuleImport, which forwards to Visitor::visitTree, which is also not overriden, and, therefore, threw AssertionError.
>>
>> PS: Im not even sure how it worked before without crashing, seems like there is some intermidiate implementation between this TreeScanner and actual scanners because otherwise it should have resultedin compile error the moment it encounter module importin any visitor
>
> Evemose has updated the pull request incrementally with one additional commit since the last revision:
>
> fixed -source syntax
test/langtools/tools/javac/processing/ModuleImportProcessingTest.java line 36:
> 34: * @modules jdk.compiler
> 35: * @enablePreview
> 36: * @build JavacTestingAbstractProcessor ModuleImportProcessingTest
Suggestion:
* @compile JavacTestingAbstractProcessor.java ModuleImportProcessingTest.java
I think the `build` action doesn't support building dependencies with preview, so `@build ModuleImportProcessingTest` is the one that's failing here. You can revert all those `--enable-preview` for `@compile/process` down below.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19292#discussion_r1610595280
More information about the compiler-dev
mailing list