diff options
author | Axel Howind <axh@apache.org> | 2024-02-28 09:35:46 +0000 |
---|---|---|
committer | Axel Howind <axh@apache.org> | 2024-02-28 09:35:46 +0000 |
commit | 6b40b7f966de92beebadea9fec32732243b104ff (patch) | |
tree | 7d8f161c931cc9ddb793b90bd6a9a71a060f65cc /poi | |
parent | 2496ce5229ae0327a11438a7ca13116e680bae8e (diff) | |
download | poi-6b40b7f966de92beebadea9fec32732243b104ff.tar.gz poi-6b40b7f966de92beebadea9fec32732243b104ff.zip |
use Map.computeIfAbsent()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1916034 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r-- | poi/src/main/java/org/apache/poi/util/BitFieldFactory.java | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/poi/src/main/java/org/apache/poi/util/BitFieldFactory.java b/poi/src/main/java/org/apache/poi/util/BitFieldFactory.java index e35c80cacc..4893d5e61b 100644 --- a/poi/src/main/java/org/apache/poi/util/BitFieldFactory.java +++ b/poi/src/main/java/org/apache/poi/util/BitFieldFactory.java @@ -27,11 +27,6 @@ public class BitFieldFactory { private static Map<Integer, BitField> instances = new HashMap<>(); public static BitField getInstance(int mask) { - BitField f = instances.get(Integer.valueOf(mask)); - if (f == null) { - f = new BitField(mask); - instances.put(Integer.valueOf(mask), f); - } - return f; + return instances.computeIfAbsent(mask, k -> new BitField(mask)); } } |