--- jsr166/src/test/tck/TreeMapTest.java 2014/12/31 19:05:43 1.28 +++ jsr166/src/test/tck/TreeMapTest.java 2016/09/15 16:43:56 1.32 @@ -21,7 +21,7 @@ import junit.framework.TestSuite; public class TreeMapTest extends JSR166TestCase { public static void main(String[] args) { - junit.textui.TestRunner.run(suite()); + main(suite(), args); } public static Test suite() { return new TestSuite(TreeMapTest.class); @@ -575,8 +575,8 @@ public class TreeMapTest extends JSR166T * get(null) of nonempty map throws NPE */ public void testGet_NullPointerException() { + TreeMap c = map5(); try { - TreeMap c = map5(); c.get(null); shouldThrow(); } catch (NullPointerException success) {} @@ -586,8 +586,8 @@ public class TreeMapTest extends JSR166T * containsKey(null) of nonempty map throws NPE */ public void testContainsKey_NullPointerException() { + TreeMap c = map5(); try { - TreeMap c = map5(); c.containsKey(null); shouldThrow(); } catch (NullPointerException success) {} @@ -597,9 +597,9 @@ public class TreeMapTest extends JSR166T * remove(null) throws NPE for nonempty map */ public void testRemove1_NullPointerException() { + TreeMap c = new TreeMap(); + c.put("sadsdf", "asdads"); try { - TreeMap c = new TreeMap(); - c.put("sadsdf", "asdads"); c.remove(null); shouldThrow(); } catch (NullPointerException success) {} @@ -802,7 +802,7 @@ public class TreeMapTest extends JSR166T static NavigableMap newMap(Class cl) throws Exception { NavigableMap result - = (NavigableMap) cl.newInstance(); + = (NavigableMap) cl.getConstructor().newInstance(); assertEquals(0, result.size()); assertFalse(result.keySet().iterator().hasNext()); return result; @@ -835,7 +835,7 @@ public class TreeMapTest extends JSR166T // Add entries till we're back to original size while (map.size() < size) { int key = min + rnd.nextInt(rangeSize); - assertTrue(key >= min && key<= max); + assertTrue(key >= min && key <= max); put(map, key); } } @@ -860,7 +860,7 @@ public class TreeMapTest extends JSR166T // Add entries till we're back to original size while (map.size() < size) { int key = min - 5 + rnd.nextInt(rangeSize + 10); - if (key >= min && key<= max) { + if (key >= min && key <= max) { put(map, key); } else { try {