jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r202514 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
Date Thu, 30 Jun 2005 10:14:17 GMT
Author: stefan
Date: Thu Jun 30 03:14:14 2005
New Revision: 202514

URL: http://svn.apache.org/viewcvs?rev=202514&view=rev
Log:
JCR-150: Node.getLock() on a lock non-lockable node throws javax.jcr.UnsupportedRepositoryOperationException

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?rev=202514&r1=202513&r2=202514&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Thu Jun 30
03:14:14 2005
@@ -1195,7 +1195,7 @@
         try {
             EffectiveNodeType ent = ntReg.getEffectiveNodeType((QName[]) mixinNames.toArray(new
QName[mixinNames.size()]));
             return ent.includesNodeType(ntName);
-        } catch  (NodeTypeConflictException ntce) {
+        } catch (NodeTypeConflictException ntce) {
             String msg = "internal error: invalid mixin node type(s)";
             log.debug(msg);
             throw new RepositoryException(msg, ntce);
@@ -3685,7 +3685,7 @@
     /**
      * {@inheritDoc}
      */
-        public Lock lock(boolean isDeep, boolean isSessionScoped)
+    public Lock lock(boolean isDeep, boolean isSessionScoped)
             throws UnsupportedRepositoryOperationException, LockException,
             AccessDeniedException, InvalidItemStateException,
             RepositoryException {
@@ -3714,8 +3714,6 @@
         // check state of this instance
         sanityCheck();
 
-        checkLockable();
-
         LockManager lockMgr = ((WorkspaceImpl) session.getWorkspace()).getLockManager();
         return lockMgr.getLock(this);
     }
@@ -3773,16 +3771,15 @@
     /**
      * Checks if this node is lockable, i.e. has 'mix:lockable'.
      *
-     * @throws UnsupportedRepositoryOperationException
-     *                             if this node is not lockable
+     * @throws LockException       if this node is not lockable
      * @throws RepositoryException if another error occurs
      */
-    private void checkLockable()
-            throws UnsupportedRepositoryOperationException, RepositoryException {
+    private void checkLockable() throws LockException, RepositoryException {
         if (!isNodeType(MIX_LOCKABLE)) {
-            String msg = "Unable to perform locking operation on non-lockable node: " + safeGetJCRPath();
+            String msg = "Unable to perform locking operation on non-lockable node: "
+                    + safeGetJCRPath();
             log.debug(msg);
-            throw new UnsupportedRepositoryOperationException(msg);
+            throw new LockException(msg);
         }
     }
 



Mime
View raw message