jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r637946 - in /jackrabbit/trunk/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 15:43:49 GMT
Author: mreutegg
Date: Mon Mar 17 08:43:48 2008
New Revision: 637946

URL: http://svn.apache.org/viewvc?rev=637946&view=rev
Log:
JCR-1475: Inconsistency when version with a label is removed

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java

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

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java?rev=637946&r1=637945&r2=637946&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/version/RemoveVersionLabelTest.java
Mon Mar 17 08:43:48 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