jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1476253 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ oak-core/src/main/resources/org/apache/jackrabbit/oak/plugins/nodetype/write/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ oak-j...
Date Fri, 26 Apr 2013 15:20:55 GMT
Author: jukka
Date: Fri Apr 26 15:20:54 2013
New Revision: 1476253

URL: http://svn.apache.org/r1476253
Log:
OAK-702: Optimize access to node type information

Optimize checkProtected()

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/RegistrationEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/oak/plugins/nodetype/write/builtin_nodetypes.cnd
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/ItemDelegate.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/NodeDelegate.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/PropertyDelegate.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java?rev=1476253&r1=1476252&r2=1476253&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeConstants.java
Fri Apr 26 15:20:54 2013
@@ -65,6 +65,12 @@ public interface NodeTypeConstants exten
     String OAK_MIXIN_SUBTYPES = "oak:mixinSubtypes";
     String OAK_MANDATORY_PROPERTIES = "oak:mandatoryProperties";
     String OAK_MANDATORY_CHILD_NODES = "oak:mandatoryChildNodes";
+    String OAK_PROTECTED_PROPERTIES = "oak:protectedProperties";
+    String OAK_PROTECTED_CHILD_NODES = "oak:protectedChildNodes";
+    String OAK_HAS_PROTECTED_RESIDUAL_PROPERTIES =
+            "oak:hasProtectedResidualProperties";
+    String OAK_HAS_PROTECTED_RESIDUAL_CHILD_NODES =
+            "oak:hasProtectedResidualChildNodes";
     String OAK_NAMED_SINGLE_VALUED_PROPERTIES =
             "oak:namedSingleValuedProperties";
     String OAK_RESIDUAL_CHILD_NODE_DEFINITIONS =

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/RegistrationEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/RegistrationEditor.java?rev=1476253&r1=1476252&r2=1476253&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/RegistrationEditor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/RegistrationEditor.java
Fri Apr 26 15:20:54 2013
@@ -31,6 +31,7 @@ import static org.apache.jackrabbit.JcrC
 import static org.apache.jackrabbit.JcrConstants.JCR_NODETYPENAME;
 import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYTYPE;
 import static org.apache.jackrabbit.JcrConstants.JCR_PROPERTYDEFINITION;
+import static org.apache.jackrabbit.JcrConstants.JCR_PROTECTED;
 import static org.apache.jackrabbit.JcrConstants.JCR_REQUIREDPRIMARYTYPES;
 import static org.apache.jackrabbit.JcrConstants.JCR_REQUIREDTYPE;
 import static org.apache.jackrabbit.JcrConstants.JCR_SUPERTYPES;
@@ -44,6 +45,8 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.api.Type.STRING;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.JCR_NODE_TYPES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_CHILD_NODE_DEFINITIONS;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_HAS_PROTECTED_RESIDUAL_CHILD_NODES;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_HAS_PROTECTED_RESIDUAL_PROPERTIES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_MANDATORY_CHILD_NODES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_MANDATORY_PROPERTIES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_MIXIN_SUBTYPES;
@@ -51,6 +54,8 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_NAMED_SINGLE_VALUED_PROPERTIES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_NAMED_PROPERTY_DEFINITIONS;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_PROPERTY_DEFINITIONS;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_PROTECTED_CHILD_NODES;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_PROTECTED_PROPERTIES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_RESIDUAL_CHILD_NODE_DEFINITIONS;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_RESIDUAL_PROPERTY_DEFINITIONS;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_PRIMARY_SUBTYPES;
@@ -167,6 +172,14 @@ class RegistrationEditor extends Default
         mergeNameList(type, supertype, OAK_SUPERTYPES);
         mergeNameList(type, supertype, OAK_MANDATORY_PROPERTIES);
         mergeNameList(type, supertype, OAK_MANDATORY_CHILD_NODES);
+        mergeNameList(type, supertype, OAK_PROTECTED_PROPERTIES);
+        mergeNameList(type, supertype, OAK_PROTECTED_CHILD_NODES);
+        if (supertype.getBoolean(OAK_HAS_PROTECTED_RESIDUAL_PROPERTIES)) {
+            type.setProperty(OAK_HAS_PROTECTED_RESIDUAL_PROPERTIES, true);
+        }
+        if (supertype.getBoolean(OAK_HAS_PROTECTED_RESIDUAL_CHILD_NODES)) {
+            type.setProperty(OAK_HAS_PROTECTED_RESIDUAL_CHILD_NODES, true);
+        }
         mergeNameList(type, supertype, OAK_NAMED_SINGLE_VALUED_PROPERTIES);
         mergeSubtree(type, supertype, OAK_NAMED_PROPERTY_DEFINITIONS, 2);
         mergeSubtree(type, supertype, OAK_RESIDUAL_PROPERTY_DEFINITIONS, 1);
