RFR: 8283700: Add final or sealed modifier to appropriate java.awt API classes

Phil Race prr at openjdk.java.net
Mon Mar 28 16:38:12 UTC 2022


JDK 17 delivered JEP 409: Sealed Classes : https://openjdk.java.net/jeps/409
In essence this JEP allows a class to limit which classes can subclass it.
If a class has no subclasses and cannot be subclassed outside the JDK it can also be made final.
Suitable classes across the JDK are being retro-fitted to be sealed (or made final) where it can be done compatibly.
This fix takes care of several AWT classes which were identified.
If later we need to remove sealed or make a class non-final that will also be a compatible change,
so we aren't locking ourselves into this.

All our automated regression tests - plus JCK tests have been run.

This will require a CSR

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

Commit messages:
 - 8283700: Add final or sealed modifier to appropriate java.awt API classes

Changes: https://git.openjdk.java.net/jdk/pull/7998/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7998&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8283700
  Stats: 29 lines in 12 files changed: 17 ins; 0 del; 12 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7998.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7998/head:pull/7998

PR: https://git.openjdk.java.net/jdk/pull/7998



More information about the client-libs-dev mailing list