Skip to content

Commit

Permalink
Avoid use of modern Java API.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Sep 23, 2024
1 parent 3d07488 commit 73dbd13
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3426,7 +3426,8 @@ public void close() {
}

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

Expand Down

0 comments on commit 73dbd13

Please sign in to comment.