Currently, the CAS operations of field instance/static var handles for null-restricted fields are failing with NPE because the type check includes a null check. Only perform the class check for these handles for the expected argument. ArrayVarHandle is already performing the right checks.
--------- - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - 8391817 Changes: https://git.openjdk.org/jdk/pull/32772/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32772&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8391817 Stats: 71 lines in 2 files changed: 55 ins; 0 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/32772.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/32772/head:pull/32772 PR: https://git.openjdk.org/jdk/pull/32772
