aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2024-10-26 16:34:40 +0000
committerPJ Fanning <fanningpj@apache.org>2024-10-26 16:34:40 +0000
commit9185ec02c5d814ae22bed7d2348650fb1bbf7ec8 (patch)
treef4907b7064c40cd84afc5eb9748fc83bbd6dac0c /poi-ooxml
parent69d935d4dbe348d3b87502479643c4e756e76a70 (diff)
downloadpoi-9185ec02c5d814ae22bed7d2348650fb1bbf7ec8.tar.gz
poi-9185ec02c5d814ae22bed7d2348650fb1bbf7ec8.zip
immutable maps
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1921575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/GeometryRowTypes.java5
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/XDGFSectionTypes.java5
2 files changed, 6 insertions, 4 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/GeometryRowTypes.java b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/GeometryRowTypes.java
index 7dd4641107..4c64af53fd 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/GeometryRowTypes.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/GeometryRowTypes.java
@@ -17,6 +17,7 @@
package org.apache.poi.xdgf.usermodel.section;
+import java.util.Collections;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -84,6 +85,6 @@ enum GeometryRowTypes {
return l.constructor.apply(row);
}
- private static final Map<String, GeometryRowTypes> LOOKUP =
- Stream.of(values()).collect(Collectors.toMap(GeometryRowTypes::getRowType, Function.identity()));
+ private static final Map<String, GeometryRowTypes> LOOKUP = Collections.unmodifiableMap(
+ Stream.of(values()).collect(Collectors.toMap(GeometryRowTypes::getRowType, Function.identity())));
}
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/XDGFSectionTypes.java b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/XDGFSectionTypes.java
index 35af8d52be..887dfa0333 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/XDGFSectionTypes.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xdgf/usermodel/section/XDGFSectionTypes.java
@@ -17,6 +17,7 @@
package org.apache.poi.xdgf.usermodel.section;
+import java.util.Collections;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Function;
@@ -72,6 +73,6 @@ enum XDGFSectionTypes {
return l.constructor.apply(section, containingSheet);
}
- private static final Map<String, XDGFSectionTypes> LOOKUP =
- Stream.of(values()).collect(Collectors.toMap(XDGFSectionTypes::getSectionType, Function.identity()));
+ private static final Map<String, XDGFSectionTypes> LOOKUP = Collections.unmodifiableMap(
+ Stream.of(values()).collect(Collectors.toMap(XDGFSectionTypes::getSectionType, Function.identity())));
}