@@ -224,6 +237,11 @@ class RegistrationEditor extends Default
         type.setProperty(OAK_PRIMARY_SUBTYPES, empty, NAMES);
         type.setProperty(OAK_MANDATORY_PROPERTIES, empty, NAMES);
         type.setProperty(OAK_MANDATORY_CHILD_NODES, empty, NAMES);
+        type.setProperty(OAK_PROTECTED_PROPERTIES, empty, NAMES);
+        type.setProperty(OAK_PROTECTED_CHILD_NODES, empty, NAMES);
+        type.setProperty(OAK_HAS_PROTECTED_RESIDUAL_PROPERTIES, false, BOOLEAN);
+        type.setProperty(OAK_HAS_PROTECTED_RESIDUAL_CHILD_NODES, false, BOOLEAN);
+        type.setProperty(OAK_PROTECTED_CHILD_NODES, false, BOOLEAN);
         type.setProperty(OAK_NAMED_SINGLE_VALUED_PROPERTIES, empty, NAMES);
         type.removeChildNode(OAK_NAMED_PROPERTY_DEFINITIONS);
         type.removeChildNode(OAK_RESIDUAL_PROPERTY_DEFINITIONS);
@@ -279,8 +297,17 @@ class RegistrationEditor extends Default
             if (definition.getBoolean(JCR_MANDATORY)) {
                 addNameToList(type, OAK_MANDATORY_PROPERTIES, propertyName);
             }
+            // - jcr:protected (BOOLEAN) protected mandatory
+            if (definition.getBoolean(JCR_PROTECTED)) {
+                addNameToList(type, OAK_PROTECTED_PROPERTIES, propertyName);
+            }
         } else {
             definitions = type.child(OAK_RESIDUAL_PROPERTY_DEFINITIONS);
+
+            // - jcr:protected (BOOLEAN) protected mandatory
+            if (definition.getBoolean(JCR_PROTECTED)) {
+                type.setProperty(OAK_HAS_PROTECTED_RESIDUAL_PROPERTIES, true);
+            }
         }
         definitions.setProperty(
                 JCR_PRIMARYTYPE, OAK_PROPERTY_DEFINITIONS, NAME);
@@ -326,8 +353,17 @@ class RegistrationEditor extends Default
             if (definition.getBoolean(JCR_MANDATORY)) {
                 addNameToList(type, OAK_MANDATORY_CHILD_NODES, childNodeName);
             }
+            // - jcr:protected (BOOLEAN) protected mandatory
+            if (definition.getBoolean(JCR_PROTECTED)) {
+                addNameToList(type, OAK_PROTECTED_CHILD_NODES, childNodeName);
+            }
         } else {
             definitions = type.child(OAK_RESIDUAL_CHILD_NODE_DEFINITIONS);
+
+            // - jcr:protected (BOOLEAN) protected mandatory
+            if (definition.getBoolean(JCR_PROTECTED)) {
+                type.setProperty(OAK_HAS_PROTECTED_RESIDUAL_CHILD_NODES, true);
+            }
         }
         definitions.setProperty(
                 JCR_PRIMARYTYPE, OAK_CHILD_NODE_DEFINITIONS, NAME);

Modified: jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/oak/plugins/nodetype/write/builtin_nodetypes.cnd
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/oak/plugins/nodetype/write/builtin_nodetypes.cnd?rev=1476253&r1=1476252&r2=1476253&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/oak/plugins/nodetype/write/builtin_nodetypes.cnd
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/resources/org/apache/jackrabbit/oak/plugins/nodetype/write/builtin_nodetypes.cnd
Fri Apr 26 15:20:54 2013
@@ -431,6 +431,10 @@
   - oak:mixinSubtypes (NAME) protected multiple autocreated
   - oak:mandatoryProperties (NAME) protected multiple autocreated
   - oak:mandatoryChildNodes (NAME) protected multiple autocreated
+  - oak:protectedProperties (NAME) protected multiple autocreated
+  - oak:protectedChildNodes (NAME) protected multiple autocreated
+  - oak:hasProtectedResidualProperties (BOOLEAN) protected autocreated
+  - oak:hasProtectedResidualChildNodes (BOOLEAN) protected autocreated
   - oak:namedSingleValuedProperties (NAME) protected multiple autocreated
   + oak:namedPropertyDefinitions (oak:namedPropertyDefinitions) = oak:namedPropertyDefinitions
