Print this page


Split Close
Expand all
Collapse all
          --- old/test/java/util/concurrent/CopyOnWriteArrayList/EqualsRace.java
          +++ new/test/java/util/concurrent/CopyOnWriteArrayList/EqualsRace.java
↓ open down ↓ 58 lines elided ↑ open up ↑
  59   59      static void fail(String msg) {System.out.println(msg); fail();}
  60   60      static void unexpected(Throwable t) {failed++; t.printStackTrace();}
  61   61      static void check(boolean cond) {if (cond) pass(); else fail();}
  62   62      static void equal(Object x, Object y) {
  63   63          if (x == null ? y == null : x.equals(y)) pass();
  64   64          else fail(x + " not equal to " + y);}
  65   65      public static void main(String[] args) throws Throwable {
  66   66          try {realMain(args);} catch (Throwable t) {unexpected(t);}
  67   67          System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
  68   68          if (failed > 0) throw new AssertionError("Some tests failed");}
  69      -    private static abstract class CheckedThread extends Thread {
       69 +    private abstract static class CheckedThread extends Thread {
  70   70          public abstract void realRun() throws Throwable;
  71   71          public void run() {
  72   72              try { realRun(); } catch (Throwable t) { unexpected(t); }}}
  73   73  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX