aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--poi/src/main/java/org/apache/poi/util/BitFieldFactory.java7
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));
}
}