Nixed some manual boxing.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2733 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2010-02-09 22:46:51 +00:00
parent 3339b6707e
commit b8b9a0d70a
6 changed files with 24 additions and 26 deletions
+3 -3
View File
@@ -94,10 +94,10 @@ public class RecentList
{
RecentList list = new RecentList(5);
for (int ii = 0; ii < 10; ii++) {
list.add(new Integer(ii));
list.add(ii);
}
System.out.println("Contains 3 " + list.contains(new Integer(3)));
System.out.println("Contains 7 " + list.contains(new Integer(7)));
System.out.println("Contains 3 " + list.contains(3));
System.out.println("Contains 7 " + list.contains(7));
for (int ii = 0; ii < list.size(); ii++) {
System.out.println(ii + " => " + list.get(ii));
}
@@ -41,11 +41,11 @@ public class CheapIntMapTest extends TestCase
CheapIntMap map = new CheapIntMap(10);
for (int ii = 0; ii < 100; ii += 20) {
map.put(ii, new Integer(ii));
map.put(ii, ii);
}
for (int ii = 0; ii < 5; ii++) {
map.put(ii, new Integer(ii));
map.put(ii, ii);
}
for (int ii = 0; ii < 100; ii++) {
@@ -60,7 +60,7 @@ public class CheapIntMapTest extends TestCase
}
for (int ii = 10; ii > 0; ii--) {
map.put(ii, new Integer(ii));
map.put(ii, ii);
}
for (int ii = 0; ii < 100; ii++) {
@@ -46,7 +46,7 @@ public class CollectionUtilTest extends TestCase
{
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i = 0; i < 100; i++) {
list.add(new Integer(i));
list.add(i);
}
for (int i = 0; i < 10; i++) {
@@ -59,8 +59,7 @@ public class CollectionUtilTest extends TestCase
Random rand = new Random();
ComparableArrayList<Integer> slist = new ComparableArrayList<Integer>();
for (int ii = 0; ii < 25; ii++) {
Integer value = new Integer(rand.nextInt(100));
slist.insertSorted(value);
slist.insertSorted(rand.nextInt(100));
}
System.out.println(StringUtil.toString(slist));
}
@@ -91,7 +91,7 @@ public class HashIntMapTest extends TestCase
// now try putting lots and lots of values in the table
// so that it grows a bunch
for (int ii=1; ii < 12345; ii += 3) {
table.put(ii, new Integer(ii));
table.put(ii, Integer.valueOf(ii));
}
// now check by removing most and seeing if everything's equal
@@ -117,9 +117,8 @@ public class HashIntMapTest extends TestCase
protected void populateTable (HashIntMap<Integer> table)
{
for (int i = 10; i < 20; i++) {
Integer value = new Integer(i);
table.put(i, value);
for (int ii = 10; ii < 20; ii++) {
table.put(ii, Integer.valueOf(ii));
}
}
@@ -45,23 +45,23 @@ public class LRUHashMapTest extends TestCase
}
});
map.put("one.1", new Integer(1));
map.put("one.1", 1);
assertTrue("size == 1", map.size() == 1);
map.put("one.2", new Integer(1));
map.put("one.2", 1);
assertTrue("size == 2", map.size() == 2);
map.put("one.3", new Integer(1));
map.put("one.3", 1);
assertTrue("size == 3", map.size() == 3);
map.put("one.4", new Integer(1));
map.put("one.4", 1);
assertTrue("size == 4", map.size() == 4);
map.put("one.5", new Integer(1));
map.put("one.5", 1);
assertTrue("size == 5", map.size() == 5);
map.put("three.1", new Integer(3));
map.put("three.1", 3);
assertTrue("size == 6", map.size() == 6);
map.put("five.1", new Integer(5));
map.put("five.1", 5);
assertTrue("size == 4", map.size() == 4);
map.put("three.2", new Integer(3));
map.put("three.2", 3);
assertTrue("size == 2", map.size() == 2);
map.put("three.3", new Integer(3));
map.put("three.3", 3);
assertTrue("size == 2", map.size() == 2);
}
@@ -50,7 +50,7 @@ public class QuickSortTest extends TestCase
for (int d = 1; d <= 100; d++) {
for (int n = 0; n < 100; n++) {
a[n] = new Integer(n / d);
a[n] = (n / d);
QuickSort.sort(a, 0, n, comp);
for (int i = 0; i <= n; i++) {
assertTrue("Failure for up " + n + "/" + d,
@@ -63,7 +63,7 @@ public class QuickSortTest extends TestCase
for (int d = 1; d <= 100; d++) {
for (int n = 0; n < 100; n++) {
for (int i = 0; i <= n; i++) {
a[i] = new Integer((n - i) / d);
a[i] = ((n - i) / d);
}
QuickSort.sort(a, 0, n, comp);
for (int i = 0; i <= n; i++) {
@@ -78,7 +78,7 @@ public class QuickSortTest extends TestCase
for (int sorts = 0; sorts < tests; sorts++) {
int n = rand(100);
for (int i = 0; i <= n; i++) {
a[i] = new Integer(rand(30000));
a[i] = rand(30000);
}
QuickSort.sort(a, 0, n, comp);
@@ -93,7 +93,7 @@ public class QuickSortTest extends TestCase
a[i].intValue() <= a[i+1].intValue());
}
a[rand(n+1)] = new Integer(rand(30000));
a[rand(n+1)] = rand(30000);
QuickSort.sort(a, 0, n, comp);
for (int i = 0; i < n; i++) {
assertTrue("Failure for random " + n + " (resort 2)",