ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/jtreg/util/PriorityQueue/ForgetMeNot.java
(Generate patch)

Comparing jsr166/src/test/jtreg/util/PriorityQueue/ForgetMeNot.java (file contents):
Revision 1.3 by jsr166, Mon Sep 27 19:15:15 2010 UTC vs.
Revision 1.4 by jsr166, Tue Sep 15 07:17:15 2015 UTC

# Line 1 | Line 1
1   /*
2 < * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
2 > * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4   *
5   * This code is free software; you can redistribute it and/or modify it
# Line 37 | Line 37 | public class ForgetMeNot {
37  
38      private static void noMoreElements(final Iterator<Integer> it) {
39          for (int j = 0; j < 2; j++) {
40 <            THROWS(NoSuchElementException.class,
41 <                   new Fun() { void f() { it.next(); }});
40 >            THROWS(NoSuchElementException.class, () -> it.next());
41              check(! it.hasNext());
42          }
43      }
44  
45      private static void removeIsCurrentlyIllegal(final Iterator<Integer> it) {
46          for (int j = 0; j < 2; j++) {
47 <            THROWS(IllegalStateException.class,
49 <                   new Fun() { void f() { it.remove(); }});
47 >            THROWS(IllegalStateException.class, () -> it.remove());
48          }
49      }
50  
# Line 146 | Line 144 | public class ForgetMeNot {
144          try {realMain(args);} catch (Throwable t) {unexpected(t);}
145          System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
146          if (failed > 0) throw new AssertionError("Some tests failed");}
147 <    private abstract static class Fun {abstract void f() throws Throwable;}
147 >    interface Fun {void f() throws Throwable;}
148      static void THROWS(Class<? extends Throwable> k, Fun... fs) {
149          for (Fun f : fs)
150              try { f.f(); fail("Expected " + k.getName() + " not thrown"); }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines