RFR: 8374155: Add @AOTSafeClassInitializer to Record [v2]

Per Minborg pminborg at openjdk.org
Thu Jan 8 18:46:19 UTC 2026


On Thu, 8 Jan 2026 18:37:40 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> test/jdk/java/lang/Record/SafeClassInitializerTest.java line 44:
>> 
>>> 42:     @Test
>>> 43:     void printlnNoParamsTest() {
>>> 44:         new MyRecord(-1);
>> 
>> I don't understand what this is testing as I don't see an AOT cache being built anywhere.  What I am I missing?
>
> It asserts that a user-defined record can be annotated with `@AOTSafeClassInitializer`. This was not possible before.

But maybe that does not work. No. I thought the AOT testing worked as a variant like debug, but that might not be the case. I will take a look at https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/runtime/cds/appcds/aotClassLinking/GeneratedInternedString.java

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29084#discussion_r2673464634


More information about the core-libs-dev mailing list