RFR: JDK-8346465 : Add a check in setData() to restrict the update of Built-In ICC_Profiles [v11]

Sergey Bylokhov serb at openjdk.org
Mon Mar 3 20:16:58 UTC 2025


On Mon, 3 Mar 2025 18:15:35 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

> This builtin flag check is exclusively for JDK built-in profiles created within the private interface `BuiltInProfile` and not applicable if an application loads the profile by serialization.

The built-in profiles can be serialized and deserialized, [see](https://github.com/openjdk/jdk/blob/c4b516dfe7c5a5fddd4d9c97a21f5f36bf845646/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java#L1573). This means the application may get a reference to the profile not only via the getInstance(id) method. Therefore, the new spec is not strictly accurate regarding ICC_Profile.getInstance(int colorSpaceID), but I am not sure that we should mention serialisation here.

**Note:** 
The new Javadoc for the new private built-in flag is "public" via the serialized form of the class. It probably should be marked as transient, so it will only be set to true when the built-in profile is loaded via serialization. In all other cases, it will be false.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23606#discussion_r1978134779


More information about the client-libs-dev mailing list