Print this page


Split Close
Expand all
Collapse all
          --- old/test/java/util/concurrent/ScheduledThreadPoolExecutor/DelayOverflow.java
          +++ new/test/java/util/concurrent/ScheduledThreadPoolExecutor/DelayOverflow.java
↓ open down ↓ 153 lines elided ↑ open up ↑
 154  154      volatile int passed = 0, failed = 0;
 155  155      void pass() {passed++;}
 156  156      void fail() {failed++; Thread.dumpStack();}
 157  157      void fail(String msg) {System.err.println(msg); fail();}
 158  158      void unexpected(Throwable t) {failed++; t.printStackTrace();}
 159  159      void check(boolean cond) {if (cond) pass(); else fail();}
 160  160      void equal(Object x, Object y) {
 161  161          if (x == null ? y == null : x.equals(y)) pass();
 162  162          else fail(x + " not equal to " + y);}
 163  163      public static void main(String[] args) throws Throwable {
 164      -        Class<?> k = new Object(){}.getClass().getEnclosingClass();
 165      -        try {k.getMethod("instanceMain",String[].class)
 166      -                .invoke( k.newInstance(), (Object) args);}
 167      -        catch (Throwable e) {throw e.getCause();}}
 168      -    public void instanceMain(String[] args) throws Throwable {
      164 +        new DelayOverflow().instanceMain(args);}
      165 +    void instanceMain(String[] args) throws Throwable {
 169  166          try {test(args);} catch (Throwable t) {unexpected(t);}
 170  167          System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
 171  168          if (failed > 0) throw new AssertionError("Some tests failed");}
 172  169  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX