On Fri, 27 Mar 2026 20:20:33 GMT, Bill Huang <[email protected]> wrote:
>> The idea is to implement the **ValueClass** annotation that can be used in
>> test code to allow to run the same tests with and without --enable-preview.
>>
>> This annotation should be used to mark value classes.
>>
>> The new jtreg test compilation and execution mode that uses javac plugin to
>> process classes during compilation. This plugin change classes with
>> **ValueClass** annotation to value classes.
>> By default, the annotation doesn't have any impact on the tests.
>>
>> Here are the work items:
>>
>> 1. Create ValueClass annotation.
>> 2. Create a javac plugin, ValueClassPlugin, that implements a TaskListener
>> to mark a class as a value class during the PARSE phase.
>> 3. Build the ValueClass plugin.
>> 4. Pass a new plugin option, -Xplugin:ValueClassPlugin, to enable the plugin
>> and enable preview.
>
> Bill Huang has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Rename ValueClass to AsValueClass.
test/jtreg_value_class_plugin/plugin/jdk/test/valueclass/ValueClassPlugin.java
line 82:
> 80: boolean hasAnnotation =
> tree.mods.annotations.stream()
> 81: .anyMatch(a -> a.annotationType.toString()
> 82: .endsWith("AsValueClass"));
Though it seems unlikely that there would be another annotation that ends in
`AsValueClass`,
shouldn't this be checking for a delimiter or checking the full annotation name.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2253#discussion_r3010388860