jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1333451 - in /jackrabbit/oak/trunk: oak-it/jcr/pom.xml oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java
Date Thu, 03 May 2012 13:27:18 GMT
Author: reschke
Date: Thu May  3 13:27:18 2012
New Revision: 1333451

URL: http://svn.apache.org/viewvc?rev=1333451&view=rev
Log:
OAK-66: fix name mapping in NodeType.isNodeType, wire into Node.isNodeType, update test expectations


Modified:
    jackrabbit/oak/trunk/oak-it/jcr/pom.xml
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java

Modified: jackrabbit/oak/trunk/oak-it/jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/jcr/pom.xml?rev=1333451&r1=1333450&r2=1333451&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-it/jcr/pom.xml Thu May  3 13:27:18 2012
@@ -44,7 +44,6 @@
             <property>
               <name>known.issues</name>
               <value>
-org.apache.jackrabbit.test.api.NodeDiscoveringNodeTypesTest#testIsNodeType
 org.apache.jackrabbit.test.api.SessionReadMethodsTest#testGetNodeByUUIDFailure
 org.apache.jackrabbit.test.api.PathTest
 org.apache.jackrabbit.test.api.AddNodeTest#testSameNameSiblings

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=1333451&r1=1333450&r2=1333451&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 May  3 13:27:18 2012
@@ -602,19 +602,23 @@ public class NodeImpl extends ItemImpl i
         // TODO: might be expanded, need a better way for this
         String jcrName = sessionContext.getNamePathMapper().getJcrName(sessionContext.getNamePathMapper().getOakName(nodeTypeName));
 
-        if (hasProperty(Property.JCR_PRIMARY_TYPE) && getProperty(Property.JCR_PRIMARY_TYPE).getString().equals(jcrName))
{
+        // TODO: figure out the right place for this check
+        NodeTypeManager ntm = sessionContext.getNodeTypeManager();
+        NodeType ntToCheck = ntm.getNodeType(jcrName); // throws on not found
+        String nameToCheck = ntToCheck.getName();
+
+        NodeType currentPrimaryType = getPrimaryNodeType();
+        if (currentPrimaryType.isNodeType(nameToCheck)) {
             return true;
         }
-        if (hasProperty(Property.JCR_MIXIN_TYPES)) {
-            Value[] mixins = getProperty(Property.JCR_MIXIN_TYPES).getValues();
-            for (Value mixin : mixins) {
-                if (mixin.getString().equals(jcrName)) {
-                    return true;
-                }
+
+        for (NodeType mixin : getMixinNodeTypes()) {
+            if (mixin.isNodeType(nameToCheck)) {
+                return true;
             }
         }
+        // TODO: END
 
-        // TODO evaluate effective node type
         return false;
     }
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java?rev=1333451&r1=1333450&r2=1333451&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java
Thu May  3 13:27:18 2012
@@ -229,7 +229,7 @@ class NodeTypeImpl implements NodeType {
             Queue<String> queue = new LinkedList<String>(
                     Arrays.asList(getDeclaredSupertypeNames()));
             while (!queue.isEmpty()) {
-                String name = mapper.getJcrName(queue.remove());
+                String name = queue.remove();
                 if (added.add(name)) {
                     NodeType type = manager.getNodeType(name);
                     types.add(type);



Mime
View raw message