From: Tim Allison Date: Wed, 5 Apr 2017 11:02:48 +0000 (+0000) Subject: bug 50955 convert Set to Singleton per Javen's code review X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f4268499473613211170d3c1b709c55161fc7754;p=poi.git bug 50955 convert Set to Singleton per Javen's code review git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1790215 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/util/CodePageUtil.java b/src/java/org/apache/poi/util/CodePageUtil.java index 5877a38cfb..15bd2a8f16 100644 --- a/src/java/org/apache/poi/util/CodePageUtil.java +++ b/src/java/org/apache/poi/util/CodePageUtil.java @@ -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 DOUBLE_BYTE_CHARSETS - = new HashSet(); - - static { - DOUBLE_BYTE_CHARSETS.add(StringUtil.BIG5); - //others? - } + public static final Set DOUBLE_BYTE_CHARSETS = Collections.singleton(StringUtil.BIG5); /**

Codepage 037, a special case

*/ public static final int CP_037 = 37; diff --git a/src/scratchpad/src/org/apache/poi/hwpf/model/OldTextPiece.java b/src/scratchpad/src/org/apache/poi/hwpf/model/OldTextPiece.java index 4e6f71983c..6fc78dfd05 100644 --- a/src/scratchpad/src/org/apache/poi/hwpf/model/OldTextPiece.java +++ b/src/scratchpad/src/org/apache/poi/hwpf/model/OldTextPiece.java @@ -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() + ")";