ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1310621 - in /webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom: ChildNode.java ParentNode.java
Date Fri, 06 Apr 2012 22:28:58 GMT
Author: veithen
Date: Fri Apr  6 22:28:57 2012
New Revision: 1310621

URL: http://svn.apache.org/viewvc?rev=1310621&view=rev
Log:
The owner document is never null (for the moment).

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java?rev=1310621&r1=1310620&r2=1310621&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
Fri Apr  6 22:28:57 2012
@@ -66,9 +66,7 @@ public abstract class ChildNode extends 
      * @return the owner document
      */
     DocumentImpl ownerDocument() {
-        if (ownerNode == null) {
-            return null;
-        } else if (ownerNode instanceof DocumentImpl) {
+        if (ownerNode instanceof DocumentImpl) {
             // Note: the value of the HAS_PARENT flag doesn't matter here. If the ownerNode
is of
             // type Document, it must be the owner document.
             return (DocumentImpl)ownerNode;

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java?rev=1310621&r1=1310620&r2=1310621&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
Fri Apr  6 22:28:57 2012
@@ -383,10 +383,7 @@ public abstract class ParentNode extends
                                            DOMException.HIERARCHY_REQUEST_ERR, null));
         }
 
-        if (//This is the case where this is an Element in the document
-                (ownerDocument() != null && !ownerDocument().equals(newDomChild.ownerDocument()))
||
-                //This is the case where this is the Document itself
-                (ownerDocument() == null && !this.equals(ownerDocument()))) {
+        if (ownerDocument() != newDomChild.ownerDocument()) {
             throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
                                    DOMMessageFormatter.formatMessage(
                                            DOMMessageFormatter.DOM_DOMAIN,



Mime
View raw message