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

Sergey Bylokhov serb at openjdk.java.net
Sun Jan 31 11:58:57 UTC 2021


On Sun, 31 Jan 2021 01:41:55 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.

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

> 965:      *         Profile data
> 966:      */
> 967:     public static ICC_Profile getInstance(InputStream s) throws IOException {

This additional check was needed when the getInstance(byte[]) thrown NPE on null

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

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


More information about the 2d-dev mailing list