> com/sun/jdi/EATests.java synchronizes on an Integer instance. Although this 
> currently works, it is discouraged. See the following doc on value based 
> classes:
> 
> https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/doc-files/ValueBased.html
> 
> "Synchronization on instances of value-based classes is strongly discouraged, 
> because the programmer cannot guarantee exclusive ownership of the associated 
> monitor.
> 
> Identity-related behavior of value-based classes may change in a future 
> release. For example, synchronization may fail."
> 
> That second part is realized by Valhalla. The synchronization fails with:
> 
> `java.lang.IdentityException: Cannot synchronize on an instance of value 
> class java.lang.Integer`
> 
> Valhalla CR [JDK-8372831](https://bugs.openjdk.org/browse/JDK-8372831) covers 
> that failure, but I thought it best to address this in mainline first.
> 
> Tested with all of CI tier1, tier2 svc, and tier5 svc.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).
> 
> ---------
> - [ ] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Chris Plummer has updated the pull request incrementally with one additional 
commit since the last revision:

  remove @run test

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/30560/files
  - new: https://git.openjdk.org/jdk/pull/30560/files/9f7d4dc6..b33a59cf

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=30560&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30560&range=01-02

  Stats: 14 lines in 1 file changed: 0 ins; 14 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/30560.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30560/head:pull/30560

PR: https://git.openjdk.org/jdk/pull/30560

Reply via email to