ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/Collection8Test.java
(Generate patch)

Comparing jsr166/src/test/tck/Collection8Test.java (file contents):
Revision 1.56 by jsr166, Wed May 23 05:24:05 2018 UTC vs.
Revision 1.60 by jsr166, Mon Dec 16 21:22:33 2019 UTC

# Line 182 | Line 182 | public class Collection8Test extends JSR
182              () -> c.iterator().forEachRemaining(null),
183              () -> c.spliterator().forEachRemaining(null),
184              () -> c.spliterator().tryAdvance(null),
185 <            () -> c.toArray(null));
185 >            () -> c.toArray((Object[])null));
186  
187          if (!impl.permitsNulls()) {
188              assertThrows(
# Line 210 | Line 210 | public class Collection8Test extends JSR
210              BlockingQueue q = (BlockingQueue) c;
211              assertThrows(
212                  NullPointerException.class,
213 <                () -> {
214 <                    try { q.offer(null, 1L, HOURS); }
215 <                    catch (InterruptedException ex) {
216 <                        throw new AssertionError(ex);
217 <                    }},
218 <                () -> {
219 <                    try { q.put(null); }
220 <                    catch (InterruptedException ex) {
221 <                        throw new AssertionError(ex);
222 <                    }});
213 >                () -> q.offer(null, 1L, HOURS),
214 >                () -> q.put(null));
215          }
216          if (c instanceof BlockingDeque) {
217              BlockingDeque q = (BlockingDeque) c;
218              assertThrows(
219                  NullPointerException.class,
220 <                () -> {
221 <                    try { q.offerFirst(null, 1L, HOURS); }
222 <                    catch (InterruptedException ex) {
223 <                        throw new AssertionError(ex);
232 <                    }},
233 <                () -> {
234 <                    try { q.offerLast(null, 1L, HOURS); }
235 <                    catch (InterruptedException ex) {
236 <                        throw new AssertionError(ex);
237 <                    }},
238 <                () -> {
239 <                    try { q.putFirst(null); }
240 <                    catch (InterruptedException ex) {
241 <                        throw new AssertionError(ex);
242 <                    }},
243 <                () -> {
244 <                    try { q.putLast(null); }
245 <                    catch (InterruptedException ex) {
246 <                        throw new AssertionError(ex);
247 <                    }});
220 >                () -> q.offerFirst(null, 1L, HOURS),
221 >                () -> q.offerLast(null, 1L, HOURS),
222 >                () -> q.putFirst(null),
223 >                () -> q.putLast(null));
224          }
225      }
226  
# Line 437 | Line 413 | public class Collection8Test extends JSR
413              if (rnd.nextBoolean()) assertTrue(it.hasNext());
414              it.next();
415          }
440        Consumer alwaysThrows = e -> { throw new AssertionError(); };
416          // TODO: many more removal methods
417          if (rnd.nextBoolean()) {
418              for (Iterator z = c.iterator(); z.hasNext(); ) {
# Line 658 | Line 633 | public class Collection8Test extends JSR
633       */
634      public void testStreamForEach() throws Throwable {
635          final Collection c = impl.emptyCollection();
661        final AtomicLong count = new AtomicLong(0L);
636          final Object x = impl.makeElement(1);
637          final Object y = impl.makeElement(2);
638          final ArrayList found = new ArrayList();
# Line 716 | Line 690 | public class Collection8Test extends JSR
690       */
691      public void testForEach() throws Throwable {
692          final Collection c = impl.emptyCollection();
719        final AtomicLong count = new AtomicLong(0L);
693          final Object x = impl.makeElement(1);
694          final Object y = impl.makeElement(2);
695          final ArrayList found = new ArrayList();
# Line 952 | Line 925 | public class Collection8Test extends JSR
925          } catch (java.io.NotSerializableException acceptable) {}
926      }
927  
928 <    public void testReplaceAllIsNotStructuralModification() {
928 >    /**
929 >     * TODO: move out of limbo
930 >     * 8203662: remove increment of modCount from ArrayList and Vector replaceAll()
931 >     */
932 >    public void DISABLED_testReplaceAllIsNotStructuralModification() {
933          Collection c = impl.emptyCollection();
934          if (!(c instanceof List))
935              return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines