On Thu, 12 Mar 2026 16:16:54 GMT, David Beaumont <[email protected]> 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.
>> 
>> ---------
>> - [ ] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> David Beaumont has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Remove unwanted lint warning suppression

make/jdk/src/classes/build/tools/valhalla/valuetypes/GenValueClasses.java line 
87:

> 85: 
> 86:     // Matches preprocessor option flag in CompileJavaModules.gmk.
> 87:     private static final String OUTDIR_OPTION_KEY = "valueclasses.outdir";

Suggestion:

@SupportedAnnotationTypes(GenValueClasses.MIGRATED_VALUE_CLASS_ANNOTATION)
@SupportedOptions(GenValueClasses.OUTDIR_OPTION_KEY)
public final class GenValueClasses extends AbstractProcessor {
    static final String MIGRATED_VALUE_CLASS_ANNOTATION = 
"jdk.internal.MigratedValueClass";

    // Matches preprocessor option flag in CompileJavaModules.gmk.
    static final String OUTDIR_OPTION_KEY = "valueclasses.outdir";

-------------

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2180#discussion_r3085425593

Reply via email to