[Yanel-commits] rev 40404 - public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation

michi at wyona.com michi at wyona.com
Tue Dec 9 16:35:56 CET 2008


Author: michi
Date: 2008-12-09 16:35:56 +0100 (Tue, 09 Dec 2008)
New Revision: 40404

Modified:
   public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeDOMImpl.java
Log:
obsolete else removed and removeChild impl suggested

Modified: public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeDOMImpl.java
===================================================================
--- public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeDOMImpl.java	2008-12-09 15:33:00 UTC (rev 40403)
+++ public/yanel/trunk/src/impl/java/org/wyona/yanel/impl/navigation/NodeDOMImpl.java	2008-12-09 15:35:56 UTC (rev 40404)
@@ -73,9 +73,12 @@
     }
 
     /**
+     * Remove child
      */
     public void removeChild(Node child) {
-        log.error("TODO: Implementation not finished yet!");
+        log.warn("TODO: Implementation not finished yet!");
+        //this.element.removeChild( ((NodeDOMImpl) child).getElement() );
+        //sitetree.save();
     }
 
     /**
@@ -83,15 +86,11 @@
      */
     public boolean isResource() {
         org.w3c.dom.NodeList nl = element.getElementsByTagName("node");
-        if (nl == null) {
+        if (nl == null)
             return true;
-        } else {
-            if (nl.getLength() > 0) {
-                return false;
-            } else {
-                return true;
-            }
-        }
+        if (nl.getLength() > 0) 
+            return false;
+        return true;
     }
 
     /**
@@ -102,12 +101,10 @@
         if (nl != null) {
             if (nl.getLength() > 0) {
                 return true;
-            } else {
-                return false;
             }
-        } else {
             return false;
         }
+        return false;
     }
 
     /**
@@ -137,9 +134,8 @@
     public Node getParent() {
         if (!element.getNodeName().equals("sitetree")) {
             return new NodeDOMImpl((org.w3c.dom.Element) element.getParentNode(), sitetree);
-        } else {
-            return null;
         }
+        return null;
     }
 
     /**
@@ -168,9 +164,8 @@
                 name = name + "/";
             }
             return getParent().getPath() + name;
-        } else { // Root node reached
-            return "/";
         }
+        return "/";
     }
 
     /**
@@ -191,9 +186,8 @@
         if (element.getNodeName().equals("sitetree")) {
             log.warn("Sitetree node has no label");
             return null;
-        } else {
-            return element.getElementsByTagName("label").item(0).getFirstChild().getNodeValue();
         }
+        return element.getElementsByTagName("label").item(0).getFirstChild().getNodeValue();
     }
 
     /**



More information about the Yanel-commits mailing list