You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2005/05/09 13:21:36 UTC

svn commit: r169283 - /incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java

Author: jukka
Date: Mon May  9 04:21:34 2005
New Revision: 169283

URL: http://svn.apache.org/viewcvs?rev=169283&view=rev
Log:
JCR-EXT: Minor improvement
	* BaseNodeType.java: Use recursion to implement Nodetype.isNodeType(String)

Modified:
    incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java

Modified: incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java?rev=169283&r1=169282&r2=169283&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-ext/src/java/org/apache/jackrabbit/base/nodetype/BaseNodeType.java Mon May  9 04:21:34 2005
@@ -79,19 +79,18 @@
     }
 
     /**
-     * Implemented by calling <code>getName()</code> on this node type and
-     * all supertypes returned by <code>getSupertypes()</code>. Returns
-     * <code>true</code> if any of the names equals the given node type name.
-     * Returns <code>false</code> otherwise.
+     * Implemented by calling <code>getName()</code> and comparing the
+     * result to the given node type name. If the match fails, recursively
+     * checks all declared supertypes.
      * {@inheritDoc}
      */
     public boolean isNodeType(String nodeTypeName) {
         if (nodeTypeName.equals(getName())) {
             return true;
         } else {
-            NodeType[] types = getSupertypes();
+            NodeType[] types = getDeclaredSupertypes();
             for (int i = 0; i < types.length; i++) {
-                if (nodeTypeName.equals(types[i].getName())) {
+                if (types[i].isNodeType(nodeTypeName)) {
                     return true;
                 }
             }