[lworld] RFR: 8287241: Add IdentityException to report that a value object is not valid

Roger Riggs rriggs at openjdk.java.net
Tue May 24 18:31:28 UTC 2022


Add class java.lang.IdentityException, when thrown indicates that an identity object was required but a value object was supplied.

Also add methods `java.util.Objects.requireIdentity(obj)` and `Objects.requireIdentity(obj, message)` to check and throw.

Updated java.lang.ref.Reference and related tests to use new exception and method.

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

Commit messages:
 - 8287241: Add IdentityException to report that a value object is not valid

Changes: https://git.openjdk.java.net/valhalla/pull/696/files
 Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=696&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8287241
  Stats: 123 lines in 4 files changed: 116 ins; 3 del; 4 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/696.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/696/head:pull/696

PR: https://git.openjdk.java.net/valhalla/pull/696



More information about the valhalla-dev mailing list