-
CSR
-
Resolution: Approved
-
P4
-
None
-
source, binary
-
low
-
-
Java API
-
SE
Summary
Update Swing classes to adopt the new sealed modifier, making sub-classes non-sealed of final as appropriate
Problem
There are a number of Swing classes which do not permit direct application sub-classing since they do not provide public or protected constructors, but it is not as clear as it could be if they permit just some sub-classes or are effectively final.
Solution
Update to use the new JEP 409 sealed and non-sealed modifiers to make the design intent clearer.
Specification
Update the following nested classes of javax.swing.GroupLayout as below
- public abstract class Group extends Spring + public abstract sealed class Group extends Spring + permits ParallelGroup, + SequentialGroup - public class SequentialGroup extends Group + public final class SequentialGroup extends Group - public class ParallelGroup extends Group + public sealed class ParallelGroup extends Group + permits BaselineGroup - private class BaselineGroup extends ParallelGroup + private final class BaselineGroup extends ParallelGroup
Update javax.swing.ToolTipManager
- public class ToolTipManager extends MouseAdapter implements MouseMotionListener + public final class ToolTipManager extends MouseAdapter implements MouseMotionListener
Update the following nested classes of javax.swing.plaf.basic.BasicSplitPaneUI
- public class BasicHorizontalLayoutManager implements LayoutManager2 + public sealed class BasicHorizontalLayoutManager implements LayoutManager2 + permits BasicVerticalLayoutManager - public class BasicVerticalLayoutManager extends + public non-sealed class BasicVerticalLayoutManager extends
Update javax.swing.text.StyleConstants and its following nested classes
- public class StyleConstants + public sealed class StyleConstants + permits StyleConstants.CharacterConstants, + StyleConstants.ColorConstants, + StyleConstants.FontConstants, + StyleConstants.ParagraphConstants - public static class ParagraphConstants extends StyleConstants + public static final class ParagraphConstants extends StyleConstants - public static class CharacterConstants extends StyleConstants + public static final class CharacterConstants extends StyleConstants - public static class ColorConstants extends StyleConstants + public static final class ColorConstants extends StyleConstants - public static class FontConstants extends StyleConstants + public static final class FontConstants extends StyleConstants
Update javax.swing.text.html.FormSubmitEvent to be final
- public class FormSubmitEvent extends HTMLFrameHyperlinkEvent + public final class FormSubmitEvent extends HTMLFrameHyperlinkEvent
Update nested classes of javax.swing.text.html.StyleSheet to be final
@SuppressWarnings("serial") // Same-version serialization only - public static class BoxPainter implements Serializable + public static final class BoxPainter implements Serializable @SuppressWarnings("serial") // Same-version serialization only - public static class ListPainter implements Serializable + public static final class ListPainter implements Serializable
- csr of
-
JDK-8283706 Add final or sealed modifier to appropriate javax.swing API classes
-
- Resolved
-