jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1333515 - in /jackrabbit/oak/trunk: oak-it/jcr/pom.xml oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/nodetype/NodeTypeImpl.java
Date Thu, 03 May 2012 15:48:33 GMT
Author: reschke
Date: Thu May  3 15:48:32 2012
New Revision: 1333515

URL: http://svn.apache.org/viewvc?rev=1333515&view=rev
Log:
OAK-66: fix getDeclaredSubtypes, update test exclusions

Modified:
    jackrabbit/oak/trunk/oak-it/jcr/pom.xml
    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=1333515&r1=1333514&r2=1333515&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-it/jcr/pom.xml Thu May  3 15:48:32 2012
@@ -97,7 +97,6 @@ org.apache.jackrabbit.test.api.SessionRe
 org.apache.jackrabbit.test.api.HasPermissionTest
 org.apache.jackrabbit.test.api.WorkspaceTest
 org.apache.jackrabbit.test.api.ShareableNodeTest
-org.apache.jackrabbit.test.api.nodetype.NodeTypeTest#testGetDeclaredSubtypes
 org.apache.jackrabbit.test.api.nodetype.NodeTypeTest#testGetPropertyDefs
 org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest
 org.apache.jackrabbit.test.api.nodetype.CanAddChildNodeCallWithNodeTypeTest

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=1333515&r1=1333514&r2=1333515&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 15:48:32 2012
@@ -282,11 +282,16 @@ class NodeTypeImpl implements NodeType {
     @Override
     public NodeTypeIterator getDeclaredSubtypes() {
         try {
-            Collection<NodeType> types =
-                    new ArrayList<NodeType>(declaredSuperTypeNames.length);
-            for (String declaredSuperTypeName : declaredSuperTypeNames) {
-                types.add(manager.getNodeType(
-                        mapper.getJcrName(declaredSuperTypeName)));
+            Collection<NodeType> types = new ArrayList<NodeType>();
+            NodeTypeIterator iterator = manager.getAllNodeTypes();
+            while (iterator.hasNext()) {
+                NodeType type = iterator.nextNodeType();
+                if (type.isNodeType(getName()) && !isNodeType(type.getName())) {
+                    List<String> declaredSuperTypeNames = Arrays.asList(type.getDeclaredSupertypeNames());
+                    if (declaredSuperTypeNames.contains(type)) {
+                        types.add(type);
+                    }
+                }
             }
             return new NodeTypeIteratorAdapter(types);
         } catch (RepositoryException e) {



Mime
View raw message