]> source.dussan.org Git - poi.git/commitdiff
bug 50955 convert Set to Singleton per Javen's code review
authorTim Allison <tallison@apache.org>
Wed, 5 Apr 2017 11:02:48 +0000 (11:02 +0000)
committerTim Allison <tallison@apache.org>
Wed, 5 Apr 2017 11:02:48 +0000 (11:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1790215 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/util/CodePageUtil.java
src/scratchpad/src/org/apache/poi/hwpf/model/OldTextPiece.java

index 5877a38cfb6d2fddd9bb96620cab7cd085512e3e..15bd2a8f162cf0a7f086af9b6c675322f102adbb 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.poi.util;
 
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
-import java.util.HashSet;
+import java.util.Collections;
 import java.util.Set;
 
 /**
@@ -31,13 +31,7 @@ import java.util.Set;
 public class CodePageUtil
 {
 
-    public static final Set<Charset> DOUBLE_BYTE_CHARSETS
-            = new HashSet<Charset>();
-
-    static {
-        DOUBLE_BYTE_CHARSETS.add(StringUtil.BIG5);
-        //others?
-    }
+    public static final Set<Charset> DOUBLE_BYTE_CHARSETS = Collections.singleton(StringUtil.BIG5);
 
     /** <p>Codepage 037, a special case</p> */
     public static final int CP_037 = 37;
index 4e6f71983cf0dc2499a53c9737ad2e987e897193..6fc78dfd05b072f546f65d29c6abdde7aa739542 100644 (file)
@@ -102,14 +102,6 @@ public class OldTextPiece extends TextPiece {
         return 42; // any arbitrary constant will do
     }
 
-
-    /**
-     * Returns the character position we start at.
-     */
-    public int getCP() {
-        return getStart();
-    }
-
     public String toString() {
         return "OldTextPiece from " + getStart() + " to " + getEnd() + " ("
                 + getPieceDescriptor() + ")";