On Wed, 1 Apr 2026 22:19:47 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:
> 
>   Remove the separate valueClassAnnotation.jar build step since 
> ValueClassPlugin matches @AsValueClass by name and jtreg recompiles library 
> sources per-test, making the pre-built annotation JAR unnecessary.

Changes requested by lmesnik (Committer).

make/RunTests.gmk line 97:

> 95: 
> 96: JTREG_VALUE_CLASS_PLUGIN_DIR := $(TEST_IMAGE_DIR)/jtreg_value_class_plugin
> 97: JTREG_VALUE_CLASS_ANNOTATION_JAR := 
> $(JTREG_VALUE_CLASS_PLUGIN_DIR)/valueClassAnnotation.jar

is this line needed?

make/RunTests.gmk line 885:

> 883: 
> 884:   ifneq ($$(wildcard $$(JTREG_VALUE_CLASS_PLUGIN_JAR)), )
> 885:     $1_JTREG_BASIC_OPTIONS += -cpa:$$(JTREG_VALUE_CLASS_PLUGIN_JAR)

I think that no separate 
ifneq ($$(wildcard $$(JTREG_VALUE_CLASS_PLUGIN_JAR)), )
is needed
just add it in the nex if block after line 888

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

PR Review: 
https://git.openjdk.org/valhalla/pull/2253#pullrequestreview-4047391025
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2253#discussion_r3024938552
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2253#discussion_r3024942480

Reply via email to