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.
Path2D can be sealed because no code outside the package can sub-class it directly. However the extant subclasses need to be made non-sealed as they can be sub-classed. jtreg tests and JCK API tests pass. CSR here : https://bugs.openjdk.java.net/browse/JDK-8284031 ------------- Commit messages: - 8283703: Add sealed modifier to java.awt.geom.Path2D Changes: https://git.openjdk.java.net/jdk/pull/8048/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8048&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8283703 Stats: 5 lines in 1 file changed: 2 ins; 0 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/8048.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/8048/head:pull/8048 PR: https://git.openjdk.java.net/jdk/pull/8048