jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r106172 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Date Mon, 22 Nov 2004 11:14:37 GMT
Author: stefan
Date: Mon Nov 22 03:14:33 2004
New Revision: 106172

Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Log:
fixed http://nagoya.apache.org/jira/browse/JCR-21 :
NodeTypeRegistry.validateNodeTypeDef causes NullPointerException

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?view=diff&rev=106172&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java&r1=106171&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java&r2=106172
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Mon Nov 22 03:14:33 2004
@@ -419,7 +419,7 @@
 
         // validate supertypes
         QName[] supertypes = ntd.getSupertypes();
-        if (supertypes != null) {
+        if (supertypes != null && supertypes.length > 0) {
             for (int i = 0; i < supertypes.length; i++) {
                 // simple check for infinite recursion
                 // (won't trap recursion on a deeper inheritance level)
@@ -434,12 +434,12 @@
                     throw new InvalidNodeTypeDefException(reason);
                 }
             }
-        }
 
-        // check for circularity in inheritance chain ('a' extends 'b' extends 'a'):
-        Stack inheritanceChain = new Stack();
-        inheritanceChain.push(name);
-        checkForCircularInheritance(supertypes, inheritanceChain);
+            // check for circularity in inheritance chain ('a' extends 'b' extends 'a'):
+            Stack inheritanceChain = new Stack();
+            inheritanceChain.push(name);
+            checkForCircularInheritance(supertypes, inheritanceChain);
+        }
 
         /**
          * note that infinite recursion through inheritance is automatically being checked

Mime
View raw message