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

Roger Riggs rriggs at openjdk.org
Wed Mar 19 14:23:22 UTC 2025


On Wed, 19 Mar 2025 01:20:48 GMT, Dan Smith <dlsmith at openjdk.org> wrote:

>> 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.

It has been said that in tests every NullRestricted annotated element should also have @Strict.
Since @Strict is there only for test generation; would it be simpler to have the tool look for NullRestricted and do the right thing; avoiding both excessive editing of tests and parallel but dependent annotations.

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

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


More information about the valhalla-dev mailing list