--- jsr166/src/test/tck/TreeMapTest.java 2008/04/19 18:45:18 1.5 +++ jsr166/src/test/tck/TreeMapTest.java 2009/11/16 05:30:08 1.8 @@ -11,7 +11,7 @@ import java.io.*; public class TreeMapTest extends JSR166TestCase { public static void main(String[] args) { - junit.textui.TestRunner.run (suite()); + junit.textui.TestRunner.run (suite()); } public static Test suite() { return new TestSuite(TreeMapTest.class); @@ -20,7 +20,7 @@ public class TreeMapTest extends JSR166T /** * Create a map from Integers 1-5 to Strings "A"-"E". */ - private static TreeMap map5() { + private static TreeMap map5() { TreeMap map = new TreeMap(); assertTrue(map.isEmpty()); map.put(one, "A"); @@ -43,7 +43,7 @@ public class TreeMapTest extends JSR166T } /** - * + * */ public void testConstructFromSorted() { TreeMap map = map5(); @@ -260,7 +260,7 @@ public class TreeMapTest extends JSR166T Iterator it = s.iterator(); while (it.hasNext()) { Map.Entry e = (Map.Entry) it.next(); - assertTrue( + assertTrue( (e.getKey().equals(one) && e.getValue().equals("A")) || (e.getKey().equals(two) && e.getValue().equals("B")) || (e.getKey().equals(three) && e.getValue().equals("C")) || @@ -279,7 +279,7 @@ public class TreeMapTest extends JSR166T Iterator it = s.iterator(); while (it.hasNext()) { Map.Entry e = (Map.Entry) it.next(); - assertTrue( + assertTrue( (e.getKey().equals(one) && e.getValue().equals("A")) || (e.getKey().equals(two) && e.getValue().equals("B")) || (e.getKey().equals(three) && e.getValue().equals("C")) || @@ -569,7 +569,7 @@ public class TreeMapTest extends JSR166T for (int i = 1; i <= 5; ++i) { assertTrue(s.indexOf(String.valueOf(i)) >= 0); } - } + } // Exception tests @@ -581,7 +581,7 @@ public class TreeMapTest extends JSR166T TreeMap c = map5(); c.get(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e) {} } /** @@ -592,7 +592,7 @@ public class TreeMapTest extends JSR166T TreeMap c = map5(); c.containsKey(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e) {} } /** @@ -604,7 +604,7 @@ public class TreeMapTest extends JSR166T c.put("sadsdf", "asdads"); c.remove(null); shouldThrow(); - } catch(NullPointerException e){} + } catch (NullPointerException e) {} } /** @@ -625,7 +625,7 @@ public class TreeMapTest extends JSR166T assertEquals(q.size(), r.size()); assertTrue(q.equals(r)); assertTrue(r.equals(q)); - } catch(Exception e){ + } catch (Exception e) { e.printStackTrace(); unexpectedException(); } @@ -658,7 +658,7 @@ public class TreeMapTest extends JSR166T k = (Integer)(r.next()); assertEquals(two, k); assertFalse(r.hasNext()); - + Iterator j = sm.keySet().iterator(); j.next(); j.remove(); @@ -692,7 +692,7 @@ public class TreeMapTest extends JSR166T k = (Integer)(r.next()); assertEquals(two, k); assertFalse(r.hasNext()); - + Iterator j = sm.keySet().iterator(); j.next(); j.remove(); @@ -816,7 +816,7 @@ public class TreeMapTest extends JSR166T NavigableMap result = null; try { result = (NavigableMap) cl.newInstance(); - } catch(Exception e) { + } catch (Exception e) { fail(); } assertEquals(result.size(), 0); @@ -841,7 +841,7 @@ public class TreeMapTest extends JSR166T } // Remove a bunch of entries with iterator - for(Iterator it = map.keySet().iterator(); it.hasNext(); ) { + for (Iterator it = map.keySet().iterator(); it.hasNext(); ) { if (rnd.nextBoolean()) { bs.clear(it.next()); it.remove(); @@ -866,7 +866,7 @@ public class TreeMapTest extends JSR166T } // Remove a bunch of entries with iterator - for(Iterator it = map.keySet().iterator(); it.hasNext(); ) { + for (Iterator it = map.keySet().iterator(); it.hasNext(); ) { if (rnd.nextBoolean()) { bs.clear(it.next()); it.remove(); @@ -882,7 +882,7 @@ public class TreeMapTest extends JSR166T try { map.put(key, 2 * key); fail(); - } catch(IllegalArgumentException e) { + } catch (IllegalArgumentException e) { // expected } } @@ -1080,13 +1080,13 @@ public class TreeMapTest extends JSR166T try { map.firstKey(); fail(); - } catch(NoSuchElementException e) { + } catch (NoSuchElementException e) { // expected } try { map.lastKey(); fail(); - } catch(NoSuchElementException e) { + } catch (NoSuchElementException e) { // expected } } @@ -1102,5 +1102,5 @@ public class TreeMapTest extends JSR166T static boolean eq(Integer i, int j) { return i == null ? j == -1 : i == j; } - + }