ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/ThreadLocalTest.java
(Generate patch)

Comparing jsr166/src/test/tck/ThreadLocalTest.java (file contents):
Revision 1.14 by jsr166, Wed Dec 31 16:44:02 2014 UTC vs.
Revision 1.19 by jsr166, Wed Jan 27 01:57:24 2021 UTC

# Line 6 | Line 6
6   * Pat Fisher, Mike Judd.
7   */
8  
9 < import junit.framework.*;
9 > import junit.framework.Test;
10 > import junit.framework.TestSuite;
11  
12   public class ThreadLocalTest extends JSR166TestCase {
13      public static void main(String[] args) {
14 <        junit.textui.TestRunner.run(suite());
14 >        main(suite(), args);
15      }
16  
17      public static Test suite() {
18          return new TestSuite(ThreadLocalTest.class);
19      }
20  
21 <    static ThreadLocal<Integer> tl = new ThreadLocal<Integer>() {
22 <            public Integer initialValue() {
21 >    static ThreadLocal<Item> tl = new ThreadLocal<>() {
22 >            public Item initialValue() {
23                  return one;
24              }
25          };
26  
27 <    static InheritableThreadLocal<Integer> itl =
28 <        new InheritableThreadLocal<Integer>() {
29 <            protected Integer initialValue() {
27 >    static InheritableThreadLocal<Item> itl =
28 >        new InheritableThreadLocal<>() {
29 >            protected Item initialValue() {
30                  return zero;
31              }
32  
33 <            protected Integer childValue(Integer parentValue) {
34 <                return new Integer(parentValue.intValue() + 1);
33 >            protected Item childValue(Item parentValue) {
34 >                return new Item(parentValue.intValue() + 1);
35              }
36          };
37  
# Line 89 | Line 90 | public class ThreadLocalTest extends JSR
90       */
91      public void testGenericITL() throws InterruptedException {
92          final int threadCount = 10;
93 <        final int x[] = new int[threadCount];
93 >        final int[] x = new int[threadCount];
94          Thread progenitor = new ITLThread(x);
95          progenitor.start();
96          progenitor.join();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines