abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r589266 - in /incubator/abdera/java/trunk/extensions/sharing/src: main/java/org/apache/abdera/ext/sharing/SharingHelper.java test/java/org/apache/abdera/test/ext/sharing/SharingTest.java
Date Sun, 28 Oct 2007 03:33:35 GMT
Author: jmsnell
Date: Sat Oct 27 20:33:35 2007
New Revision: 589266

URL: http://svn.apache.org/viewvc?rev=589266&view=rev
Log:
Fix the sharing ext test

Modified:
    incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java
    incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ext/sharing/SharingTest.java

Modified: incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java?rev=589266&r1=589265&r2=589266&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java
(original)
+++ incubator/abdera/java/trunk/extensions/sharing/src/main/java/org/apache/abdera/ext/sharing/SharingHelper.java
Sat Oct 27 20:33:35 2007
@@ -280,7 +280,9 @@
     for (Entry x : conflicts) {
       Sync xsync = getSync(x,false);
       if (xsync != null) {
-        for (History h1 : xsync.getHistory()) {
+        List<History> list = xsync.getHistory();
+        History[] history = list.toArray(new History[list.size()]);
+        for (History h1 : history) {
           boolean ok = true;
           for (History h2 : sync.getHistory()) {
             if (isSubsumed(h1,h2)) {
@@ -288,7 +290,8 @@
               break;
             }
           }
-          if (ok) sync.addHistory(h1);
+          if (h1.getParentElement() != sync && ok) 
+            sync.addHistory((History) h1.clone());
         }
       }
     }

Modified: incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ext/sharing/SharingTest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ext/sharing/SharingTest.java?rev=589266&r1=589265&r2=589266&view=diff
==============================================================================
--- incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ext/sharing/SharingTest.java
(original)
+++ incubator/abdera/java/trunk/extensions/sharing/src/test/java/org/apache/abdera/test/ext/sharing/SharingTest.java
Sat Oct 27 20:33:35 2007
@@ -21,6 +21,8 @@
 import java.util.Date;
 import java.util.List;
 
+import junit.framework.TestCase;
+
 import org.apache.abdera.Abdera;
 import org.apache.abdera.ext.sharing.Conflicts;
 import org.apache.abdera.ext.sharing.History;
@@ -35,8 +37,6 @@
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Entry;
 import org.apache.abdera.model.Feed;
-
-import junit.framework.TestCase;
 
 public class SharingTest
     extends TestCase {



Mime
View raw message