Print this page


Split Close
Expand all
Collapse all
          --- old/test/java/util/concurrent/CopyOnWriteArraySet/RacingCows.java
          +++ new/test/java/util/concurrent/CopyOnWriteArraySet/RacingCows.java
↓ open down ↓ 117 lines elided ↑ open up ↑
 118  118      static void fail(String msg) {System.out.println(msg); fail();}
 119  119      static void unexpected(Throwable t) {failed++; t.printStackTrace();}
 120  120      static void check(boolean cond) {if (cond) pass(); else fail();}
 121  121      static void equal(Object x, Object y) {
 122  122          if (x == null ? y == null : x.equals(y)) pass();
 123  123          else fail(x + " not equal to " + y);}
 124  124      public static void main(String[] args) throws Throwable {
 125  125          try {realMain(args);} catch (Throwable t) {unexpected(t);}
 126  126          System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
 127  127          if (failed > 0) throw new AssertionError("Some tests failed");}
 128      -    private static abstract class CheckedThread extends Thread {
      128 +    private abstract static class CheckedThread extends Thread {
 129  129          public abstract void realRun() throws Throwable;
 130  130          public void run() {
 131  131              try { realRun(); } catch (Throwable t) { unexpected(t); }}}
 132  132  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX