abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r592184 - 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 Mon, 05 Nov 2007 23:38:41 GMT
Author: jmsnell
Date: Mon Nov  5 15:38:38 2007
New Revision: 592184

URL: http://svn.apache.org/viewvc?rev=592184&view=rev
Log:
Fix the sharing impl. I'm not sure if this is 100% correct yet, but the test passes.  This
will need
to be revisited

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=592184&r1=592183&r2=592184&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
Mon Nov  5 15:38:38 2007
@@ -283,6 +283,8 @@
         List<History> list = xsync.getHistory();
         History[] history = list.toArray(new History[list.size()]);
         for (History h1 : history) {
+          h1 = (History)h1.clone();
+          h1.discard();
           boolean ok = true;
           for (History h2 : sync.getHistory()) {
             if (isSubsumed(h1,h2)) {
@@ -290,8 +292,8 @@
               break;
             }
           }
-          if (h1.getParentElement() != sync && ok) 
-            sync.addHistory((History) h1.clone());
+          if (ok) 
+            sync.addHistory((History) h1);
         }
       }
     }

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=592184&r1=592183&r2=592184&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
Mon Nov  5 15:38:38 2007
@@ -222,11 +222,16 @@
         return entry; // take the latest
       }
     };
+    
+    entry.writeTo("prettyxml",System.out);
+    
     entry = SharingHelper.resolveConflicts(entry, r, "jms");
     sync = SharingHelper.getSync(entry);
     conflicts = sync.getConflicts();
     assertNull(conflicts);
     assertEquals(sync.getHistory().size(),4);
+    System.out.println();
+    entry.writeTo("prettyxml",System.out);
   }
   
   public void testUnpublish() throws Exception {



Mime
View raw message