aboutsummaryrefslogtreecommitdiffstats
path: root/poi-scratchpad/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-10-03 22:01:52 +0000
committerPJ Fanning <fanningpj@apache.org>2021-10-03 22:01:52 +0000
commitb2f0d5fc5a3a15b1676d45705429b4a79b8c564e (patch)
tree9f880314811aa3ca001183afdb1f893e13037615 /poi-scratchpad/src
parent41a48d80bcc78c43b042468708baefa7e6c9b6b7 (diff)
downloadpoi-b2f0d5fc5a3a15b1676d45705429b4a79b8c564e.tar.gz
poi-b2f0d5fc5a3a15b1676d45705429b4a79b8c564e.zip
make array into immutable collection (spotbugs issue)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1893862 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-scratchpad/src')
-rw-r--r--poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SubdocumentType.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SubdocumentType.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SubdocumentType.java
index 299f8bd8d2..81da4e6aad 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SubdocumentType.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/SubdocumentType.java
@@ -18,6 +18,10 @@ package org.apache.poi.hwpf.model;
import org.apache.poi.util.Internal;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
/**
* Document text parts that can have text pieces (CPs)
*/
@@ -41,15 +45,12 @@ public enum SubdocumentType {
HEADER_TEXTBOX();
/**
- * Array of {@link SubdocumentType}s ordered by document position and FIB
+ * List of {@link SubdocumentType}s ordered by document position and FIB
* field order
*/
- public static final SubdocumentType[] ORDERED = new SubdocumentType[] {
- MAIN, FOOTNOTE, HEADER, MACRO, ANNOTATION, ENDNOTE, TEXTBOX,
- HEADER_TEXTBOX };
-
- private SubdocumentType()
- {
- }
-
+ public static final List<SubdocumentType> ORDERED = Collections.unmodifiableList(
+ Arrays.asList(
+ MAIN, FOOTNOTE, HEADER, MACRO, ANNOTATION, ENDNOTE, TEXTBOX, HEADER_TEXTBOX
+ )
+ );
}