From 7589eb23fcbe01f3ee44a8874607f8d7cd9fe017 Mon Sep 17 00:00:00 2001 From: Ivan Hetman Date: Thu, 21 Sep 2023 17:05:18 +0300 Subject: [PATCH] classlib: remove deprecated constructors of primitive wrappers (#754) --- .../teavm/classlib/java/text/TDateFormat.java | 6 +-- .../java/util/regex/TAbstractSet.java | 2 +- .../classlib/java/util/regex/TQuantifier.java | 2 +- .../classlib/java/text/MessageFormatTest.java | 2 +- .../classlib/java/util/HashtableTest.java | 24 ++++----- .../teavm/classlib/java/util/TreeMapTest.java | 39 +++++++------- .../classlib/java/util/regex/MatcherTest.java | 4 +- .../classlib/java/util/regex/PatternTest.java | 18 +++---- .../support/CollectionTestSupport.java | 28 +++++----- .../classlib/support/ListTestSupport.java | 52 +++++++++---------- .../UnmodifiableCollectionTestSupport.java | 14 ++--- .../teavm/dependency/DependencyTestData.java | 2 +- 12 files changed, 95 insertions(+), 98 deletions(-) diff --git a/classlib/src/main/java/org/teavm/classlib/java/text/TDateFormat.java b/classlib/src/main/java/org/teavm/classlib/java/text/TDateFormat.java index 5c018809a..2a356ca74 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/text/TDateFormat.java +++ b/classlib/src/main/java/org/teavm/classlib/java/text/TDateFormat.java @@ -275,8 +275,8 @@ public abstract class TDateFormat extends TFormat { protected Field(String fieldName, int calendarField) { super(fieldName); this.calendarField = calendarField; - if (calendarField != -1 && table.get(new Integer(calendarField)) == null) { - table.put(new Integer(calendarField), this); + if (calendarField != -1 && table.get(calendarField) == null) { + table.put(calendarField, this); } } @@ -289,7 +289,7 @@ public abstract class TDateFormat extends TFormat { throw new IllegalArgumentException(); } - return table.get(new Integer(calendarField)); + return table.get(calendarField); } } } diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/regex/TAbstractSet.java b/classlib/src/main/java/org/teavm/classlib/java/util/regex/TAbstractSet.java index 31989d357..05eaffe35 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/regex/TAbstractSet.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/regex/TAbstractSet.java @@ -63,7 +63,7 @@ abstract class TAbstractSet { protected boolean isSecondPassVisited; - protected String index = new Integer(TAbstractSet.counter++).toString(); + protected String index = Integer.toString(TAbstractSet.counter++); private int type; diff --git a/classlib/src/main/java/org/teavm/classlib/java/util/regex/TQuantifier.java b/classlib/src/main/java/org/teavm/classlib/java/util/regex/TQuantifier.java index 8d8a11c3a..c250a1780 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/util/regex/TQuantifier.java +++ b/classlib/src/main/java/org/teavm/classlib/java/util/regex/TQuantifier.java @@ -83,7 +83,7 @@ class TQuantifier extends TSpecialToken implements Cloneable { @Override public String toString() { - return "{" + min + "," + ((max == Integer.MAX_VALUE) ? "" : new Integer(max).toString()) + "}"; + return "{" + min + "," + ((max == Integer.MAX_VALUE) ? "" : Integer.toString(max)) + "}"; } @Override diff --git a/tests/src/test/java/org/teavm/classlib/java/text/MessageFormatTest.java b/tests/src/test/java/org/teavm/classlib/java/text/MessageFormatTest.java index 4bca4e747..b7ffb0e38 100644 --- a/tests/src/test/java/org/teavm/classlib/java/text/MessageFormatTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/text/MessageFormatTest.java @@ -109,7 +109,7 @@ public class MessageFormatTest { buffer.append(" def "); buffer.append(DateFormat.getDateInstance().format(date)); buffer.append(" ghi "); - buffer.append(NumberFormat.getInstance().format(new Double(7.2))); + buffer.append(NumberFormat.getInstance().format(7.2)); buffer.append(" jkl high mnop 123"); assertTrue("Wrong answer:\n" + result + "\n" + buffer, result.equals(buffer.toString())); diff --git a/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java b/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java index 077457617..5f7426880 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/HashtableTest.java @@ -146,7 +146,7 @@ public class HashtableTest { // Test for method java.util.Hashtable(java.util.Map) Map map = new TreeMap<>(); Object firstVal = "Gabba"; - Object secondVal = new Integer(5); + Object secondVal = 5; map.put("Gah", firstVal); map.put("Ooga", secondVal); Hashtable ht = new Hashtable<>(map); @@ -386,9 +386,9 @@ public class HashtableTest { } Map map = new Hashtable<>(101); - map.put(new Integer(1), "1"); - map.put(new Integer(102), "102"); - map.put(new Integer(203), "203"); + map.put(1, "1"); + map.put(102, "102"); + map.put(203, "203"); Iterator it = map.keySet().iterator(); Integer remove1 = it.next(); it.remove(); @@ -402,15 +402,15 @@ public class HashtableTest { assertTrue("Wrong contents", map.keySet().iterator().next().equals(list.get(0))); Map map2 = new Hashtable<>(101); - map2.put(new Integer(1), "1"); - map2.put(new Integer(4), "4"); + map2.put(1, "1"); + map2.put(4, "4"); Iterator it2 = map2.keySet().iterator(); Integer remove3 = it2.next(); Integer next; if (remove3.intValue() == 1) { - next = new Integer(4); + next = 4; } else { - next = new Integer(1); + next = 1; } it2.hasNext(); it2.remove(); @@ -476,7 +476,7 @@ public class HashtableTest { // Test for method java.lang.Object // java.util.Hashtable.put(java.lang.Object, java.lang.Object) Hashtable h = hashtableClone(ht100); - Integer key = new Integer(100); + Integer key = 100; h.put("Value 100", key); assertTrue("Key/Value not inserted", h.size() == 1 && (h.contains(key))); } @@ -558,13 +558,13 @@ public class HashtableTest { Hashtable myHashtable = new Hashtable<>(); for (int i = 0; i < 100; i++) { - myHashtable.put(new Integer(i), new Integer(i)); + myHashtable.put(i, i); } Collection values = myHashtable.values(); new UnmodifiableCollectionTestSupport(values).runTest(); - values.remove(new Integer(0)); + values.remove(0); assertTrue("Removing from the values collection should remove from the original map", - !myHashtable.containsValue(new Integer(0))); + !myHashtable.containsValue(0)); } @Test diff --git a/tests/src/test/java/org/teavm/classlib/java/util/TreeMapTest.java b/tests/src/test/java/org/teavm/classlib/java/util/TreeMapTest.java index 002e8faf2..b3b2abb9b 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/TreeMapTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/TreeMapTest.java @@ -126,9 +126,8 @@ public class TreeMapTest { public TreeMapTest() { tm = new TreeMap<>(); for (int i = 0; i < objArray.length; i++) { - Object x = new Integer(i); - objArray[i] = x; - tm.put(x.toString(), x); + objArray[i] = i; + tm.put(Integer.toString(i), i); } } @@ -139,12 +138,12 @@ public class TreeMapTest { TreeMap reversedTreeMap = new TreeMap<>(comp); assertTrue("TreeMap answered incorrect comparator", reversedTreeMap .comparator() == comp); - reversedTreeMap.put(new Integer(1).toString(), new Integer(1)); - reversedTreeMap.put(new Integer(2).toString(), new Integer(2)); + reversedTreeMap.put(Integer.toString(1), 1); + reversedTreeMap.put(Integer.toString(2), 2); assertTrue("TreeMap does not use comparator (firstKey was incorrect)", - reversedTreeMap.firstKey().equals(new Integer(2).toString())); + reversedTreeMap.firstKey().equals(Integer.toString(2))); assertTrue("TreeMap does not use comparator (lastKey was incorrect)", - reversedTreeMap.lastKey().equals(new Integer(1).toString())); + reversedTreeMap.lastKey().equals(Integer.toString(1))); } @Test @@ -162,15 +161,15 @@ public class TreeMapTest { // Test for method java.util.TreeMap(java.util.SortedMap) Comparator comp = new ReversedComparator(); TreeMap reversedTreeMap = new TreeMap<>(comp); - reversedTreeMap.put(new Integer(1).toString(), new Integer(1)); - reversedTreeMap.put(new Integer(2).toString(), new Integer(2)); + reversedTreeMap.put(Integer.toString(1), 1); + reversedTreeMap.put(Integer.toString(2), 2); TreeMap anotherTreeMap = new TreeMap<>(reversedTreeMap); assertTrue("New tree map does not answer correct comparator", anotherTreeMap.comparator() == comp); assertTrue("TreeMap does not use comparator (firstKey was incorrect)", - anotherTreeMap.firstKey().equals(new Integer(2).toString())); + anotherTreeMap.firstKey().equals(Integer.toString(2))); assertTrue("TreeMap does not use comparator (lastKey was incorrect)", - anotherTreeMap.lastKey().equals(new Integer(1).toString())); + anotherTreeMap.lastKey().equals(Integer.toString(1))); } @Test @@ -219,12 +218,12 @@ public class TreeMapTest { Comparator comp = new ReversedComparator(); TreeMap reversedTreeMap = new TreeMap<>(comp); assertTrue("TreeMap answered incorrect comparator", reversedTreeMap.comparator() == comp); - reversedTreeMap.put(new Integer(1).toString(), new Integer(1)); - reversedTreeMap.put(new Integer(2).toString(), new Integer(2)); + reversedTreeMap.put(Integer.toString(1), 1); + reversedTreeMap.put(Integer.toString(2), 2); assertTrue("TreeMap does not use comparator (firstKey was incorrect)", - reversedTreeMap.firstKey().equals(new Integer(2).toString())); + reversedTreeMap.firstKey().equals(Integer.toString(2))); assertTrue("TreeMap does not use comparator (lastKey was incorrect)", - reversedTreeMap.lastKey().equals(new Integer(1).toString())); + reversedTreeMap.lastKey().equals(Integer.toString(1))); } @Test @@ -280,7 +279,7 @@ public class TreeMapTest { Map head = tm.headMap("100"); assertEquals("Returned map of incorrect size", 3, head.size()); assertTrue("Returned incorrect elements", head.containsKey("0") - && head.containsValue(new Integer("1")) + && head.containsValue(Integer.parseInt("1")) && head.containsKey("10")); // Regression for Harmony-1026 @@ -377,7 +376,7 @@ public class TreeMapTest { Set ks = tm.keySet(); assertTrue("Returned set of incorrect size", ks.size() == objArray.length); for (int i = 0; i < tm.size(); i++) { - assertTrue("Returned set is missing keys", ks.contains(new Integer(i).toString())); + assertTrue("Returned set is missing keys", ks.contains(Integer.toString(i))); } } @@ -396,7 +395,7 @@ public class TreeMapTest { assertTrue("Failed to put mapping", tm.get("Hello") == o); tm = new TreeMap<>(); - assertNull(tm.put(new Integer(1), new Object())); + assertNull(tm.put(1, new Object())); } @Test @@ -567,9 +566,9 @@ public class TreeMapTest { myTreeMap.put(objArray[i], objArray[i]); } Collection values = myTreeMap.values(); - values.remove(new Integer(0)); + values.remove(0); assertTrue("Removing from the values collection should remove from the original map", - !myTreeMap.containsValue(new Integer(0))); + !myTreeMap.containsValue(0)); } /* diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/MatcherTest.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/MatcherTest.java index afa9c9f76..2d9f654f1 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/MatcherTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/MatcherTest.java @@ -108,7 +108,7 @@ public class MatcherTest { StringBuffer sb = new StringBuffer(); for (int i = 0; m.find(); i++) { - m.appendReplacement(sb, new Integer(i * 10 + i).toString()); + m.appendReplacement(sb, Integer.toString(i * 10 + i)); } m.appendTail(sb); assertEquals("Today is 0-11-22 ...", sb.toString()); @@ -120,7 +120,7 @@ public class MatcherTest { Matcher m = p.matcher("xx $ equals to xx rur."); StringBuffer sb = new StringBuffer(); for (int i = 1; m.find(); i *= 30) { - String rep = new Integer(i).toString() + " $1"; + String rep = i + " $1"; m.appendReplacement(sb, rep); } m.appendTail(sb); diff --git a/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternTest.java b/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternTest.java index 5433e2aa2..8b2f2cdf3 100644 --- a/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternTest.java +++ b/tests/src/test/java/org/teavm/classlib/java/util/regex/PatternTest.java @@ -608,16 +608,16 @@ public class PatternTest { @Test public void testBug197() { - Object[] vals = { ":", new Integer(2), - new String[] { "boo", "and:foo" }, ":", new Integer(5), - new String[] { "boo", "and", "foo" }, ":", new Integer(-2), - new String[] { "boo", "and", "foo" }, ":", new Integer(3), - new String[] { "boo", "and", "foo" }, ":", new Integer(1), - new String[] { "boo:and:foo" }, "o", new Integer(5), + Object[] vals = { ":", 2, + new String[] { "boo", "and:foo" }, ":", 5, + new String[] { "boo", "and", "foo" }, ":", -2, + new String[] { "boo", "and", "foo" }, ":", 3, + new String[] { "boo", "and", "foo" }, ":", 1, + new String[] { "boo:and:foo" }, "o", 5, new String[] { "b", "", ":and:f", "", "" }, "o", - new Integer(4), new String[] { "b", "", ":and:f", "o" }, "o", - new Integer(-2), new String[] { "b", "", ":and:f", "", "" }, - "o", new Integer(0), new String[] { "b", "", ":and:f" } }; + 4, new String[] { "b", "", ":and:f", "o" }, "o", + -2, new String[] { "b", "", ":and:f", "", "" }, + "o", 0, new String[] { "b", "", ":and:f" } }; for (int i = 0; i < vals.length / 3;) { String[] res = Pattern.compile(vals[i++].toString()).split("boo:and:foo", (Integer) vals[i++]); diff --git a/tests/src/test/java/org/teavm/classlib/support/CollectionTestSupport.java b/tests/src/test/java/org/teavm/classlib/support/CollectionTestSupport.java index 865785814..f22c299ef 100644 --- a/tests/src/test/java/org/teavm/classlib/support/CollectionTestSupport.java +++ b/tests/src/test/java/org/teavm/classlib/support/CollectionTestSupport.java @@ -68,17 +68,17 @@ public class CollectionTestSupport { // setup Collection myCollection = new TreeSet<>(); - myCollection.add(new Integer(101)); - myCollection.add(new Integer(102)); - myCollection.add(new Integer(103)); + myCollection.add(101); + myCollection.add(102); + myCollection.add(103); // add - assertTrue("CollectionTest - a) add did not work", col.add(new Integer(101))); - assertTrue("CollectionTest - b) add did not work", col.contains(new Integer(101))); + assertTrue("CollectionTest - a) add did not work", col.add(101)); + assertTrue("CollectionTest - b) add did not work", col.contains(101)); // remove - assertTrue("CollectionTest - a) remove did not work", col.remove(new Integer(101))); - assertTrue("CollectionTest - b) remove did not work", !col.contains(new Integer(101))); + assertTrue("CollectionTest - a) remove did not work", col.remove(101)); + assertTrue("CollectionTest - b) remove did not work", !col.contains(101)); // addAll assertTrue("CollectionTest - a) addAll failed", col.addAll(myCollection)); @@ -86,28 +86,26 @@ public class CollectionTestSupport { // containsAll assertTrue("CollectionTest - a) containsAll failed", col.containsAll(myCollection)); - col.remove(new Integer(101)); + col.remove(101); assertTrue("CollectionTest - b) containsAll failed", !col.containsAll(myCollection)); // removeAll assertTrue("CollectionTest - a) removeAll failed", col.removeAll(myCollection)); assertTrue("CollectionTest - b) removeAll failed", !col.removeAll(myCollection)); - assertTrue("CollectionTest - c) removeAll failed", !col.contains(new Integer(102))); - assertTrue("CollectionTest - d) removeAll failed", !col.contains(new Integer(103))); + assertTrue("CollectionTest - c) removeAll failed", !col.contains(102)); + assertTrue("CollectionTest - d) removeAll failed", !col.contains(103)); // retianAll col.addAll(myCollection); assertTrue("CollectionTest - a) retainAll failed", col.retainAll(myCollection)); assertTrue("CollectionTest - b) retainAll failed", !col.retainAll(myCollection)); assertTrue("CollectionTest - c) retainAll failed", col.containsAll(myCollection)); - assertTrue("CollectionTest - d) retainAll failed", !col.contains(new Integer(0))); - assertTrue("CollectionTest - e) retainAll failed", !col.contains(new Integer(50))); + assertTrue("CollectionTest - d) retainAll failed", !col.contains(0)); + assertTrue("CollectionTest - e) retainAll failed", !col.contains(50)); // clear col.clear(); assertTrue("CollectionTest - a) clear failed", col.isEmpty()); - assertTrue("CollectionTest - b) clear failed", !col.contains(new Integer(101))); - + assertTrue("CollectionTest - b) clear failed", !col.contains(101)); } - } diff --git a/tests/src/test/java/org/teavm/classlib/support/ListTestSupport.java b/tests/src/test/java/org/teavm/classlib/support/ListTestSupport.java index 9f43a94ba..ecf635e02 100644 --- a/tests/src/test/java/org/teavm/classlib/support/ListTestSupport.java +++ b/tests/src/test/java/org/teavm/classlib/support/ListTestSupport.java @@ -71,51 +71,51 @@ public class ListTestSupport { Object elem; elem = list.get(counter); hashCode = 31 * hashCode + elem.hashCode(); - assertTrue("ListTest - get failed", elem.equals(new Integer(counter))); + assertTrue("ListTest - get failed", elem.equals(counter)); } assertTrue("ListTest - hashCode failed", hashCode == list.hashCode()); - list.add(50, new Integer(1000)); - assertTrue("ListTest - a) add with index failed--did not insert", list.get(50).equals(new Integer(1000))); + list.add(50, 1000); + assertTrue("ListTest - a) add with index failed--did not insert", list.get(50).equals(1000)); assertTrue("ListTest - b) add with index failed--did not move following elements", - list.get(51).equals(new Integer(50))); + list.get(51).equals(50)); assertTrue("ListTest - c) add with index failed--affected previous elements", - list.get(49).equals(new Integer(49))); + list.get(49).equals(49)); - list.set(50, new Integer(2000)); - assertTrue("ListTest - a) set failed--did not set", list.get(50).equals(new Integer(2000))); - assertTrue("ListTest - b) set failed--affected following elements", list.get(51).equals(new Integer(50))); - assertTrue("ListTest - c) set failed--affected previous elements", list.get(49).equals(new Integer(49))); + list.set(50, 2000); + assertTrue("ListTest - a) set failed--did not set", list.get(50).equals(2000)); + assertTrue("ListTest - b) set failed--affected following elements", list.get(51).equals(50)); + assertTrue("ListTest - c) set failed--affected previous elements", list.get(49).equals(49)); list.remove(50); - assertTrue("ListTest - a) remove with index failed--did not remove", list.get(50).equals(new Integer(50))); + assertTrue("ListTest - a) remove with index failed--did not remove", list.get(50).equals(50)); assertTrue("ListTest - b) remove with index failed--did not move following elements", - list.get(51).equals(new Integer(51))); + list.get(51).equals(51)); assertTrue("ListTest - c) remove with index failed--affected previous elements", - list.get(49).equals(new Integer(49))); + list.get(49).equals(49)); List myList = new LinkedList<>(); - myList.add(new Integer(500)); - myList.add(new Integer(501)); - myList.add(new Integer(502)); + myList.add(500); + myList.add(501); + myList.add(502); list.addAll(50, myList); - assertTrue("ListTest - a) addAll with index failed--did not insert", list.get(50).equals(new Integer(500))); - assertTrue("ListTest - b) addAll with index failed--did not insert", list.get(51).equals(new Integer(501))); - assertTrue("ListTest - c) addAll with index failed--did not insert", list.get(52).equals(new Integer(502))); + assertTrue("ListTest - a) addAll with index failed--did not insert", list.get(50).equals(500)); + assertTrue("ListTest - b) addAll with index failed--did not insert", list.get(51).equals(501)); + assertTrue("ListTest - c) addAll with index failed--did not insert", list.get(52).equals(502)); assertTrue("ListTest - d) addAll with index failed--did not move following elements", - list.get(53).equals(new Integer(50))); + list.get(53).equals(50)); assertTrue("ListTest - e) addAll with index failed--affected previous elements", - list.get(49).equals(new Integer(49))); + list.get(49).equals(49)); List mySubList = list.subList(50, 53); assertEquals(3, mySubList.size()); assertTrue("ListTest - a) sublist Failed--does not contain correct elements", - mySubList.get(0).equals(new Integer(500))); + mySubList.get(0).equals(500)); assertTrue("ListTest - b) sublist Failed--does not contain correct elements", - mySubList.get(1).equals(new Integer(501))); + mySubList.get(1).equals(501)); assertTrue("ListTest - c) sublist Failed--does not contain correct elements", - mySubList.get(2).equals(new Integer(502))); + mySubList.get(2).equals(502)); t_listIterator(mySubList); @@ -128,7 +128,7 @@ public class ListTestSupport { for (int counter = 0; li.hasNext(); counter++) { Object elem; elem = li.next(); - assertTrue("ListTest - listIterator failed", elem.equals(new Integer(counter))); + assertTrue("ListTest - listIterator failed", elem.equals(counter)); } new CollectionTestSupport(list).runTest(); @@ -186,8 +186,8 @@ public class ListTestSupport { } assertTrue("list iterator previous() exception", exception); - Integer add1 = new Integer(600); - Integer add2 = new Integer(601); + Integer add1 = 600; + Integer add2 = 601; li.add(add1); assertTrue("list iterator add(), size()", list.size() == (orgSize + 1)); assertEquals("list iterator add(), nextIndex()", 1, li.nextIndex()); diff --git a/tests/src/test/java/org/teavm/classlib/support/UnmodifiableCollectionTestSupport.java b/tests/src/test/java/org/teavm/classlib/support/UnmodifiableCollectionTestSupport.java index 58b26fd02..bea35d1c9 100644 --- a/tests/src/test/java/org/teavm/classlib/support/UnmodifiableCollectionTestSupport.java +++ b/tests/src/test/java/org/teavm/classlib/support/UnmodifiableCollectionTestSupport.java @@ -71,21 +71,21 @@ public class UnmodifiableCollectionTestSupport { // contains assertTrue("UnmodifiableCollectionTest - should contain 0", col - .contains(new Integer(0))); + .contains(0)); assertTrue("UnmodifiableCollectionTest - should contain 50", col - .contains(new Integer(50))); + .contains(50)); assertTrue("UnmodifiableCollectionTest - should not contain 100", !col - .contains(new Integer(100))); + .contains(100)); // containsAll HashSet hs = new HashSet<>(); - hs.add(new Integer(0)); - hs.add(new Integer(25)); - hs.add(new Integer(99)); + hs.add(0); + hs.add(25); + hs.add(99); assertTrue( "UnmodifiableCollectionTest - should contain set of 0, 25, and 99", col.containsAll(hs)); - hs.add(new Integer(100)); + hs.add(100); assertTrue( "UnmodifiableCollectionTest - should not contain set of 0, 25, 99 and 100", !col.containsAll(hs)); diff --git a/tests/src/test/java/org/teavm/dependency/DependencyTestData.java b/tests/src/test/java/org/teavm/dependency/DependencyTestData.java index 4fe5e8aa2..3cb2c85f6 100644 --- a/tests/src/test/java/org/teavm/dependency/DependencyTestData.java +++ b/tests/src/test/java/org/teavm/dependency/DependencyTestData.java @@ -49,7 +49,7 @@ public class DependencyTestData { } public static void arrays() { - Object[] array = { new String("123"), new Integer(123), String.class }; + Object[] array = { new String("123"), 123, String.class }; MetaAssertions.assertTypes(array[0], String.class, Integer.class, Class.class); }