jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1437944 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Date Thu, 24 Jan 2013 10:59:34 GMT
Author: mduerig
Date: Thu Jan 24 10:59:33 2013
New Revision: 1437944

URL: http://svn.apache.org/viewvc?rev=1437944&view=rev
Log:
OAK-505: NodeImpl#canAddMixin uses hardcoded list of supported mixin types

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=1437944&r1=1437943&r2=1437944&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
Thu Jan 24 10:59:33 2013
@@ -62,7 +62,6 @@ import com.google.common.base.Predicates
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Iterators;
 import com.google.common.collect.Lists;
-
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.ItemNameMatcher;
 import org.apache.jackrabbit.commons.iterator.NodeIteratorAdapter;
@@ -946,11 +945,15 @@ public class NodeImpl<T extends NodeDele
                 ntm.getNodeType(mixinName); // throws on not found
                 // TODO: END
 
-                return isSupportedMixinName(mixinName) && isCheckedOut();
+                return getEffectiveNodeType().supportsMixin(mixinName);
             }
         });
     }
 
+    private EffectiveNodeType getEffectiveNodeType() throws RepositoryException {
+        return sessionDelegate.getEffectiveNodeTypeProvider().getEffectiveNodeType(this);
+    }
+
     @Override
     @Nonnull
     public NodeDefinition getDefinition() throws RepositoryException {
@@ -1404,16 +1407,6 @@ public class NodeImpl<T extends NodeDele
         addNode(definition.getName(), definition.getDefaultPrimaryTypeName());
     }
 
-    // FIXME OAK-505: hack to filter for a subset of supported mixins for now
-    // this allows only harmless mixin types so that other code like addMixin gets test coverage
-    private boolean isSupportedMixinName(String mixinName) throws RepositoryException {
-        String oakName = sessionDelegate.getOakPath(mixinName);
-        return "mix:title".equals(oakName) ||
-            NodeTypeConstants.MIX_REFERENCEABLE.equals(oakName) ||
-            NodeTypeConstants.MIX_VERSIONABLE.equals(oakName) ||
-            NodeTypeConstants.MIX_LOCKABLE.equals(oakName);
-    }
-
     private void checkValidWorkspace(String workspaceName) throws RepositoryException {
         for (String wn : sessionDelegate.getWorkspace().getAccessibleWorkspaceNames()) {
             if (wn.equals(workspaceName)) {



Mime
View raw message