RFR: JDK-8346465 : Add a check in setData() to restrict the update of Built-In ICC_Profiles [v5]
Harshitha Onkar
honkar at openjdk.org
Thu Feb 20 18:17:53 UTC 2025
On Thu, 20 Feb 2025 14:42:04 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>>
>> javadoc change
>
> src/java.desktop/share/classes/java/awt/color/ICC_Profile.java line 1164:
>
>> 1162: * array can not be interpreted as valid tag data, corresponding to
>> 1163: * the {@code tagSignature}
>> 1164: * @throws IllegalArgumentException if this is a profile for one of the
>
> `IllegalStateException` better describes the reason: the argument to the method can be perfectly valid, but the internal state of the object doesn't allow modifications.
@aivanov-jdk
_IllegalStateException - Signals that a method has been invoked at an **illegal or inappropriate time.**_
Since IllegalStateException is thrown to indicate more of an unstable state of object, it may not be what we want here. The exception is to be thrown when the ICC_Profile object invoking .setData() is JDK Built-in profile and IIlegalArgumentException more closely match this case.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23606#discussion_r1964122293
More information about the client-libs-dev
mailing list