You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2015/07/18 17:01:03 UTC

svn commit: r1691737 - in /webservices/axiom/trunk: aspects/fom-aspects/src/main/java/org/apache/axiom/fom/ implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/

Author: veithen
Date: Sat Jul 18 15:01:03 2015
New Revision: 1691737

URL: http://svn.apache.org/r1691737
Log:
Replace _removeAllChildren with a better implementation.

Added:
    webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElementSupport.aj   (with props)
    webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/Policies.java   (with props)
Modified:
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMElement.java

Added: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElementSupport.aj?rev=1691737&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElementSupport.aj (added)
+++ webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElementSupport.aj Sat Jul 18 15:01:03 2015
@@ -0,0 +1,25 @@
+/*
+ * 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.fom;
+
+public aspect AbderaElementSupport {
+    public final void AbderaElement._removeAllChildren() {
+        coreRemoveChildren(Policies.DETACH_POLICY);
+    }
+}

Propchange: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/AbderaElementSupport.aj
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/Policies.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/Policies.java?rev=1691737&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/Policies.java (added)
+++ webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/Policies.java Sat Jul 18 15:01:03 2015
@@ -0,0 +1,33 @@
+/*
+ * 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.fom;
+
+import org.apache.axiom.core.CoreDocument;
+import org.apache.axiom.core.CoreParentNode;
+import org.apache.axiom.core.DetachPolicy;
+
+final class Policies {
+    private Policies() {}
+    
+    public static final DetachPolicy DETACH_POLICY = new DetachPolicy() {
+        public CoreDocument getNewOwnerDocument(CoreParentNode parent) {
+            return null;
+        }
+    };
+}

Propchange: webservices/axiom/trunk/aspects/fom-aspects/src/main/java/org/apache/axiom/fom/Policies.java
------------------------------------------------------------------------------
    svn:eol-style = native

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=1691737&r1=1691736&r2=1691737&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 Sat Jul 18 15:01:03 2015
@@ -538,13 +538,6 @@ public class FOMElement extends OMElemen
         }
     }
 
-    protected void _removeAllChildren() {
-        for (Iterator i = getChildren(); i.hasNext();) {
-            OMNode node = (OMNode)i.next();
-            node.discard();
-        }
-    }
-
     public Object clone() {
         OMElement el = _create(this);
         _copyElement(this, el);