ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1729724 [2/2] - in /webservices/axiom/trunk: aspects/core-aspects/ aspects/core-aspects/src/main/java/org/apache/axiom/core/ aspects/core-aspects/src/main/java/org/apache/axiom/core/impl/mixin/ aspects/dom-aspects/src/main/java/org/apache/...
Date Wed, 10 Feb 2016 20:48:23 GMT
Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?rev=1729724&r1=1729723&r2=1729724&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
Wed Feb 10 20:48:22 2016
@@ -57,6 +57,7 @@ import org.apache.abdera.writer.Writer;
 import org.apache.abdera.writer.WriterOptions;
 import org.apache.axiom.core.Axis;
 import org.apache.axiom.core.CoreChildNode;
+import org.apache.axiom.core.CoreModelException;
 import org.apache.axiom.core.CoreNSAwareElement;
 import org.apache.axiom.core.ElementMatcher;
 import org.apache.axiom.core.IdentityMapper;
@@ -237,18 +238,22 @@ public class FOMElement extends FOMChild
     }
 
     public final AbderaElement _getFirstChildWithName(QName qname) {
-        CoreChildNode child = coreGetFirstChild();
-        while (child != null) {
-            if (child instanceof AbderaElement) {
-                AbderaElement candidate = (AbderaElement)child;
-                if (candidate.coreGetLocalName().equals(qname.getLocalPart())
-                        && candidate.coreGetNamespaceURI().equals(qname.getNamespaceURI()))
{
-                    return candidate;
+        try {
+            CoreChildNode child = coreGetFirstChild();
+            while (child != null) {
+                if (child instanceof AbderaElement) {
+                    AbderaElement candidate = (AbderaElement)child;
+                    if (candidate.coreGetLocalName().equals(qname.getLocalPart())
+                            && candidate.coreGetNamespaceURI().equals(qname.getNamespaceURI()))
{
+                        return candidate;
+                    }
                 }
+                child = child.coreGetNextSibling();
             }
-            child = child.coreGetNextSibling();
+            return null;
+        } catch (CoreModelException ex) {
+            throw FOMSemantics.INSTANCE.toUncheckedException(ex);
         }
-        return null;
     }
 
     public void _setChild(QName qname, Element element) {
@@ -448,22 +453,26 @@ public class FOMElement extends FOMChild
     }
 
     public void _removeChildren(QName qname, boolean many) {
-        CoreChildNode child = coreGetFirstChild();
-        while (child != null) {
-            if (child instanceof CoreNSAwareElement) {
-                CoreNSAwareElement element = (CoreNSAwareElement)child;
-                if (element.coreGetLocalName().equals(qname.getLocalPart())
-                        && element.coreGetNamespaceURI().equals(qname.getNamespaceURI()))
{
-                    child = child.coreGetNextSibling();
-                    element.coreDetach(FOMSemantics.INSTANCE);
-                    if (many) {
-                        continue;
-                    } else {
-                        return;
+        try {
+            CoreChildNode child = coreGetFirstChild();
+            while (child != null) {
+                if (child instanceof CoreNSAwareElement) {
+                    CoreNSAwareElement element = (CoreNSAwareElement)child;
+                    if (element.coreGetLocalName().equals(qname.getLocalPart())
+                            && element.coreGetNamespaceURI().equals(qname.getNamespaceURI()))
{
+                        child = child.coreGetNextSibling();
+                        element.coreDetach(FOMSemantics.INSTANCE);
+                        if (many) {
+                            continue;
+                        } else {
+                            return;
+                        }
                     }
                 }
+                child = child.coreGetNextSibling();
             }
-            child = child.coreGetNextSibling();
+        } catch (CoreModelException ex) {
+            throw FOMSemantics.INSTANCE.toUncheckedException(ex);
         }
     }
 



Mime
View raw message