jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r638052 - in /jackrabbit/branches/1.4/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java
Date Mon, 17 Mar 2008 20:08:26 GMT
Author: jukka
Date: Mon Mar 17 13:08:23 2008
New Revision: 638052

URL: http://svn.apache.org/viewvc?rev=638052&view=rev
Log:
1.4: Merged revisions 637104 and 637946 (JCR-1475)

Added:
    jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java
      - copied, changed from r637104, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java
Modified:
    jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java?rev=638052&r1=638051&r2=638052&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
Mon Mar 17 13:08:23 2008
@@ -384,6 +384,11 @@
 
         // store changes
         node.store();
+
+        // now also remove from labelCache
+        for (int i = 0; i < labels.length; i++) {
+            labelCache.remove(labels[i]);
+        }
     }
 
     /**

Copied: jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java
(from r637104, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java?p2=jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java&p1=jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java&r1=637104&r2=638052&rev=638052&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java
Mon Mar 17 13:08:23 2008
@@ -37,13 +37,10 @@
         n.checkin();
         VersionHistory vh = n.getVersionHistory();
         vh.addVersionLabel(v10.getName(), "test", true);
-        // either the next call should fail
+        // the next call must not fail
         vh.removeVersion(v10.getName());
-        // or the label 'test' should be gone
+        // now the label must be gone
         String[] labels = vh.getVersionLabels();
-        for (int i = 0; i < labels.length; i++) {
-            // and this is never called
-            vh.removeVersionLabel(labels[i]);
-        }
+        assertEquals("Label of a removed version must be removed as well", 0, labels.length);
     }
 }



Mime
View raw message