On Mon, 3 Mar 2025 17:47:57 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

>> Harshitha Onkar has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   doc update
>
> src/java.desktop/share/classes/java/awt/color/ICC_Profile.java line 1169:
> 
>> 1167:      * @throws IllegalArgumentException if this is a built-in profile 
>> for one
>> 1168:      *         of the pre-defined ColorSpaces, i.e. those which can be 
>> obtained
>> 1169:      *         by calling {@code ICC_Profile.getInstance(int 
>> colorSpaceID)}
> 
> can we just ignore it instead and did not use suspicion 
> IllegalArgumentException for correct parameters? or change the type to 
> something unrelated to "..ArgumentException"?

The silently do nothing option was considered, but if you do that, then you 
have no easy way of knowing if it worked.
Tests may pass spuriously, or fail later for the wrong reasons. So a worse 
choice.
And in all my searching of uses of this API it is (1) tests in the JDK itself 
and (2) a couple of libraries that are targeting specific known profiles with 
issues and are fixed up - so never applied to built-in profiles.

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

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

Reply via email to