Summary
-------
Apply the sealed class modifer to java.awt.geom.Path2D
Problem
-------
java.awt.geom.Path2D allows only two direct sub-classes : Path2D.Float and Path2D.Double but this is not as clear as it could be.
Solution
--------
Use the new sealed class modifier to explicitly list the two allowed sub-classes.
This is safe since there are no public or protected constructors for Path2D.
However the sub-classes will need to be non-sealed since they do allow sub-classing.
Specification
-------------
java.awt.geom.Path2D
<pre>
- public abstract class Path2D implements Shape, Cloneable
+ public abstract sealed class Path2D implements Shape, Cloneable
+ permits Path2D.Double,
+ Path2D.Float
- public static class Float extends Path2D implements Serializable
+ public static non-sealed class Float extends Path2D implements Serializable
- public static class Double extends Path2D implements Serializable
+ public static non-sealed class Double extends Path2D implements Serializable
</pre>