On Thu, 26 Mar 2026 16:30:38 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: > > Split AddAll test into separate NoPreview and Preview scenarios using > @enablePreview tag. Changes requested by lmesnik (Committer). make/RunTests.gmk line 884: > 882: endif > 883: > 884: ifneq ($$(wildcard $$(JTREG_VALUE_CLASS_ANNOTATION_JAR)), ) Do we need to add this jar into cpa? The tests should add '/test/lib' library and should compile this annotationati anyway? test/jdk/java/util/Collections/AddAll.java line 36: > 34: > 35: /* > 36: * @test id=Preview I think that is going to fail if test is executed with jtreg -jdk:<jdk> -test .... I think that is better to support make JTREG_VALUE_CLASS=true run-test TEST=test/jdk/java/util/Collections/AddAll.java and in this mode test is compiled with this plugin. So we are not executing the preview mode by default, but can run all our test compiling and executing with `--enable-preview`. So all JDK build in value classes and these ValueClass marked classes are value classes. ------------- PR Review: https://git.openjdk.org/valhalla/pull/2253#pullrequestreview-4018222335 PR Review Comment: https://git.openjdk.org/valhalla/pull/2253#discussion_r2998407016 PR Review Comment: https://git.openjdk.org/valhalla/pull/2253#discussion_r2998430554
