You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ch...@apache.org on 2006/09/13 01:11:59 UTC
svn commit: r442751 -
/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
Author: chinthaka
Date: Tue Sep 12 16:11:57 2006
New Revision: 442751
URL: http://svn.apache.org/viewvc?view=rev&rev=442751
Log:
Fix for http://issues.apache.org/jira/browse/WSCOMMONS-93
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java?view=diff&rev=442751&r1=442750&r2=442751
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java Tue Sep 12 16:11:57 2006
@@ -16,12 +16,7 @@
package org.apache.axiom.om.impl.llom;
-import org.apache.axiom.om.OMContainer;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.*;
import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
import org.apache.axiom.om.impl.OMContainerEx;
import org.apache.axiom.om.impl.OMNodeEx;
@@ -204,7 +199,9 @@
*/
public void insertSiblingAfter(OMNode sibling) throws OMException {
if (parent == null) {
- throw new OMException();
+ throw new OMException("Parent can not be null");
+ }else if(this == sibling){
+ throw new OMException("Inserting self as the sibling is not allowed");
}
((OMNodeEx) sibling).setParent(parent);
if (sibling instanceof OMNodeImpl) {
@@ -229,7 +226,9 @@
*/
public void insertSiblingBefore(OMNode sibling) throws OMException {
if (parent == null) {
- throw new OMException();
+ throw new OMException("Parent can not be null");
+ } else if(this == sibling){
+ throw new OMException("Inserting self as the sibling is not allowed");
}
if (sibling instanceof OMNodeImpl) {
OMNodeImpl siblingImpl = (OMNodeImpl) sibling;
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org