You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2014/09/09 15:48:37 UTC

svn commit: r1623823 - /uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/ListUtils.java

Author: schor
Date: Tue Sep  9 13:48:37 2014
New Revision: 1623823

URL: http://svn.apache.org/r1623823
Log:
[UIMA-4003] switch intset rep to IntHashSet for ListUtils because common use is small number of ints but not near 0

Modified:
    uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/ListUtils.java

Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/ListUtils.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/ListUtils.java?rev=1623823&r1=1623822&r2=1623823&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/ListUtils.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/cas/impl/ListUtils.java Tue Sep  9 13:48:37 2014
@@ -28,7 +28,6 @@ import org.apache.uima.cas.CAS;
 import org.apache.uima.cas.impl.XmiSerializationSharedData.OotsElementData;
 import org.apache.uima.internal.util.IntHashSet;
 import org.apache.uima.internal.util.IntVector;
-import org.apache.uima.internal.util.PositiveIntSet;
 import org.apache.uima.internal.util.XmlAttribute;
 import org.apache.uima.util.Level;
 import org.apache.uima.util.Logger;
@@ -195,7 +194,7 @@ public class ListUtils {
   }
   
   public int getLength(int type, int addr, int neListType, int tailFeat) {
-    PositiveIntSet visited = new PositiveIntSet();
+    IntHashSet visited = new IntHashSet();
   	foundCycle = false;
   	// first count length of list so we can allocate array
   	int length = 0;
@@ -373,7 +372,7 @@ public class ListUtils {
     int currLength = this.getLength(this.neIntListType, addr);
     int curNode = addr;
     int prevNode = 0;
-    PositiveIntSet visited = new PositiveIntSet();
+    IntHashSet visited = new IntHashSet();
     boolean foundCycle = false;
     int i =0;
     
@@ -449,7 +448,7 @@ public class ListUtils {
     int currLength = this.getLength(this.neFloatListType, addr);
     int curNode = addr;
     int prevNode = 0;
-    PositiveIntSet visited = new PositiveIntSet();
+    IntHashSet visited = new IntHashSet();
     boolean foundCycle = false;
     int i =0;
     
@@ -524,7 +523,7 @@ public class ListUtils {
     int first = addr;
     int currLength = this.getLength(this.neFsListType, addr);
     boolean foundCycle = false;
-    PositiveIntSet visited = new PositiveIntSet();
+    IntHashSet visited = new IntHashSet();
     int curNode = addr;
     int prevNode = 0;
     
@@ -602,7 +601,7 @@ public class ListUtils {
   public int updateStringList(int addr, List<String> stringValues) throws SAXException   {
     int first = addr;
     boolean foundCycle = false;
-    PositiveIntSet visited = new PositiveIntSet();
+    IntHashSet visited = new IntHashSet();
     int curNode = addr;
     int prevNode = 0;
     int currLength = this.getLength(this.neStringListType, addr);