Author: schor
Date: Thu Oct 23 17:52:37 2014
New Revision: 1633902
URL: http://svn.apache.org/r1633902
Log:
[UIMA-4060] have ListUtils use PositiveIntSet instead of IntHashSet
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=1633902&r1=1633901&r2=1633902&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
Thu Oct 23 17:52:37 2014
@@ -26,7 +26,7 @@ import java.util.ListIterator;
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.PositiveIntSet;
import org.apache.uima.internal.util.IntVector;
import org.apache.uima.internal.util.XmlAttribute;
import org.apache.uima.util.Level;
@@ -194,7 +194,7 @@ public class ListUtils {
}
public int getLength(int type, int addr, int neListType, int tailFeat) {
- final IntHashSet visited = new IntHashSet();
+ final PositiveIntSet visited = new PositiveIntSet();
foundCycle = false;
// first count length of list so we can allocate array
int length = 0;
@@ -235,7 +235,7 @@ public class ListUtils {
final int headFeat = getHeadFeatCode(type);
final int tailFeat = getTailFeatCode(type);
final int neListType = getNeListType(type);
- final IntHashSet visited = new IntHashSet();
+ final PositiveIntSet visited = new PositiveIntSet();
while (curNode != CASImpl.NULL) {
final int curNodeType = cas.getHeapValue(curNode);
@@ -385,7 +385,7 @@ public class ListUtils {
int currLength = this.getLength(this.neIntListType, addr);
int curNode = addr;
int prevNode = 0;
- final IntHashSet visited = new IntHashSet();
+ final PositiveIntSet visited = new PositiveIntSet();
boolean foundCycle = false;
int i =0;
@@ -461,7 +461,7 @@ public class ListUtils {
int currLength = this.getLength(this.neFloatListType, addr);
int curNode = addr;
int prevNode = 0;
- final IntHashSet visited = new IntHashSet();
+ final PositiveIntSet visited = new PositiveIntSet();
boolean foundCycle = false;
int i =0;
@@ -536,7 +536,7 @@ public class ListUtils {
int first = addr;
int currLength = this.getLength(this.neFsListType, addr);
boolean foundCycle = false;
- final IntHashSet visited = new IntHashSet();
+ final PositiveIntSet visited = new PositiveIntSet();
int curNode = addr;
int prevNode = 0;
@@ -614,7 +614,7 @@ public class ListUtils {
public int updateStringList(int addr, List<String> stringValues) throws
SAXException {
int first = addr;
boolean foundCycle = false;
- final IntHashSet visited = new IntHashSet();
+ final PositiveIntSet visited = new PositiveIntSet();
int curNode = addr;
int prevNode = 0;
int currLength = this.getLength(this.neStringListType, addr);