jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1335498 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Date Tue, 08 May 2012 13:10:00 GMT
Author: reschke
Date: Tue May  8 13:09:59 2012
New Revision: 1335498

URL: http://svn.apache.org/viewvc?rev=1335498&view=rev
Log:
make isCheckedOut() and isLocked() behave properly (always return true/false in absence of
version / locking manager)

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1335498&r1=1335497&r2=1335498&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Tue May  8 13:09:59 2012
@@ -803,7 +803,13 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public boolean isCheckedOut() throws RepositoryException {
-        return sessionDelegate.getVersionManager().isCheckedOut(getPath());
+        try {
+            return sessionDelegate.getVersionManager().isCheckedOut(getPath());
+        } catch (UnsupportedRepositoryOperationException ex) {
+            // when versioning is not supported all nodes are considered to be
+            // checked out
+            return true;
+        }
     }
 
     /**
@@ -897,10 +903,15 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public boolean isLocked() throws RepositoryException {
-        return sessionDelegate.getLockManager().isLocked(getPath());
+        try {
+            return sessionDelegate.getLockManager().isLocked(getPath());
+        } catch (UnsupportedRepositoryOperationException ex) {
+            // when locking is not supported all nodes are considered not to be
+            // locked
+            return false;
+        }
     }
 
-
     @Override
     public NodeIterator getSharedSet() throws RepositoryException {
         throw new UnsupportedRepositoryOperationException("TODO: Node.getSharedSet");



Mime
View raw message