[OpenJDK 2D-Dev] RFR: 6211198: ICC_Profile.getInstance(byte[]): IAE is not specified [v2]

Phil Race prr at openjdk.java.net
Sun Feb 7 18:38:50 UTC 2021


On Sat, 6 Feb 2021 07:05:05 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> The specification of the java.awt.color.ICC_Profile.getInstance(byte[]) is updated.
>> Its implementation changed over time, and different exceptions were thrown, but since JDK-8013430 always throws an IllegalArgumentException on null and invalid data.
>
> Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Merge branch 'master' into JDK-6211198
>  - Merge branch 'master' into JDK-6211198
>  - Initial fix

src/java.desktop/share/classes/java/awt/color/ICC_Profile.java line 767:

> 765:      * @return an {@code ICC_Profile} object corresponding to the data in the
> 766:      *         specified {@code data} array
> 767:      * @throws IllegalArgumentException If the byte array does not contain valid

The spec does already say "Throws an {@code IllegalArgumentException} if the data does		     
    * not correspond to a valid ICC Profile"
So really you are just adding the @throws clause. 
You might want to consider removing the now redundant text.

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

PR: https://git.openjdk.java.net/jdk/pull/2328


More information about the 2d-dev mailing list