[lworld] RFR: 8351362: Post-process @Strict annotation for testing [v3]

Dan Smith dlsmith at openjdk.org
Wed Mar 19 01:25:28 UTC 2025


On Tue, 18 Mar 2025 20:10:48 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> @dansmithcode aims to migrate all usages of the internal strict to this test-specific strict. This is actually the reason behind this PR - annotations in the Java Language must not change program semantics.
>
> That would then apply to NullRestricted also?
> That seems like an unnecessary split, since Strict is an internal annotation, it doesn't matter whether it is declared in a test specific library or jdk.internal.value. and it make maintenance harder because they are split.
> And it makes prototyping uses of Strict more difficult.
> And not defined or specified anywhere.

The idea is that the `@Strict` annotation should live next to the tool that interprets it.

If we decide we need a translation tool in `jdk.internal`, then putting `@Strict` there too makes sense. If this is purely a test-writing tool, then `@Strict` belongs in tests.

`@NullRestricted` is interpret by the JVM, so it makes sense that it lives in the JVM's internal API.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1395#discussion_r2002236160


More information about the valhalla-dev mailing list