jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r385598 - /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java
Date Mon, 13 Mar 2006 17:04:15 GMT
Author: stefan
Date: Mon Mar 13 09:03:46 2006
New Revision: 385598

URL: http://svn.apache.org/viewcvs?rev=385598&view=rev
Log:
minor optimization

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java?rev=385598&r1=385597&r2=385598&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeDefId.java
Mon Mar 13 09:03:46 2006
@@ -19,7 +19,7 @@
 import org.apache.jackrabbit.name.QName;
 
 import java.io.Serializable;
-import java.util.TreeSet;
+import java.util.Arrays;
 
 /**
  * <code>NodeDefId</code> uniquely identifies a <code>NodeDef</code>
in the
@@ -60,13 +60,19 @@
             sb.append(def.getName().toString());
         }
         sb.append('/');
-        // set of required node type names, sorted in ascending order
-        TreeSet set = new TreeSet();
+
+        // required node type names, sorted in ascending order
+        // format: "[name1, name2, name3]", see AbstractCollection#toString()
         QName[] names = def.getRequiredPrimaryTypes();
+        Arrays.sort(names);
+        sb.append('[');
         for (int i = 0; i < names.length; i++) {
-            set.add(names[i]);
+            if (i > 0) {
+                sb.append(", ");
+            }
+            sb.append(names[i]);
         }
-        sb.append(set.toString());
+        sb.append(']');
 
         id = sb.toString().hashCode();
     }



Mime
View raw message