On Thu, 13 Aug 2026 10:38:08 GMT, Alan Bateman <[email protected]> wrote:
>> Chen Liang has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains three additional >> commits since the last revision: >> >> - Test tweaks >> - Merge branch 'master' of https://github.com/openjdk/jdk into >> fix/atomic-ref-field-updater-value >> - 8388310 > > test/jdk/java/util/concurrent/atomic/AtomicReferenceFieldUpdaterValueObjectTest.java > line 91: > >> 89: assertSame(new Integer(-4), a.get(this)); >> 90: assertFalse(a.compareAndSet(this, new Integer(-5), new >> Integer(7))); >> 91: assertNotSame(new Integer(7), a.get(this)); > > You could repeat `assertSame(new Integer(-4), a.get(this))` here to check > that a failed CAS did not have any side effect. That keeps it separate from > what follows in this test. Good point, added an assertSame below this line. > test/jdk/java/util/concurrent/atomic/AtomicReferenceFieldUpdaterValueObjectTest.java > line 112: > >> 110: >> 111: assertTrue(a.compareAndSet(this, new Integer(1), new >> Integer(2))); >> 112: t.join(Utils.adjustTimeout(1000)); > > If you use join(Duration) here then it will return a boolean to indicate if > the thread terminated, would avoid needing isAlive. > > That said, I don't think you need a timeout here. It would be simpler to > using an untimed-join. Indeed, we can also drop the library dependency this way. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32325#discussion_r3798283470 PR Review Comment: https://git.openjdk.org/jdk/pull/32325#discussion_r3798285036
