On Wed, 5 Mar 2025 20:01:20 GMT, Harshitha Onkar <hon...@openjdk.org> wrote:
>> This is an interesting observation. >> >> Are the unserialized built-in profiles mapped to their corresponding >> singleton instances? I presume it's the case. Then, the `builtIn` flag will >> still be set to `true` in the returned object. >> >> **Should the serialized form be preserved?** >> >> If the `builtIn` field is `transient`, built-in profiles written by JDK 25 >> (mainline) could still be read in previous versions and vice versa. This >> will improve the backward compatibility. > > Good point. I had not considered the effect of serialization on builtIn flag, > let me check and get back. Yes, readObject(..) and readResolve(..) will return the singleton, as per the serialization spec 👍 https://docs.oracle.com/en/java/javase/21/docs/api/serialized-form.html#java.awt.color.ICC_Profile but I agree we don't need to mention that here. Yes, I agree builtIn should be transient, since we return the singleton as above, all will work as expected. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23606#discussion_r1982214177