mirror of
https://github.com/apache/poi.git
synced 2025-02-22 01:55:12 +00:00
use Map.computeIfAbsent()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1916034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2496ce5229
commit
6b40b7f966
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user