RFR: 8332497: javac prints an AssertionError when annotation processing runs on program with module imports [v15]
Evemose
duke at openjdk.org
Thu May 23 10:41:06 UTC 2024
On Wed, 22 May 2024 21:29:33 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 two additional commits since the last revision:
>
> - Added missing @
> - Update ModuleImportProcessingTest.java
>
> Added @build for Javac...Processor
what I figured is that -J-Dtest.enable.preview=true option is added to `@compile/process`. But even when `--enable-preview --source ${jdk.version}` is explictily specified, and is present in command line, for some reason, java.lang.UnsupportedClassVersionError: Preview features are not enabled for ModuleImportProcessingTest (class file version 67.65535). Try running with '--enable-preview' si still thrown. I guess it is some sor of a bug in a jtreg, I will file it later. For now, I will rollback to toolbox-based test, because it, at least, works fine
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19292#issuecomment-2126785757
More information about the compiler-dev
mailing list