jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r783523 - in /jackrabbit/trunk/jackrabbit-core: pom.xml src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java
Date Wed, 10 Jun 2009 21:22:47 GMT
Author: tripod
Date: Wed Jun 10 21:22:46 2009
New Revision: 783523

URL: http://svn.apache.org/viewvc?rev=783523&view=rev
Log:
JCR-2102 getAllLinearVersions does not return the base version

Modified:
    jackrabbit/trunk/jackrabbit-core/pom.xml
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/pom.xml?rev=783523&r1=783522&r2=783523&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-core/pom.xml Wed Jun 10 21:22:46 2009
@@ -90,8 +90,6 @@
                 org.apache.jackrabbit.core.xml.DocumentViewTest#testMultiValue
                 org.apache.jackrabbit.test.api.NodeCanAddMixinTest#testAddMixinTwice
                 org.apache.jackrabbit.test.api.ShareableNodeTest#testSharedNodePath
-                org.apache.jackrabbit.test.api.version.VersionHistoryTest#testInitialNumberOfLinearVersions
-                org.apache.jackrabbit.test.api.version.VersionHistoryTest#testInitiallyGetAllLinearVersionsContainsTheRootAndTheBaseVersion
               </value>
             </property>
           </systemProperties>

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java?rev=783523&r1=783522&r2=783523&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionIteratorImpl.java
Wed Jun 10 21:22:46 2009
@@ -81,12 +81,13 @@
      * @param rootVersion the root version
      * @param baseVersion the ending base version
      */
-    public VersionIteratorImpl(Session session, InternalVersion rootVersion, InternalVersion
baseVersion) {
+    public VersionIteratorImpl(Session session, InternalVersion rootVersion,
+                               InternalVersion baseVersion) {
         this.session = (SessionImpl) session;
         if (baseVersion == null) {
-            initVersions(rootVersion);
+            collectAllVersions(rootVersion);
         } else {
-            initVersions(rootVersion, baseVersion);
+            collectLinearVersions(baseVersion);
         }
         // retrieve initial size, since size of the list is not stable
         size = versions.size();
@@ -161,7 +162,7 @@
      *
      * @param root the root version
      */
-    private synchronized void initVersions(InternalVersion root) {
+    private synchronized void collectAllVersions(InternalVersion root) {
         LinkedList<InternalVersion> workQueue = new LinkedList<InternalVersion>();
         workQueue.add(root);
         while (!workQueue.isEmpty()) {
@@ -177,15 +178,13 @@
     }
 
     /**
-     * Adds all versions of a single line of decent starting from <code>root</code>
-     * and ending at <code>base</code>.
+     * Adds all versions of a single line of decent starting from the root
+     * version to the <code>base</code> version.
      *
-     * @param root the root version
      * @param base the base version
      */
-    private synchronized void initVersions(InternalVersion root, InternalVersion base) {
-        NodeId rootId = root == null ? null : root.getId();
-        while (base != null && !base.getId().equals(rootId)) {
+    private synchronized void collectLinearVersions(InternalVersion base) {
+        while (base != null) {
             versions.addFirst(base.getId());
             InternalVersion[] preds = base.getPredecessors();
             if (preds.length == 0) {



Mime
View raw message