aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2024-10-15 16:13:17 +0000
committerPJ Fanning <fanningpj@apache.org>2024-10-15 16:13:17 +0000
commitfad6cae019d3dbca9c143855d77f4d2b11c6df3b (patch)
tree8f0c2b7c85188bdc064929daf085f0672ec7f9db /poi-ooxml
parent88a0d4ecf322be33b7df3ebfc21eff1f176a4efb (diff)
downloadpoi-fad6cae019d3dbca9c143855d77f4d2b11c6df3b.tar.gz
poi-fad6cae019d3dbca9c143855d77f4d2b11c6df3b.zip
try to make ExcelAntWorkbookUtilFactory thread safe
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1921338 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java
index 8e6df981b4..16a84cf26e 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/VerticalAlign.java
@@ -16,6 +16,7 @@
==================================================================== */
package org.apache.poi.xwpf.usermodel;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -45,12 +46,14 @@ public enum VerticalAlign {
*/
SUBSCRIPT(3);
- private static final Map<Integer, VerticalAlign> imap = new HashMap<>();
+ private static final Map<Integer, VerticalAlign> imap;
static {
+ final Map<Integer, VerticalAlign> tempMap = new HashMap<>();
for (VerticalAlign p : values()) {
- imap.put(p.getValue(), p);
+ tempMap.put(p.getValue(), p);
}
+ imap = Collections.unmodifiableMap(tempMap);
}
private final int value;