--- jsr166/src/test/tck/PriorityBlockingQueueTest.java 2015/04/25 04:55:31 1.61 +++ jsr166/src/test/tck/PriorityBlockingQueueTest.java 2015/05/15 18:21:19 1.62 @@ -220,8 +220,8 @@ public class PriorityBlockingQueueTest e * addAll(this) throws IAE */ public void testAddAllSelf() { + PriorityBlockingQueue q = populatedQueue(SIZE); try { - PriorityBlockingQueue q = populatedQueue(SIZE); q.addAll(q); shouldThrow(); } catch (IllegalArgumentException success) {} @@ -232,11 +232,11 @@ public class PriorityBlockingQueueTest e * possibly adding some elements */ public void testAddAll3() { + PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE); + Integer[] ints = new Integer[SIZE]; + for (int i = 0; i < SIZE-1; ++i) + ints[i] = new Integer(i); try { - PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE); - Integer[] ints = new Integer[SIZE]; - for (int i = 0; i < SIZE-1; ++i) - ints[i] = new Integer(i); q.addAll(Arrays.asList(ints)); shouldThrow(); } catch (NullPointerException success) {}