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

Comparing jsr166/src/test/tck/NonNestmates.java (file contents):
Revision 1.3 by jsr166, Sat Oct 21 06:49:52 2017 UTC vs.
Revision 1.4 by dl, Tue Jan 26 13:33:06 2021 UTC

# Line 43 | Line 43 | class NonNestmates {
43      }
44  
45      public void checkPackageAccess(AtomicReferenceFieldUpdaterTest obj) {
46 <        Integer one = new Integer(1);
47 <        Integer two = new Integer(2);
46 >        Item one = new Item(1);
47 >        Item two = new Item(2);
48          obj.x = one;
49 <        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest,Integer> a =
49 >        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest,Item> a =
50              AtomicReferenceFieldUpdater.newUpdater(
51 <                AtomicReferenceFieldUpdaterTest.class, Integer.class, "x");
51 >                AtomicReferenceFieldUpdaterTest.class, Item.class, "x");
52          assertSame(one, a.get(obj));
53          assertTrue(a.compareAndSet(obj, one, two));
54          assertSame(two, a.get(obj));
# Line 162 | Line 162 | class NonNestmates {
162          }
163  
164          public void checkCompareAndSetProtectedSub() {
165 <            AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest,Integer> a =
165 >            AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest,Item> a =
166                  AtomicReferenceFieldUpdater.newUpdater(
167                      AtomicReferenceFieldUpdaterTest.class,
168 <                    Integer.class, "protectedField");
168 >                    Item.class, "protectedField");
169              this.protectedField = one;
170              assertTrue(a.compareAndSet(this, one, two));
171 <            assertTrue(a.compareAndSet(this, two, m4));
172 <            assertSame(m4, a.get(this));
173 <            assertFalse(a.compareAndSet(this, m5, seven));
171 >            assertTrue(a.compareAndSet(this, two, minusFour));
172 >            assertSame(minusFour, a.get(this));
173 >            assertFalse(a.compareAndSet(this, minusFive, seven));
174              assertNotSame(seven, a.get(this));
175 <            assertTrue(a.compareAndSet(this, m4, seven));
175 >            assertTrue(a.compareAndSet(this, minusFour, seven));
176              assertSame(seven, a.get(this));
177          }
178      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines