On Tue, 21 Jul 2026 16:53:30 GMT, Chen Liang <[email protected]> wrote:

> The Deserializer documentation states that it only applies to the boot class 
> path:
> 
> https://github.com/openjdk/valhalla/blob/1c3301cb96d779d06bb6e2391c35ce729bc28189/src/java.base/share/classes/jdk/internal/value/Deserializer.java#L58-L59
> 
> 
> There is an implementation defect right now that this annotation is scanned 
> from all sources.
> 
> Updated `ValueSerializationTest` to add positive and negative tests for a 
> value class with `@Deserializer` both on and off the boot class path.
> 
> In the test updates I noticed `SerializedObjectCombo` is broken that it never 
> generates value classes somehow; tracked in 
> [JDK-8388597](https://bugs.openjdk.org/browse/JDK-8388597).
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

I like getting this in now and considering further restrictions via JDK-8388784.

(FWIW, if you're patching the bootclasspath, you're in hacked JDK territory, 
and unspecified behavior can occur. I'm not sure of the details, but I think it 
makes sense to apply whatever standard we use to enforce "internal only" for 
other JDK annotations. No need to go further. But let's sort that out later.)

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

Marked as reviewed by dlsmith (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2661#pullrequestreview-4756037154

Reply via email to