Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit 5bbee05

Browse files
committedApr 29, 2020
8243665: exploded-image-optimize touches module-info.class in all modules
Reviewed-by: alanb
1 parent 46a67f4 commit 5bbee05

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎make/jdk/src/classes/build/tools/jigsaw/AddPackagesAttribute.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -34,6 +34,7 @@
3434
import java.nio.file.Files;
3535
import java.nio.file.Path;
3636
import java.nio.file.Paths;
37+
import java.util.Arrays;
3738
import java.util.Optional;
3839
import java.util.Set;
3940

@@ -83,7 +84,10 @@ static void addPackagesAttribute(Path mi, Set<String> packages) throws IOExcepti
8384
bytes = baos.toByteArray();
8485
}
8586

86-
Files.write(mi, bytes);
87+
byte[] currentBytes = Files.readAllBytes(mi);
88+
if (!Arrays.equals(bytes, currentBytes)) {
89+
Files.write(mi, bytes);
90+
}
8791
}
8892

8993
}

0 commit comments

Comments
 (0)