--- jsr166/src/test/tck/ThreadLocalTest.java 2014/12/31 19:05:43 1.15 +++ jsr166/src/test/tck/ThreadLocalTest.java 2021/01/27 01:57:24 1.19 @@ -11,27 +11,27 @@ import junit.framework.TestSuite; public class ThreadLocalTest extends JSR166TestCase { public static void main(String[] args) { - junit.textui.TestRunner.run(suite()); + main(suite(), args); } public static Test suite() { return new TestSuite(ThreadLocalTest.class); } - static ThreadLocal tl = new ThreadLocal() { - public Integer initialValue() { + static ThreadLocal tl = new ThreadLocal<>() { + public Item initialValue() { return one; } }; - static InheritableThreadLocal itl = - new InheritableThreadLocal() { - protected Integer initialValue() { + static InheritableThreadLocal itl = + new InheritableThreadLocal<>() { + protected Item initialValue() { return zero; } - protected Integer childValue(Integer parentValue) { - return new Integer(parentValue.intValue() + 1); + protected Item childValue(Item parentValue) { + return new Item(parentValue.intValue() + 1); } }; @@ -90,7 +90,7 @@ public class ThreadLocalTest extends JSR */ public void testGenericITL() throws InterruptedException { final int threadCount = 10; - final int x[] = new int[threadCount]; + final int[] x = new int[threadCount]; Thread progenitor = new ITLThread(x); progenitor.start(); progenitor.join();