jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r292692 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
Date Fri, 30 Sep 2005 10:12:43 GMT
Author: mreutegg
Date: Fri Sep 30 03:12:39 2005
New Revision: 292692

URL: http://svn.apache.org/viewcvs?rev=292692&view=rev
Log:
Performance improvements
- avoid unnecessary HashSet instantiation in NodeImpl.isNodeType()

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?rev=292692&r1=292691&r2=292692&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Fri Sep 30
03:12:39 2005
@@ -1182,16 +1182,19 @@
         // and check whether it includes the specified node type
         NodeTypeRegistry ntReg = session.getNodeTypeManager().getNodeTypeRegistry();
         // mixin's
-        HashSet set = new HashSet(((NodeState) state).getMixinTypeNames());
+        Set typeSet = ((NodeState) state).getMixinTypeNames();
+        QName[] types = new QName[typeSet.size() + 1];
+        typeSet.toArray(types);
         // primary type
-        set.add(primaryTypeName);
+        types[types.length - 1] = primaryTypeName;
+
         try {
             EffectiveNodeType ent =
-                    ntReg.getEffectiveNodeType((QName[]) set.toArray(new QName[set.size()]));
+                    ntReg.getEffectiveNodeType(types);
             return ent.includesNodeType(ntName);
         } catch (NodeTypeConflictException ntce) {
             String msg = "internal error: failed to build effective node type of "
-                    + set;
+                    + Arrays.asList(types);
             log.debug(msg);
             throw new RepositoryException(msg, ntce);
         }



Mime
View raw message