jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1456023 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
Date Wed, 13 Mar 2013 16:23:47 GMT
Author: mduerig
Date: Wed Mar 13 16:23:47 2013
New Revision: 1456023

URL: http://svn.apache.org/r1456023
Log:
OAK-672: Avoid JCR APIs calling other JCR APIs
- Clean up checkProtected

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java?rev=1456023&r1=1456022&r2=1456023&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
Wed Mar 13 16:23:47 2013
@@ -20,7 +20,6 @@ import javax.annotation.Nonnull;
 import javax.jcr.InvalidItemStateException;
 import javax.jcr.Item;
 import javax.jcr.Node;
-import javax.jcr.Property;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.nodetype.ConstraintViolationException;
@@ -190,6 +189,8 @@ abstract class ItemImpl<T extends ItemDe
         // TODO: validate item state.
     }
 
+    protected abstract ItemDefinition getDefinition() throws RepositoryException;
+
     public void checkProtected() throws RepositoryException {
         if (DISABLE_TRANSIENT_DEFINITION_CHECKS) {
             return;
@@ -197,7 +198,7 @@ abstract class ItemImpl<T extends ItemDe
 
         ItemDefinition definition;
         try {
-            definition = (isNode()) ? ((Node) this).getDefinition() : ((Property) this).getDefinition();
+            definition = getDefinition();
         }
         catch (RepositoryException ignore) {
             // No definition -> not protected but a different error which should be handled
else where



Mime
View raw message