jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r911050 - /jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java
Date Wed, 17 Feb 2010 16:15:43 GMT
Author: mduerig
Date: Wed Feb 17 16:15:43 2010
New Revision: 911050

URL: http://svn.apache.org/viewvc?rev=911050&view=rev
Log:
JCR-2500: spi2davex NodeInfoImpl should use HashSet instead of ArrayList for childInfos

Modified:
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java?rev=911050&r1=911049&r2=911050&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/NodeInfoImpl.java
Wed Feb 17 16:15:43 2010
@@ -16,6 +16,15 @@
  */
 package org.apache.jackrabbit.spi2davex;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.jcr.RepositoryException;
+
 import org.apache.jackrabbit.spi.ChildInfo;
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.Name;
@@ -29,14 +38,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jcr.RepositoryException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.Collections;
-
 /**
  * <code>NodeInfoImpl</code>...
  */
@@ -50,9 +51,9 @@
     private Name[] mixinNodeTypeNames = new Name[0];
 
     private final Set propertyInfos = new HashSet();
-    private List childInfos = null;
+    private Set<ChildInfo> childInfos = null;
 
-    private int numberOfChildNodes = -1;
+    private final int numberOfChildNodes = -1;
 
     /**
      * Creates a new <code>NodeInfo</code>.
@@ -123,18 +124,14 @@
 
     void addChildInfo(ChildInfo childInfo) {
         if (childInfos == null) {
-            childInfos = new ArrayList();
-        }
-        if (childInfos.contains(childInfo)) {
-            log.warn("ChildInfo ( " + childInfo.toString() + " ) already contained ->
ignore.");
-        } else {
-            childInfos.add(childInfo);
+            childInfos = new HashSet<ChildInfo>();
         }
+        childInfos.add(childInfo);
     }
 
     void setNumberOfChildNodes(long numberOfChildNodes) {
         if (numberOfChildNodes == 0) {
-            childInfos = Collections.EMPTY_LIST;
+            childInfos = Collections.<ChildInfo>emptySet();
         } // else: wait for calls to #addChildInfo
     }
 



Mime
View raw message