From f8284700b459fc9cfe6c5a417009a33ae83138c9 Mon Sep 17 00:00:00 2001 From: Harald Kuhr Date: Sat, 11 Dec 2021 22:38:42 +0100 Subject: [PATCH] #631 Attempt to fix tests for JDK 15 & 16 --- .../com/twelvemonkeys/imageio/color/ColorProfilesTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/color/ColorProfilesTest.java b/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/color/ColorProfilesTest.java index 173ae085..68dd1002 100644 --- a/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/color/ColorProfilesTest.java +++ b/imageio/imageio-core/src/test/java/com/twelvemonkeys/imageio/color/ColorProfilesTest.java @@ -117,7 +117,9 @@ public class ColorProfilesTest { @Test(expected = IllegalArgumentException.class) public void testReadProfileRawBadData() throws IOException { - ColorProfiles.readProfileRaw(new ByteArrayInputStream(new byte[5])); + // NOTE: The array here is larger, as there's a bug in OpenJDK 15 & 16, that throws + // ArrayIndexOutOfBoundsException if the stream is shorter than the profile signature... + ColorProfiles.readProfileRaw(new ByteArrayInputStream(new byte[40])); } @Test(expected = IllegalArgumentException.class)