This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push: new 1fe704b5 Use modern Map APIs 1fe704b5 is described below commit 1fe704b5345cb2a21e1cb16e7ac892a3a6ca67e8 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Fri Jul 7 00:07:18 2023 -0400 Use modern Map APIs --- .../org/apache/commons/compress/harmony/unpack200/IcBands.java | 7 +------ .../compress/harmony/unpack200/SegmentConstantPoolArrayCache.java | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/IcBands.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/IcBands.java index fbf53780..430215bc 100644 --- a/src/main/java/org/apache/commons/compress/harmony/unpack200/IcBands.java +++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/IcBands.java @@ -217,12 +217,7 @@ public class IcBands extends BandSet { // add tuple to corresponding bucket final String key = tuple.outerClassString(); - List<IcTuple> bucket = outerClassToTuples.get(key); - if (bucket == null) { - bucket = new ArrayList<>(); - outerClassToTuples.put(key, bucket); - } - bucket.add(tuple); + outerClassToTuples.computeIfAbsent(key, k -> new ArrayList<>()).add(tuple); } } } diff --git a/src/main/java/org/apache/commons/compress/harmony/unpack200/SegmentConstantPoolArrayCache.java b/src/main/java/org/apache/commons/compress/harmony/unpack200/SegmentConstantPoolArrayCache.java index 48dd5030..32c0a5f6 100644 --- a/src/main/java/org/apache/commons/compress/harmony/unpack200/SegmentConstantPoolArrayCache.java +++ b/src/main/java/org/apache/commons/compress/harmony/unpack200/SegmentConstantPoolArrayCache.java @@ -58,8 +58,7 @@ public class SegmentConstantPoolArrayCache { protected void cacheIndexes() { for (int index = 0; index < primaryArray.length; index++) { final String key = primaryArray[index]; - primaryTable.computeIfAbsent(key, k -> new ArrayList<>()); - primaryTable.get(key).add(Integer.valueOf(index)); + primaryTable.computeIfAbsent(key, k -> new ArrayList<>()).add(Integer.valueOf(index)); } }