OSDN Git Service

実数表記の揺れを吸収
[mikutoga/TogaGem.git] / src / main / java / jp / sourceforge / mikutoga / xml / DomUtils.java
index fcd88b9..c516563 100644 (file)
@@ -20,6 +20,9 @@ import org.w3c.dom.Node;
  */
 public final class DomUtils {
 
+    // 構文解析バグ回避。
+    private static final char BS_CHAR = (char) 0x005c;
+
     /**
      * 隠しコンストラクタ。
      */
@@ -148,7 +151,7 @@ public final class DomUtils {
             throw new TogaXmlException(message, e);
         }
 
-        result.replace("" + '\u00a5', "" + '\u005c\u005c');
+        result.replace("" + '\u00a5', "" + BS_CHAR);
 
         return result;
     }
@@ -311,14 +314,14 @@ public final class DomUtils {
     /**
      * 同じ親要素と同じ要素名を持つ兄弟要素を列挙する列挙子。
      */
-    private static class ElemIterator implements Iterator<Element>{
+    private static final class ElemIterator implements Iterator<Element> {
         private Element next;
 
         /**
          * コンストラクタ。
          * @param elem 最初の要素。nullを指定すれば空列挙子となる。
          */
-        private ElemIterator(Element elem){
+        ElemIterator(Element elem){
             super();
             this.next = elem;
         }