--- jsr166/src/test/tck/Collection8Test.java 2018/05/23 05:24:05 1.56 +++ jsr166/src/test/tck/Collection8Test.java 2019/12/16 21:22:33 1.60 @@ -182,7 +182,7 @@ public class Collection8Test extends JSR () -> c.iterator().forEachRemaining(null), () -> c.spliterator().forEachRemaining(null), () -> c.spliterator().tryAdvance(null), - () -> c.toArray(null)); + () -> c.toArray((Object[])null)); if (!impl.permitsNulls()) { assertThrows( @@ -210,41 +210,17 @@ public class Collection8Test extends JSR BlockingQueue q = (BlockingQueue) c; assertThrows( NullPointerException.class, - () -> { - try { q.offer(null, 1L, HOURS); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}, - () -> { - try { q.put(null); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}); + () -> q.offer(null, 1L, HOURS), + () -> q.put(null)); } if (c instanceof BlockingDeque) { BlockingDeque q = (BlockingDeque) c; assertThrows( NullPointerException.class, - () -> { - try { q.offerFirst(null, 1L, HOURS); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}, - () -> { - try { q.offerLast(null, 1L, HOURS); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}, - () -> { - try { q.putFirst(null); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}, - () -> { - try { q.putLast(null); } - catch (InterruptedException ex) { - throw new AssertionError(ex); - }}); + () -> q.offerFirst(null, 1L, HOURS), + () -> q.offerLast(null, 1L, HOURS), + () -> q.putFirst(null), + () -> q.putLast(null)); } } @@ -437,7 +413,6 @@ public class Collection8Test extends JSR if (rnd.nextBoolean()) assertTrue(it.hasNext()); it.next(); } - Consumer alwaysThrows = e -> { throw new AssertionError(); }; // TODO: many more removal methods if (rnd.nextBoolean()) { for (Iterator z = c.iterator(); z.hasNext(); ) { @@ -658,7 +633,6 @@ public class Collection8Test extends JSR */ public void testStreamForEach() throws Throwable { final Collection c = impl.emptyCollection(); - final AtomicLong count = new AtomicLong(0L); final Object x = impl.makeElement(1); final Object y = impl.makeElement(2); final ArrayList found = new ArrayList(); @@ -716,7 +690,6 @@ public class Collection8Test extends JSR */ public void testForEach() throws Throwable { final Collection c = impl.emptyCollection(); - final AtomicLong count = new AtomicLong(0L); final Object x = impl.makeElement(1); final Object y = impl.makeElement(2); final ArrayList found = new ArrayList(); @@ -952,7 +925,11 @@ public class Collection8Test extends JSR } catch (java.io.NotSerializableException acceptable) {} } - public void testReplaceAllIsNotStructuralModification() { + /** + * TODO: move out of limbo + * 8203662: remove increment of modCount from ArrayList and Vector replaceAll() + */ + public void DISABLED_testReplaceAllIsNotStructuralModification() { Collection c = impl.emptyCollection(); if (!(c instanceof List)) return;