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
This commit is contained in:
Tim Allison 2017-04-05 11:02:48 +00:00
parent 55ed734108
commit e4c2fa0fe0
2 changed files with 2 additions and 16 deletions

View File

@ -19,7 +19,7 @@ package org.apache.poi.util;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.HashSet; import java.util.Collections;
import java.util.Set; import java.util.Set;
/** /**
@ -31,13 +31,7 @@ import java.util.Set;
public class CodePageUtil public class CodePageUtil
{ {
public static final Set<Charset> DOUBLE_BYTE_CHARSETS public static final Set<Charset> DOUBLE_BYTE_CHARSETS = Collections.singleton(StringUtil.BIG5);
= new HashSet<Charset>();
static {
DOUBLE_BYTE_CHARSETS.add(StringUtil.BIG5);
//others?
}
/** <p>Codepage 037, a special case</p> */ /** <p>Codepage 037, a special case</p> */
public static final int CP_037 = 37; public static final int CP_037 = 37;

View File

@ -102,14 +102,6 @@ public class OldTextPiece extends TextPiece {
return 42; // any arbitrary constant will do return 42; // any arbitrary constant will do
} }
/**
* Returns the character position we start at.
*/
public int getCP() {
return getStart();
}
public String toString() { public String toString() {
return "OldTextPiece from " + getStart() + " to " + getEnd() + " (" return "OldTextPiece from " + getStart() + " to " + getEnd() + " ("
+ getPieceDescriptor() + ")"; + getPieceDescriptor() + ")";