OSDN Git Service

共通文字列を定数化
authorOlyutorskii <olyutorskii@users.osdn.me>
Thu, 28 Apr 2011 09:17:26 +0000 (18:17 +0900)
committerOlyutorskii <olyutorskii@users.osdn.me>
Thu, 28 Apr 2011 09:17:26 +0000 (18:17 +0900)
src/main/java/jp/sourceforge/jindolf/parser/DecodedContent.java

index 1784cc0..569bab1 100644 (file)
@@ -28,6 +28,8 @@ public class DecodedContent
      */\r
     public static final char ALTCHAR = '?';\r
 \r
+    private static final String NULLTEXT = "null";\r
+\r
     private static final List<DecodeErrorInfo> EMPTY_LIST =\r
             Collections.emptyList();\r
 \r
@@ -354,7 +356,7 @@ public class DecodedContent
      */\r
     public DecodedContent append(CharSequence seq){\r
         if(seq == null){\r
-            this.rawContent.append("null");\r
+            this.rawContent.append(NULLTEXT);\r
         }else if(seq instanceof DecodedContent){\r
             append((DecodedContent)seq, 0, seq.length());\r
         }else{\r
@@ -375,7 +377,7 @@ public class DecodedContent
                                   int startPos, int endPos)\r
             throws IndexOutOfBoundsException{\r
         if(seq == null){\r
-            this.rawContent.append("null", startPos, endPos);\r
+            this.rawContent.append(NULLTEXT, startPos, endPos);\r
         }else if(seq instanceof DecodedContent){\r
             append((DecodedContent)seq, startPos, endPos);\r
         }else{\r
@@ -397,7 +399,7 @@ public class DecodedContent
                                   int startPos, int endPos)\r
             throws IndexOutOfBoundsException{\r
         if(source == null){\r
-            return append("null", startPos, endPos);\r
+            return append(NULLTEXT, startPos, endPos);\r
         }\r
 \r
         int gap = startPos - this.rawContent.length();\r