On Wed, 30 Sep 2026 14:55:44 GMT, Aleksey Shipilev <[email protected]> wrote:

> Our automatic post-integration audits found that 
> [JDK-8391651](https://bugs.openjdk.org/browse/JDK-8391651) missed the spot. 
> It fixed the compareAndSetFlatValueAsBytes (CAS) case, but missed 
> compareAndExchangeFlatValue (CAE) case.
> 
> A symmetric test case readily fails without the fix. I just copied the CAS 
> test and replaced call with CAE.
> 
> Additional testing:
>  - [x] New regression test fails without the fix, passes with it
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Fix looks good. You missed a couple of edits in the test copy.

test/hotspot/jtreg/runtime/valhalla/inlinetypes/VarHandleCAEOfEmptyClass.java 
line 32:

> 30: /*
> 31:  * @test VarHandleCAEOfEmptyClass
> 32:  * @summary VarHandle compareAndSet can handle empty value classes

Suggestion:

 * @summary VarHandle compareAndExchange can handle empty value classes

test/hotspot/jtreg/runtime/valhalla/inlinetypes/VarHandleCAEOfEmptyClass.java 
line 49:

> 47:         VarHandle handle = 
> MethodHandles.lookup().findVarHandle(Holder.class, "value", Empty.class);
> 48:         if (handle.compareAndExchange(new Holder(), null, new Empty()) != 
> null) {
> 49:             throw new RuntimeException("compareAndSet failed");

Suggestion:

            throw new RuntimeException("compareAndExchange failed");

-------------

Changes requested by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/33150#pullrequestreview-5375380595
PR Review Comment: https://git.openjdk.org/jdk/pull/33150#discussion_r4152195278
PR Review Comment: https://git.openjdk.org/jdk/pull/33150#discussion_r4152198761

Reply via email to