Print this page


Split Close
Expand all
Collapse all
          --- old/test/java/util/concurrent/FutureTask/Customized.java
          +++ new/test/java/util/concurrent/FutureTask/Customized.java
↓ open down ↓ 195 lines elided ↑ open up ↑
 196  196      static void fail(String msg) {System.out.println(msg); fail();}
 197  197      static void unexpected(Throwable t) {failed++; t.printStackTrace();}
 198  198      static void check(boolean cond) {if (cond) pass(); else fail();}
 199  199      static void equal(Object x, Object y) {
 200  200          if (x == null ? y == null : x.equals(y)) pass();
 201  201          else fail(x + " not equal to " + y);}
 202  202      public static void main(String[] args) throws Throwable {
 203  203          try {realMain(args);} catch (Throwable t) {unexpected(t);}
 204  204          System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
 205  205          if (failed > 0) throw new AssertionError("Some tests failed");}
 206      -    private static abstract class Fun {abstract void f() throws Throwable;}
      206 +    private abstract static class Fun {abstract void f() throws Throwable;}
 207  207      static void THROWS(Class<? extends Throwable> k, Fun... fs) {
 208  208          for (Fun f : fs)
 209  209              try { f.f(); fail("Expected " + k.getName() + " not thrown"); }
 210  210              catch (Throwable t) {
 211  211                  if (k.isAssignableFrom(t.getClass())) pass();
 212  212                  else unexpected(t);}}
 213  213  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX