Skip to content

Commit

Permalink
Update CustomCMMID.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mrserb committed May 16, 2024
1 parent 6bfb2cb commit 2816f69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/jdk/java/awt/color/ICC_Profile/CustomCMMID.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ public static void main(String[] args) {

private static ICC_Profile createProfile(int type) {
byte[] data = ICC_Profile.getInstance(type).getData();
System.arraycopy(JAVA_ID, 0, data, ICC_Profile.icHdrCmmId, 4);
System.arraycopy(JAVA_ID, 0, data, ICC_Profile.icHdrCmmId,
JAVA_ID.length);
return ICC_Profile.getInstance(data);
}

private static void validate(ICC_Profile p) {
byte[] header = p.getData(ICC_Profile.icSigHead);
byte[] id = new byte[4];
System.arraycopy(header, ICC_Profile.icHdrCmmId, id, 0, 4);
byte[] id = new byte[JAVA_ID.length];
System.arraycopy(header, ICC_Profile.icHdrCmmId, id, 0, JAVA_ID.length);

if (!java.util.Arrays.equals(id, JAVA_ID)) {
System.err.println("Expected: " + Arrays.toString(JAVA_ID));
Expand Down

0 comments on commit 2816f69

Please sign in to comment.