--- jsr166/src/test/tck/ConcurrentSkipListSetTest.java 2009/11/02 20:28:31 1.4 +++ jsr166/src/test/tck/ConcurrentSkipListSetTest.java 2009/11/16 04:57:10 1.5 @@ -34,9 +34,9 @@ public class ConcurrentSkipListSetTest e private ConcurrentSkipListSet populatedSet(int n) { ConcurrentSkipListSet q = new ConcurrentSkipListSet(); assertTrue(q.isEmpty()); - for(int i = n-1; i >= 0; i-=2) + for (int i = n-1; i >= 0; i-=2) assertTrue(q.add(new Integer(i))); - for(int i = (n & 1); i < n; i+=2) + for (int i = (n & 1); i < n; i+=2) assertTrue(q.add(new Integer(i))); assertFalse(q.isEmpty()); assertEquals(n, q.size()); @@ -204,7 +204,7 @@ public class ConcurrentSkipListSetTest e q.add(new Object()); shouldThrow(); } - catch(ClassCastException success) {} + catch (ClassCastException success) {} } /** @@ -462,7 +462,7 @@ public class ConcurrentSkipListSetTest e ConcurrentSkipListSet q = populatedSet(SIZE); Object[] o = q.toArray(); Arrays.sort(o); - for(int i = 0; i < o.length; i++) + for (int i = 0; i < o.length; i++) assertEquals(o[i], q.pollFirst()); } @@ -474,7 +474,7 @@ public class ConcurrentSkipListSetTest e Integer[] ints = new Integer[SIZE]; ints = (Integer[])q.toArray(ints); Arrays.sort(ints); - for(int i = 0; i < ints.length; i++) + for (int i = 0; i < ints.length; i++) assertEquals(ints[i], q.pollFirst()); } @@ -485,7 +485,7 @@ public class ConcurrentSkipListSetTest e ConcurrentSkipListSet q = populatedSet(SIZE); int i = 0; Iterator it = q.iterator(); - while(it.hasNext()) { + while (it.hasNext()) { assertTrue(q.contains(it.next())); ++i; } @@ -499,7 +499,7 @@ public class ConcurrentSkipListSetTest e ConcurrentSkipListSet q = new ConcurrentSkipListSet(); int i = 0; Iterator it = q.iterator(); - while(it.hasNext()) { + while (it.hasNext()) { assertTrue(q.contains(it.next())); ++i; } @@ -554,7 +554,7 @@ public class ConcurrentSkipListSetTest e assertEquals(q.size(), r.size()); while (!q.isEmpty()) assertEquals(q.pollFirst(), r.pollFirst()); - } catch(Exception e){ + } catch (Exception e){ e.printStackTrace(); unexpectedException(); } @@ -708,7 +708,7 @@ public class ConcurrentSkipListSetTest e NavigableSet result = null; try { result = (NavigableSet) cl.newInstance(); - } catch(Exception e) { + } catch (Exception e) { fail(); } assertEquals(result.size(), 0); @@ -733,7 +733,7 @@ public class ConcurrentSkipListSetTest e } // Remove a bunch of entries with iterator - for(Iterator it = set.iterator(); it.hasNext(); ) { + for (Iterator it = set.iterator(); it.hasNext(); ) { if (rnd.nextBoolean()) { bs.clear(it.next()); it.remove(); @@ -758,7 +758,7 @@ public class ConcurrentSkipListSetTest e } // Remove a bunch of entries with iterator - for(Iterator it = set.iterator(); it.hasNext(); ) { + for (Iterator it = set.iterator(); it.hasNext(); ) { if (rnd.nextBoolean()) { bs.clear(it.next()); it.remove(); @@ -774,7 +774,7 @@ public class ConcurrentSkipListSetTest e try { set.add(element); fail(); - } catch(IllegalArgumentException e) { + } catch (IllegalArgumentException e) { // expected } } @@ -976,13 +976,13 @@ public class ConcurrentSkipListSetTest e try { set.first(); fail(); - } catch(NoSuchElementException e) { + } catch (NoSuchElementException e) { // expected } try { set.last(); fail(); - } catch(NoSuchElementException e) { + } catch (NoSuchElementException e) { // expected } }