jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1508057 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core: RootImpl.java SystemRoot.java
Date Mon, 29 Jul 2013 13:33:23 GMT
Author: mduerig
Date: Mon Jul 29 13:33:22 2013
New Revision: 1508057

URL: http://svn.apache.org/r1508057
Log:
OAK-932: RootImpl to AbstractRoot
getLatestRoot should return latest root instead of throwing a UnsupportedOperationException

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1508057&r1=1508056&r2=1508057&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
Mon Jul 29 13:33:22 2013
@@ -171,6 +171,16 @@ public class RootImpl implements Root {
         return workspaceName;
     }
 
+    /**
+     * Factory method for creating a new {@code Root} instance, which
+     * reflects the latest state of the repository.
+     * @return  new Root instance
+     */
+    protected Root newRoot() {
+        return new RootImpl(
+                store, hook, postHook, workspaceName, subject, securityProvider, indexProvider);
+    }
+
     //---------------------------------------------------------------< Root >---
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java?rev=1508057&r1=1508056&r2=1508057&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/SystemRoot.java
Mon Jul 29 13:33:22 2013
@@ -51,7 +51,7 @@ public class SystemRoot extends RootImpl
 
         @Override
         public Root getLatestRoot() {
-            throw new UnsupportedOperationException();
+            return newRoot();
         }
 
         @Override



Mime
View raw message