Skip to content

Commit 73dbd13

Browse files
committed
Avoid use of modern Java API.
1 parent 3d07488 commit 73dbd13

File tree

1 file changed

+6
-2
lines changed
  • byte-buddy-dep/src/main/java/net/bytebuddy/build

1 file changed

+6
-2
lines changed

byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3426,7 +3426,8 @@ public void close() {
34263426
}
34273427

34283428
/**
3429-
* A sink that stores all elements in a memory map.
3429+
* A sink that stores all elements in a memory map. In case of multi-release jars, this memory
3430+
* storage aims to retain the non-versioned class file.
34303431
*/
34313432
@HashCodeAndEqualsPlugin.Enhance
34323433
class InMemory implements Target, Sink {
@@ -3482,7 +3483,10 @@ public void store(Map<TypeDescription, byte[]> binaryRepresentations) {
34823483
*/
34833484
public void store(int version, Map<TypeDescription, byte[]> binaryRepresentations) throws IOException {
34843485
for (Map.Entry<TypeDescription, byte[]> entry : binaryRepresentations.entrySet()) {
3485-
storage.putIfAbsent(entry.getKey().getInternalName() + CLASS_FILE_EXTENSION, entry.getValue());
3486+
String name = entry.getKey().getInternalName() + CLASS_FILE_EXTENSION;
3487+
if (!storage.containsKey(name)) {
3488+
storage.put(name, entry.getValue());
3489+
}
34863490
}
34873491
}
34883492

0 commit comments

Comments
 (0)