diff options
author | gjoranv <gv@oath.com> | 2018-04-26 12:23:04 +0200 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2018-04-26 14:24:52 +0200 |
commit | bc11fd9f36d6780ed34c937fef637a5e8f2c7083 (patch) | |
tree | c3c22ecb5a6742c141300c8911a88cdfde85fba3 /vespajlib/src/test/java/com/yahoo/collections | |
parent | ea6c91d76a3e76ada0f0f12a25710832114f8553 (diff) |
Remove usage of apis deprecated in Java 9.
Diffstat (limited to 'vespajlib/src/test/java/com/yahoo/collections')
3 files changed, 11 insertions, 7 deletions
diff --git a/vespajlib/src/test/java/com/yahoo/collections/ArraySetTestCase.java b/vespajlib/src/test/java/com/yahoo/collections/ArraySetTestCase.java index 1dc8e5fa62e..4e8398a3ef5 100644 --- a/vespajlib/src/test/java/com/yahoo/collections/ArraySetTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/collections/ArraySetTestCase.java @@ -247,7 +247,9 @@ public final class ArraySetTestCase { @Test public void testSmallEmptySet() { final ArraySet<Integer> t = new ArraySet<>(3); - Integer a = new Integer(0), b = new Integer(1), c = new Integer(2); + Integer a = 0; + Integer b = 1; + Integer c = 2; t.add(a); t.add(b); t.add(c); diff --git a/vespajlib/src/test/java/com/yahoo/collections/HashletTestCase.java b/vespajlib/src/test/java/com/yahoo/collections/HashletTestCase.java index 6bf97baf985..2307b2cbca9 100644 --- a/vespajlib/src/test/java/com/yahoo/collections/HashletTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/collections/HashletTestCase.java @@ -87,10 +87,10 @@ public class HashletTestCase { Hashlet<String, Integer> h = new Hashlet<>(); h.put(A, 1); int indexOfA = h.getIndexOfKey(A); - assertEquals(new Integer(1), h.value(indexOfA)); + assertEquals(Integer.valueOf(1), h.value(indexOfA)); h.setValue(indexOfA, 2); - assertEquals(new Integer(2), h.value(indexOfA)); - assertEquals(new Integer(2), h.get(A)); + assertEquals(Integer.valueOf(2), h.value(indexOfA)); + assertEquals(Integer.valueOf(2), h.get(A)); } @Test @@ -171,7 +171,7 @@ public class HashletTestCase { String str = ("" + i + "_str_" + i); assertThat(hash.get(str), nullValue()); switch (i % 2) { - case 1: assertThat(hash.put(str, new Integer(i)), nullValue()); + case 1: assertThat(hash.put(str, i), nullValue()); } } assertThat(hash.size(), is(n / 2)); @@ -179,7 +179,7 @@ public class HashletTestCase { String str = ("" + i + "_str_" + i); switch (i % 2) { case 0: assertThat(hash.get(str), nullValue()); break; - case 1: assertThat(hash.get(str), is(new Integer(i))); break; + case 1: assertThat(hash.get(str), is(i)); break; } } } diff --git a/vespajlib/src/test/java/com/yahoo/collections/TinyIdentitySetTestCase.java b/vespajlib/src/test/java/com/yahoo/collections/TinyIdentitySetTestCase.java index e579a0cad23..98aaaf267e8 100644 --- a/vespajlib/src/test/java/com/yahoo/collections/TinyIdentitySetTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/collections/TinyIdentitySetTestCase.java @@ -247,7 +247,9 @@ public final class TinyIdentitySetTestCase { @Test public void testSmallEmptySet() { final TinyIdentitySet<Integer> t = new TinyIdentitySet<>(3); - Integer a = new Integer(0), b = new Integer(1), c = new Integer(2); + Integer a = 0; + Integer b = 1; + Integer c = 2; t.add(a); t.add(b); t.add(c); |