Update code in the package `sun.font` to make use of the `instanceof` pattern 
variable. Includes `equals` methods and a few methods using 
`ClassCastException` for flow control.

While looking through this code, I've noticed a few pre-existing suspicious 
differences between `equals` and `hashCode` implementations, but have not made 
any functional changes to fix this (best to address separately, if needed).

Tests checked locally on Linux, Windows and macOS:
- make test TEST="jtreg:test/jdk/java/awt/font"
- make test TEST="jtreg:test/jdk/java/awt/Graphics2D/DrawString"

---------
- [x] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

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

Commit messages:
 - Improve null safety a smidge
 - Update copyright year
 - Update package sun.font to use instanceof pattern variable

Changes: https://git.openjdk.org/jdk/pull/31702/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31702&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8387375
  Stats: 347 lines in 22 files changed: 20 ins; 123 del; 204 mod
  Patch: https://git.openjdk.org/jdk/pull/31702.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/31702/head:pull/31702

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

Reply via email to