[lworld] RFR: 8377101: [lworld] Automatically generate value class sources based on source annotations [v2]
David Beaumont
duke at openjdk.org
Fri Feb 27 14:32:56 UTC 2026
On Fri, 27 Feb 2026 12:53:13 GMT, David Beaumont <duke at openjdk.org> wrote:
>> Adds a new AnnotationProcessor to read the @MigratedValueClass on prospective value classes and generate the equivalent source file with the 'value' keyword at each annotated class declaration.
>>
>> This adds new PROCESSOR_PATH variable to the compilation macro and use it for annotation processing.
>> This also requires moving the plugin discovery path to the new variable (was in classpath before) because the addition of a '--processor-path' flag disables using the classpath for plugin discovery.
>>
>> For now this is all limited to `java.base` but that's expandable later easily. There was an issue just enabling it for all modules however (esp. `jdk.incubator` which might be special).
>>
>> While there is currently no specific unit test for this code, if it were to fail to generate the correct value classes, a lot of other downstream tests would fail.
>
> David Beaumont has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove unused file
Note: If you are testing this, you *must* `make clean` first, or else it will fail with a warning about the AP option not being recognised.
make/CompileJavaModules.gmk line 78:
> 76: ifeq ($(MODULE), java.base)
> 77: PREPROCESSOR_FLAGS := \
> 78: -Xlint:-removal -Xlint:-processing \
This is probably contentious, and should be temporary, but there's a bug in javac which this work uncovered, and enabling annotation processing confuses javac into giving out unexpected warnings.
See: https://bugs.openjdk.org/browse/JDK-8378740
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/2180#issuecomment-3973246060
PR Review Comment: https://git.openjdk.org/valhalla/pull/2180#discussion_r2863933027
More information about the valhalla-dev
mailing list