abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1374766 - in /abdera/java/trunk: extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
Date Sun, 19 Aug 2012 15:20:20 GMT
Author: veithen
Date: Sun Aug 19 15:20:20 2012
New Revision: 1374766

URL: http://svn.apache.org/viewvc?rev=1374766&view=rev
Log:
Eliminated a couple of unnecessary/incorrect calls to setParentElement.

Modified:
    abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java

Modified: abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java?rev=1374766&r1=1374765&r2=1374766&view=diff
==============================================================================
--- abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java
(original)
+++ abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java
Sun Aug 19 15:20:20 2012
@@ -335,8 +335,8 @@ public class SharingHelper {
         Feed feed = (Feed)base;
         Unpublished unpub = getUnpublished(feed, true);
         Entry newentry = (Entry)entry.clone();
-        newentry.setParentElement(unpub);
-        unpub.addEntry(newentry);
+        // Use addExtension instead of addEntry because addEntry clones the node
+        unpub.addExtension(newentry);
         entry.discard();
         return newentry;
     }
@@ -350,7 +350,6 @@ public class SharingHelper {
         Unpublished unpub = (Unpublished)base;
         Feed feed = unpub.getParentElement();
         Entry newentry = (Entry)entry.clone();
-        newentry.setParentElement(feed);
         feed.addEntry(newentry);
         entry.discard();
         return newentry;

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java?rev=1374766&r1=1374765&r2=1374766&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
(original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMExtensibleElement.java
Sun Aug 19 15:20:20 2012
@@ -180,7 +180,6 @@ public class FOMExtensibleElement extend
         if (el == null) {
             addExtension(element);
         } else {
-            element.setParentElement(this);
             el.insertSiblingBefore((OMElement)getInternal(element));
         }
         return (T)element;



Mime
View raw message