abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r433345 - in /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax: FOMElement.java FOMFeed.java
Date Mon, 21 Aug 2006 20:20:36 GMT
Author: jmsnell
Date: Mon Aug 21 13:20:36 2006
New Revision: 433345

URL: http://svn.apache.org/viewvc?rev=433345&view=rev
Log:
If an element already contains a child, don't add it again.

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java?rev=433345&r1=433344&r2=433345&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMElement.java
Mon Aug 21 13:20:36 2006
@@ -579,4 +579,9 @@
     }
     return locale;
   }
+  
+  public void addChild(OMNode node) {
+    if (node.getParent() == this) return;
+    super.addChild(node);
+  }    
 }

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java?rev=433345&r1=433344&r2=433345&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMFeed.java
Mon Aug 21 13:20:36 2006
@@ -133,6 +133,7 @@
 
   @Override
   public void addChild(OMNode node) {
+    if (node.getParent() == this) return;
     if (isComplete() && node instanceof OMElement && !(node instanceof Entry))
{
       OMElement el = this.getFirstChildWithName(ENTRY);
       if (el != null) {



Mime
View raw message