protected mandatory
   + oak:residualPropertyDefinitions (oak:propertyDefinitions) = oak:propertyDefinitions protected
mandatory

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=1476253&r1=1476252&r2=1476253&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
Fri Apr 26 15:20:54 2013
@@ -275,15 +275,9 @@ abstract class ItemImpl<T extends ItemDe
     protected abstract ItemDefinition internalGetDefinition() throws RepositoryException;
 
     void checkProtected() throws RepositoryException {
-        ItemDefinition definition;
-        try {
-            definition = internalGetDefinition();
-        } catch (RepositoryException ignore) {
-            // FIXME: No definition -> not protected but a different error
-            // which should be handled else where
-            return;
+        if (dlg.isProtected()) {
+            throw new ConstraintViolationException("Item is protected.");
         }
-        checkProtected(definition);
     }
 
     void checkProtected(ItemDefinition definition) throws ConstraintViolationException {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/ItemDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/ItemDelegate.java?rev=1476253&r1=1476252&r2=1476253&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/ItemDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/ItemDelegate.java
Fri Apr 26 15:20:54 2013
@@ -43,6 +43,8 @@ public abstract class ItemDelegate {
         this.location = checkNotNull(location);
     }
 
+    public abstract boolean isProtected() throws InvalidItemStateException;
+
     /**
      * Get the name of this item
      * @return oak name of this item

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/NodeDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/NodeDelegate.java?rev=1476253&r1=1476252&r2=1476253&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/NodeDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/NodeDelegate.java
Fri Apr 26 15:20:54 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.oak.jcr.delegate;
 
+import static com.google.common.collect.Iterables.addAll;
 import static com.google.common.collect.Iterables.contains;
 import static com.google.common.collect.Lists.newArrayList;
 import static com.google.common.collect.Sets.newHashSet;
@@ -29,7 +30,9 @@ import static org.apache.jackrabbit.JcrC
 import static org.apache.jackrabbit.JcrConstants.JCR_LASTMODIFIED;
 import static org.apache.jackrabbit.JcrConstants.JCR_MIXINTYPES;
 import static org.apache.jackrabbit.JcrConstants.JCR_MULTIPLE;
+import static org.apache.jackrabbit.JcrConstants.JCR_NODETYPENAME;
 import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYTYPE;
+import static org.apache.jackrabbit.JcrConstants.JCR_PROTECTED;
 import static org.apache.jackrabbit.JcrConstants.JCR_UUID;
 import static org.apache.jackrabbit.oak.api.Type.BOOLEAN;
 import static org.apache.jackrabbit.oak.api.Type.DATE;
@@ -40,11 +43,17 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.JCR_IS_ABSTRACT;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.JCR_LASTMODIFIEDBY;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.NODE_TYPES_PATH;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_HAS_PROTECTED_RESIDUAL_CHILD_NODES;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_HAS_PROTECTED_RESIDUAL_PROPERTIES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_MIXIN_SUBTYPES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_NAMED_CHILD_NODE_DEFINITIONS;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_NAMED_PROPERTY_DEFINITIONS;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_PRIMARY_SUBTYPES;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_PROTECTED_CHILD_NODES;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_PROTECTED_PROPERTIES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_RESIDUAL_CHILD_NODE_DEFINITIONS;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_RESIDUAL_PROPERTY_DEFINITIONS;
+import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.OAK_SUPERTYPES;
 
 import java.util.Calendar;
 import java.util.Collections;
@@ -109,6 +118,89 @@ public class NodeDelegate extends ItemDe
         return sessionDelegate.getIdManager().getIdentifier(getTree());
     }
 
+    @Override
+    public boolean isProtected() throws InvalidItemStateException {
+        Tree tree = getTree();
+
+        Tree parent = tree.getParent();
+        if (parent != null) {
+            String name = tree.getName();
+            Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
+            List<Tree> types = getEffectiveType(parent, typeRoot);
+
+            boolean protectedResidual = false;
+            for (Tree type : types) {
+                if (contains(getNames(type, OAK_PROTECTED_CHILD_NODES), name)) {
+                    return true;
+                } else if (!protectedResidual) {
+                    protectedResidual = getBoolean(
+                            type, OAK_HAS_PROTECTED_RESIDUAL_CHILD_NODES);
+                }
+            }
+
+            // Special case: There are one or more protected *residual*
+            // child node definitions. Iterate through them to check whether
+            // there's a matching, protected one.
+            if (protectedResidual) {
+                Set<String> typeNames = newHashSet();
+                for (Tree type : getEffectiveType(tree, typeRoot)) {
+                    typeNames.add(getName(type, JCR_NODETYPENAME));
+                    addAll(typeNames, getNames(type, OAK_SUPERTYPES));
+                }
+
+                for (Tree type : types) {
+                    Tree definitions = type.getChild(OAK_RESIDUAL_CHILD_NODE_DEFINITIONS);
+                    if (definitions != null) {
+                        for (String typeName : typeNames) {
+                            Tree definition = definitions.getChild(typeName);
+                            if (definition != null
+                                    && getBoolean(definition, JCR_PROTECTED)) {
+                                return true;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        return false;
+    }
+
+    boolean isProtected(String property) throws InvalidItemStateException {
+        Tree tree = getTree();
+        Tree typeRoot = sessionDelegate.getRoot().getTree(NODE_TYPES_PATH);
+        List<Tree> types = getEffectiveType(tree, typeRoot);
+
+        boolean protectedResidual = false;
+        for (Tree type : types) {
+            if (contains(getNames(type, OAK_PROTECTED_PROPERTIES), property)) {
+                return true;
+            } else if (!protectedResidual) {
+                protectedResidual = getBoolean(
+                        type, OAK_HAS_PROTECTED_RESIDUAL_PROPERTIES);
+            }
+        }
+
+        // Special case: There are one or more protected *residual*
+        // child node definitions. Iterate through them to check whether
+        // there's a matching, protected one.
+        if (protectedResidual) {
+            for (Tree type : types) {
+                Tree definitions = type.getChild(OAK_RESIDUAL_PROPERTY_DEFINITIONS);
+                if (definitions != null) {
+                    for (Tree definition : definitions.getChildren()) {
+                        // TODO: check for matching property type?
+                        if (getBoolean(definition, JCR_PROTECTED)) {
+                            return true;
+                        }
+                    }
+                }
+            }
+        }
+
+        return false;
+    }
+
     /**
      * Determine whether this is the root node
      *
@@ -473,22 +565,7 @@ public class NodeDelegate extends ItemDe
      */
     private String getDefaultChildType(
             Tree typeRoot, Tree parent, String childName) {
-        List<Tree> types = newArrayList();
-
-        String primary = getName(parent, JCR_PRIMARYTYPE);
-        if (primary != null) {
-            Tree type = typeRoot.getChild(primary);
-            if (type != null) {
-                types.add(type);
-            }
-        }
-
-        for (String mixin : getNames(parent, JCR_MIXINTYPES)) {
-            Tree type = typeRoot.getChild(mixin);
-            if (type != null) {
-                types.add(type);
-            }
-        }
+        List<Tree> types = getEffectiveType(parent, typeRoot);
 
         // first look for named node definitions
         for (Tree type : types) {
@@ -521,6 +598,30 @@ public class NodeDelegate extends ItemDe
         return null;
     }
 
+    /**
+     * Returns the effective node types of the given node.
+     */
+    private static List<Tree> getEffectiveType(Tree tree, Tree typeRoot) {
+        List<Tree> types = newArrayList();
+
+        String primary = getName(tree, JCR_PRIMARYTYPE);
+        if (primary != null) {
+            Tree type = typeRoot.getChild(primary);
+            if (type != null) {
+                types.add(type);
+            }
+        }
+
+        for (String mixin : getNames(tree, JCR_MIXINTYPES)) {
+            Tree type = typeRoot.getChild(mixin);
+            if (type != null) {
+                types.add(type);
+            }
+        }
+
+        return types;
+    }
+
     private String findDefaultPrimaryType(Tree typeRoot, Tree definitions) {
         for (Tree definition : definitions.getChildren()) {
             String defaultName = getName(definition, JCR_DEFAULTPRIMARYTYPE);

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/PropertyDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/PropertyDelegate.java?rev=1476253&r1=1476252&r2=1476253&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/PropertyDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/delegate/PropertyDelegate.java
Fri Apr 26 15:20:54 2013
@@ -36,6 +36,11 @@ public class PropertyDelegate extends It
         super(sessionDelegate, location);
     }
 
+    @Override
+    public boolean isProtected() throws InvalidItemStateException {
+        return getParent().isProtected(getName());
+    }
+
     @Nonnull
     public PropertyState getPropertyState() throws InvalidItemStateException {
         PropertyState p = getLocation().getProperty();



Mime
View raw message