jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1453759 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/
Date Thu, 07 Mar 2013 10:26:25 GMT
Author: angela
Date: Thu Mar  7 10:26:24 2013
New Revision: 1453759

URL: http://svn.apache.org/r1453759
Log:
OAK-681: ReadOnlyVersionManager.getVersionHistory throws NPE if the versionstore is not accessible

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/ReadWriteVersionManager.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java?rev=1453759&r1=1453758&r2=1453759&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadOnlyVersionManager.java
Thu Mar  7 10:26:24 2013
@@ -47,7 +47,7 @@ public abstract class ReadOnlyVersionMan
      *         {@code Root} returned by {@link #getWorkspaceRoot()}.
      */
     @Nonnull
-    protected abstract Tree getVersionStorageTree();
+    protected abstract TreeLocation getVersionStorageLocation();
 
     /**
      * @return the {@code Root} of the workspace.
@@ -100,16 +100,14 @@ public abstract class ReadOnlyVersionMan
             throws UnsupportedRepositoryOperationException,
             RepositoryException {
         checkVersionable(versionable);
-        String uuid = versionable.getProperty(
-                VersionConstants.JCR_UUID).getValue(Type.STRING);
-        return getVersionStorageTree().getLocation().getChild(
-                getVersionHistoryPath(uuid)).getTree();
+        String uuid = versionable.getProperty(VersionConstants.JCR_UUID).getValue(Type.STRING);
+        return getVersionStorageLocation().getChild(getVersionHistoryPath(uuid)).getTree();
     }
 
     /**
      * Returns the path of the version history for the given {@code uuid}.
      * The returned path is relative to the version storage tree as returned
-     * by {@link #getVersionStorageTree()}.
+     * by {@link #getVersionStorageLocation()}.
      *
      * @param uuid the uuid of the versionable node
      * @return the relative path of the version history for the given uuid.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java?rev=1453759&r1=1453758&r2=1453759&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/ReadWriteVersionManager.java
Thu Mar  7 10:26:24 2013
@@ -26,7 +26,7 @@ import javax.annotation.Nonnull;
 
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Root;
-import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.core.ReadOnlyRoot;
@@ -77,8 +77,8 @@ class ReadWriteVersionManager extends Re
 
     @Nonnull
     @Override
-    protected Tree getVersionStorageTree() {
-        return new ReadOnlyTree(versionStorageNode.getNodeState());
+    protected TreeLocation getVersionStorageLocation() {
+        return new ReadOnlyTree(versionStorageNode.getNodeState()).getLocation();
     }
 
     @Nonnull

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/ReadWriteVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/ReadWriteVersionManager.java?rev=1453759&r1=1453758&r2=1453759&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/ReadWriteVersionManager.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/version/ReadWriteVersionManager.java
Thu Mar  7 10:26:24 2013
@@ -34,7 +34,7 @@ import org.apache.jackrabbit.oak.plugins
 import static com.google.common.base.Preconditions.checkNotNull;
 
 /**
- * <code>ReadWriteVersionManager</code>...
+ * {@code ReadWriteVersionManager}...
  */
 public class ReadWriteVersionManager extends ReadOnlyVersionManager {
 
@@ -61,8 +61,8 @@ public class ReadWriteVersionManager ext
 
     @Override
     @Nonnull
-    protected Tree getVersionStorageTree() {
-        return versionStorageLocation.getTree();
+    protected TreeLocation getVersionStorageLocation() {
+        return versionStorageLocation;
     }
 
     @Override



Mime
View raw message