Author: veithen
Date: Fri Jun 10 19:48:47 2011
New Revision: 1134426
URL: http://svn.apache.org/viewvc?rev=1134426&view=rev
Log:
Clarify the meaning of the return value of OMNode#detach().
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/node/TestDetach.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java?rev=1134426&r1=1134425&r2=1134426&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
Fri Jun 10 19:48:47 2011
@@ -122,6 +122,8 @@ public interface OMNode extends OMSerial
* handle the namespaces. For example, if there you have used a namespace
within the detaching node
* and which is defined outside the detaching node, user has to handle it
manually. </p>
*
+ * @return The detached node. This is always the instance on which this
method is invoked.
+ *
* @throws OMException If a node is not complete, the detach can trigger
further parsing, which may
* cause an exception.
*/
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/node/TestDetach.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/node/TestDetach.java?rev=1134426&r1=1134425&r2=1134426&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/node/TestDetach.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/node/TestDetach.java
Fri Jun 10 19:48:47 2011
@@ -47,7 +47,8 @@ public class TestDetach extends AxiomTes
assertEquals("a", a.getLocalName());
OMElement b = (OMElement)a.getNextOMSibling();
assertEquals("b", b.getLocalName());
- b.detach();
+ OMNode returnValue = b.detach();
+ assertSame(b, returnValue); // Detach is expected to do a "return this"
assertNull(b.getParent());
OMElement c = (OMElement)a.getNextOMSibling();
assertEquals("c", c.getLocalName());