ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1609770 - in /webservices/axiom/trunk/modules: axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/ axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/
Date Fri, 11 Jul 2014 18:50:38 GMT
Author: veithen
Date: Fri Jul 11 18:50:38 2014
New Revision: 1609770

URL: http://svn.apache.org/r1609770
Log:
Merged the nextSibling/previousSibling code into a common aspect.

Added:
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNode.java
  (with props)
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNodeSupport.aj
Modified:
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementSupport.aj
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
    webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/RootNode.java
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
    webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNode.java
Fri Jul 11 18:50:38 2014
@@ -21,5 +21,4 @@ package org.apache.axiom.om.impl.common;
 public interface CoreChildNode {
     CoreParentNode coreGetParent();
     void coreSetParent(CoreParentNode parent);
-    CoreChildNode coreGetNextSiblingIfAvailable();
 }

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/CoreChildNodeSupport.aj
Fri Jul 11 18:50:38 2014
@@ -23,6 +23,25 @@ import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
 
 public aspect CoreChildNodeSupport {
+    private CoreChildNode CoreChildNode.nextSibling;
+    private CoreChildNode CoreChildNode.previousSibling;
+    
+    public final CoreChildNode CoreChildNode.coreGetNextSiblingIfAvailable() {
+        return nextSibling;
+    }
+
+    public final void CoreChildNode.coreSetNextSibling(CoreChildNode nextSibling) {
+        this.nextSibling = nextSibling;
+    }
+    
+    public final CoreChildNode CoreChildNode.coreGetPreviousSibling() {
+        return previousSibling;
+    }
+    
+    public final void CoreChildNode.coreSetPreviousSibling(CoreChildNode previousSibling)
{
+        this.previousSibling = previousSibling;
+    }
+    
     public CoreChildNode CoreChildNode.coreGetNextSibling() throws OMException {
         CoreChildNode nextSibling = coreGetNextSiblingIfAvailable();
         if (nextSibling == null) {

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/INode.java
Fri Jul 11 18:50:38 2014
@@ -18,11 +18,8 @@
  */
 package org.apache.axiom.om.impl.common;
 
-import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.impl.OMNodeEx;
 
 public interface INode extends OMNodeEx, CoreChildNode, ISerializable {
-    public void setNextOMSibling(OMNode node);
 
-    public void setPreviousOMSibling(OMNode previousSibling);
 }

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerSupport.aj
Fri Jul 11 18:50:38 2014
@@ -147,9 +147,9 @@ public aspect OMContainerSupport {
         if (coreGetFirstChildIfAvailable() == null) {
             coreSetFirstChild(child);
         } else {
-            INode lastChild = (INode)coreGetLastKnownChild();
-            child.setPreviousOMSibling(lastChild);
-            lastChild.setNextOMSibling(child);
+            CoreChildNode lastChild = coreGetLastKnownChild();
+            child.coreSetPreviousSibling(lastChild);
+            lastChild.coreSetNextSibling(child);
         }
         coreSetLastChild(child);
 
@@ -210,8 +210,8 @@ public aspect OMContainerSupport {
         }
         while (child != null) {
             CoreChildNode nextSibling = child.coreGetNextSiblingIfAvailable();
-            ((INode)child).setPreviousOMSibling(null);
-            ((INode)child).setNextOMSibling(null);
+            child.coreSetPreviousSibling(null);
+            child.coreSetNextSibling(null);
             child.coreSetParent(null);
             child = nextSibling;
         }

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementSupport.aj?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementSupport.aj
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMElementSupport.aj
Fri Jul 11 18:50:38 2014
@@ -191,8 +191,8 @@ public aspect OMElementSupport {
     
     public void IElement.detachAndDiscardParent() {
         coreSetParent(null);
-        setPreviousOMSibling(null);
-        setNextOMSibling(null);
+        coreSetPreviousSibling(null);
+        coreSetNextSibling(null);
     }
     
     public static void insertChild(OMElement parent, Class[] sequence, int pos, OMNode newChild)
{

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMNodeSupport.aj
Fri Jul 11 18:50:38 2014
@@ -30,4 +30,8 @@ public aspect OMNodeSupport {
     public OMNode INode.getNextOMSibling() {
         return (OMNode)coreGetNextSibling();
     }
+
+    public final OMNode INode.getPreviousOMSibling() {
+        return (OMNode)coreGetPreviousSibling();
+    }
 }

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
Fri Jul 11 18:50:38 2014
@@ -503,10 +503,6 @@ public class AttrImpl extends RootNode i
         // An attribute node doesn't have a builder
     }
 
-    public final Node getNextSibling() {
-        return null;
-    }
-
     public final String lookupNamespaceURI(String specifiedPrefix) {
         Element ownerElement = getOwnerElement();
         return ownerElement == null ? null : ownerElement.lookupNamespaceURI(specifiedPrefix);

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
Fri Jul 11 18:50:38 2014
@@ -25,15 +25,10 @@ import org.apache.axiom.om.OMXMLParserWr
 import org.apache.axiom.om.impl.common.CoreChildNode;
 import org.apache.axiom.om.impl.common.CoreParentNode;
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 
-public abstract class ChildNode extends NodeImpl implements CoreChildNode {
+public abstract class ChildNode extends NodeImpl implements DOMChildNode {
     private ParentNode ownerNode;
     
-    private NodeImpl previousSibling;
-
-    private NodeImpl nextSibling;
-
     public ChildNode(OMFactory factory) {
         super(factory);
     }
@@ -47,23 +42,19 @@ public abstract class ChildNode extends 
     }
 
     final NodeImpl internalGetPreviousSibling() {
-        return previousSibling;
+        return (NodeImpl)coreGetPreviousSibling();
     }
     
     final NodeImpl internalGetNextSibling() {
-        return nextSibling;
+        return (NodeImpl)coreGetNextSiblingIfAvailable();
     }
     
     final void internalSetPreviousSibling(NodeImpl previousSibling) {
-        this.previousSibling = previousSibling;
+        coreSetPreviousSibling((CoreChildNode)previousSibling);
     }
     
     final void internalSetNextSibling(NodeImpl nextSibling) {
-        this.nextSibling = nextSibling;
-    }
-    
-    public final CoreChildNode coreGetNextSiblingIfAvailable() {
-        return (CoreChildNode)nextSibling;
+        coreSetNextSibling((CoreChildNode)nextSibling);
     }
 
     final NodeImpl clone(OMCloneOptions options, ParentNode targetParent, boolean deep, boolean
namespaceRepairing) {
@@ -103,10 +94,6 @@ public abstract class ChildNode extends 
         // Do nothing; a leaf node is always complete
     }
 
-    public final Node getNextSibling() {
-        return (Node)coreGetNextSibling();
-    }
-
     public final CoreParentNode coreGetParent() {
         return parentNode();
     }

Added: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNode.java?rev=1609770&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNode.java
(added)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNode.java
Fri Jul 11 18:50:38 2014
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.impl.dom;
+
+import org.apache.axiom.om.impl.common.CoreChildNode;
+import org.w3c.dom.Node;
+
+public interface DOMChildNode extends Node, CoreChildNode{
+
+}

Propchange: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNodeSupport.aj?rev=1609770&view=auto
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNodeSupport.aj
(added)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DOMChildNodeSupport.aj
Fri Jul 11 18:50:38 2014
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.impl.dom;
+
+import org.w3c.dom.Node;
+
+public aspect DOMChildNodeSupport {
+    public final Node DOMChildNode.getNextSibling() {
+        return (Node)coreGetNextSibling();
+    }
+    
+    public final Node DOMChildNode.getPreviousSibling() {
+        return (Node)coreGetPreviousSibling();
+    }
+}

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
Fri Jul 11 18:50:38 2014
@@ -99,10 +99,6 @@ public class DocumentFragmentImpl extend
         // A document fragment doesn't have a builder
     }
 
-    public final Node getNextSibling() {
-        return null;
-    }
-
     public final String lookupNamespaceURI(String specifiedPrefix) {
         return null;
     }

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
Fri Jul 11 18:50:38 2014
@@ -577,10 +577,6 @@ public class DocumentImpl extends RootNo
         defaultBuild();
     }
 
-    public final Node getNextSibling() {
-        return null;
-    }
-    
     public final String lookupNamespaceURI(String specifiedPrefix) {
         Element documentElement = getDocumentElement();
         return documentElement == null ? null

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
Fri Jul 11 18:50:38 2014
@@ -59,17 +59,13 @@ import java.util.ArrayList;
 import java.util.Iterator;
 
 /** Implementation of the org.w3c.dom.Element and org.apache.axiom.om.Element interfaces.
*/
-public class ElementImpl extends ParentNode implements Element, IElement, NamedNode,
+public class ElementImpl extends ParentNode implements Element, IElement, NamedNode, DOMChildNode,
         OMConstants {
 
     private static final Log log = LogFactory.getLog(ElementImpl.class);
     
     private ParentNode ownerNode;
     
-    private NodeImpl previousSibling;
-
-    private NodeImpl nextSibling;
-
     private int lineNumber;
 
     /**
@@ -114,23 +110,19 @@ public class ElementImpl extends ParentN
     }
 
     final NodeImpl internalGetPreviousSibling() {
-        return previousSibling;
+        return (NodeImpl)coreGetPreviousSibling();
     }
     
     final NodeImpl internalGetNextSibling() {
-        return nextSibling;
+        return (NodeImpl)coreGetNextSiblingIfAvailable();
     }
     
     final void internalSetPreviousSibling(NodeImpl previousSibling) {
-        this.previousSibling = previousSibling;
+        coreSetPreviousSibling((CoreChildNode)previousSibling);
     }
     
     final void internalSetNextSibling(NodeImpl nextSibling) {
-        this.nextSibling = nextSibling;
-    }
-
-    public final CoreChildNode coreGetNextSiblingIfAvailable() {
-        return (CoreChildNode)nextSibling;
+        coreSetNextSibling((CoreChildNode)nextSibling);
     }
 
     OMNamespace handleNamespace(String namespaceURI, String prefix) {
@@ -1033,10 +1025,6 @@ public class ElementImpl extends ParentN
         defaultBuild();
     }
 
-    public final Node getNextSibling() {
-        return (Node)coreGetNextSibling();
-    }
-
     public final CoreParentNode coreGetParent() {
         return parentNode();
     }

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
Fri Jul 11 18:50:38 2014
@@ -498,14 +498,6 @@ public abstract class NodeImpl extends I
         return hasParent() ? internalGetOwnerNode() : null;
     }
 
-    public final OMNode getPreviousOMSibling() {
-        return (OMNode)internalGetPreviousSibling();
-    }
-
-    public final Node getPreviousSibling() {
-        return internalGetPreviousSibling();
-    }
-
     // /
     // /OMNode methods
     // /

Modified: webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/RootNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/RootNode.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/RootNode.java
(original)
+++ webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/RootNode.java
Fri Jul 11 18:50:38 2014
@@ -19,6 +19,7 @@
 package org.apache.axiom.om.impl.dom;
 
 import org.apache.axiom.om.OMFactory;
+import org.w3c.dom.Node;
 
 public abstract class RootNode extends ParentNode {
     public RootNode(OMFactory factory) {
@@ -40,4 +41,12 @@ public abstract class RootNode extends P
     final void internalSetNextSibling(NodeImpl nextSibling) {
         throw new UnsupportedOperationException();
     }
+
+    public final Node getNextSibling() {
+        return null;
+    }
+
+    public final Node getPreviousSibling() {
+        return null;
+    }
 }

Modified: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
Fri Jul 11 18:50:38 2014
@@ -36,12 +36,6 @@ public abstract class OMNodeImpl extends
     /** Field parent */
     protected IContainer parent;
 
-    /** Field nextSibling */
-    protected OMNodeImpl nextSibling;
-
-    /** Field previousSibling */
-    protected OMNodeImpl previousSibling;
-
     /**
      * Constructor OMNodeImpl
      *
@@ -89,17 +83,13 @@ public abstract class OMNodeImpl extends
         }
     }
 
-    public CoreChildNode coreGetNextSiblingIfAvailable() {
-        return nextSibling;
-    }
-
     /**
      * Method setNextOMSibling.
      *
      * @param node
      */
     public void setNextOMSibling(OMNode node) {
-        this.nextSibling = (OMNodeImpl) node;
+        coreSetNextSibling((OMNodeImpl)node);
     }
 
     /**
@@ -116,19 +106,20 @@ public abstract class OMNodeImpl extends
         // builder will always add new nodes to the end of list of children of the
         // document or element being built.
         INode nextSibling = (INode)getNextOMSiblingIfAvailable();
+        INode previousSibling = (INode)coreGetPreviousSibling();
         if (previousSibling == null) {
             parent.coreSetFirstChild(nextSibling);
         } else {
-            previousSibling.setNextOMSibling(nextSibling);
+            previousSibling.coreSetNextSibling(nextSibling);
         }
         if (nextSibling == null) {
             parent.coreSetLastChild(previousSibling);
         } else {
-            nextSibling.setPreviousOMSibling(previousSibling);
+            nextSibling.coreSetPreviousSibling(previousSibling);
         }
 
-        this.previousSibling = null;
-        this.nextSibling = null;
+        coreSetPreviousSibling(null);
+        coreSetNextSibling(null);
         this.parent = null;
         return this;
     }
@@ -147,17 +138,18 @@ public abstract class OMNodeImpl extends
         }
         OMNodeImpl siblingImpl = (OMNodeImpl)parent.prepareNewChild(sibling);
         siblingImpl.coreSetParent(parent);
-        if (nextSibling == null) {
+        if (coreGetNextSiblingIfAvailable() == null) {
             getNextOMSibling();
         }
-        siblingImpl.setPreviousOMSibling(this);
+        siblingImpl.coreSetPreviousSibling(this);
+        OMNodeImpl nextSibling = (OMNodeImpl)coreGetNextSiblingIfAvailable();
         if (nextSibling == null) {
             parent.coreSetLastChild((CoreChildNode)sibling);
         } else {
-            nextSibling.setPreviousOMSibling(sibling);
+            nextSibling.coreSetPreviousSibling((CoreChildNode)sibling);
         }
-        ((INode)sibling).setNextOMSibling(nextSibling);
-        nextSibling = siblingImpl;
+        ((INode)sibling).coreSetNextSibling(nextSibling);
+        coreSetNextSibling(siblingImpl);
     }
 
     /**
@@ -173,26 +165,18 @@ public abstract class OMNodeImpl extends
             throw new OMException("Inserting self as the sibling is not allowed");
         }
         OMNodeImpl siblingImpl = (OMNodeImpl)parent.prepareNewChild(sibling);
+        OMNodeImpl previousSibling = (OMNodeImpl)coreGetPreviousSibling();
         if (previousSibling == null) {
             parent.coreSetFirstChild(siblingImpl);
-            siblingImpl.nextSibling = this;
-            siblingImpl.previousSibling = null;
+            siblingImpl.coreSetNextSibling(this);
+            siblingImpl.coreSetPreviousSibling(null);
         } else {
             siblingImpl.coreSetParent(parent);
-            siblingImpl.nextSibling = this;
-            previousSibling.setNextOMSibling(siblingImpl);
-            siblingImpl.setPreviousOMSibling(previousSibling);
+            siblingImpl.coreSetNextSibling(this);
+            previousSibling.coreSetNextSibling(siblingImpl);
+            siblingImpl.coreSetPreviousSibling(previousSibling);
         }
-        previousSibling = siblingImpl;
-    }
-
-    /**
-     * Gets the previous sibling.
-     *
-     * @return boolean
-     */
-    public OMNode getPreviousOMSibling() {
-        return previousSibling;
+        coreSetPreviousSibling(siblingImpl);
     }
 
     /**
@@ -201,7 +185,7 @@ public abstract class OMNodeImpl extends
      * @param previousSibling
      */
     public void setPreviousOMSibling(OMNode previousSibling) {
-        this.previousSibling = (OMNodeImpl) previousSibling;
+        coreSetPreviousSibling((OMNodeImpl)previousSibling);
     }
 
     /**

Modified: webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java?rev=1609770&r1=1609769&r2=1609770&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
(original)
+++ webservices/axiom/trunk/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
Fri Jul 11 18:50:38 2014
@@ -1081,10 +1081,6 @@ public class OMSourcedElementImpl extend
         super.coreSetParent(element);
     }
 
-    public CoreChildNode coreGetNextSiblingIfAvailable() {
-        return super.coreGetNextSiblingIfAvailable();
-    }
-
     public CoreChildNode coreGetFirstChild() {
         return super.coreGetFirstChild();
     }



Mime
View raw message