Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8252021

Address reliance on default constructors in the javax.swing APIs

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 16
    • client-libs
    • None
    • source
    • minimal
    • Add explicit constructors equivalent to default constructors
    • Java API
    • SE

      Summary

      Add explicit constructors to API classes of javax.swing that have default constructors

      Problem

      Default constructors are not recommended for classes that are parts of a formal API.

      Solution

      Add explicit public no-arg constructors for public classes and protected no-arg constructor for public abstract classes.

      Specification

      --- old/src/java.desktop/share/classes/javax/swing/AbstractButton.java  2020-08-19 13:38:31.908720400 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/AbstractButton.java  2020-08-19 13:38:29.802996000 +0530
      @@ -236,6 +236,11 @@
           private boolean hideActionText = false;
      
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected AbstractButton() {}
      +
      +    /**
            * Sets the <code>hideActionText</code> property, which determines
            * whether the button displays text from the <code>Action</code>.
            * This is useful only if an <code>Action</code> has been
      --- old/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java  2020-08-19 13:38:44.644574500 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/AbstractCellEditor.java  2020-08-19 13:38:42.417337900 +0530
      @@ -62,6 +62,11 @@
            */
           protected transient ChangeEvent changeEvent = null;
      
      +    /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected AbstractCellEditor() {}
      +
           // Force this to be implemented.
           // public Object  getCellEditorValue()
      
      --- old/src/java.desktop/share/classes/javax/swing/AbstractListModel.java   2020-08-19 13:38:57.183130600 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/AbstractListModel.java   2020-08-19 13:38:55.114290600 +0530
      @@ -55,6 +55,10 @@
            */
           protected EventListenerList listenerList = new EventListenerList();
      
      +    /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected AbstractListModel() {}
      
           /**
            * Adds a listener to the list that's notified each time a change
      --- old/src/java.desktop/share/classes/javax/swing/AbstractSpinnerModel.java    2020-08-19 13:39:10.537865100 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/AbstractSpinnerModel.java    2020-08-19 13:39:08.368045100 +0530
      @@ -64,6 +64,10 @@
            */
           protected EventListenerList listenerList = new EventListenerList();
      
      +    /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected AbstractSpinnerModel() {}
      
           /**
            * Adds a ChangeListener to the model's listener list.  The
      --- old/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java   2020-08-19 13:39:23.452744800 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/DefaultDesktopManager.java   2020-08-19 13:39:21.081096900 +0530
      @@ -76,6 +76,11 @@
            */
           private transient boolean didDrag;
      
      +    /**
      +     * Constructs a {@code DefaultDesktopManager}.
      +     */
      +    public DefaultDesktopManager() {}
      +
           /** Normally this method will not be called. If it is, it
             * tries to determine the appropriate parent from the desktopIcon of the frame.
             * Will remove the desktopIcon from its parent if it successfully adds the frame.
      --- old/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java 2020-08-19 13:39:35.896232800 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java 2020-08-19 13:39:33.442200500 +0530
      @@ -351,5 +351,9 @@
           public static class UIResource extends DefaultListCellRenderer
               implements javax.swing.plaf.UIResource
           {
      +        /**
      +         * Constructs a {@code UIResource}.
      +         */
      +        public UIResource() {}
           }
       }
      --- old/src/java.desktop/share/classes/javax/swing/DefaultListModel.java    2020-08-19 13:39:48.132554100 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/DefaultListModel.java    2020-08-19 13:39:46.023376700 +0530
      @@ -58,6 +58,11 @@
           private Vector<E> delegate = new Vector<E>();
      
           /**
      +     * Constructs a {@code DefaultListModel}.
      +     */
      +    public DefaultListModel() {}
      +
      +    /**
            * Returns the number of components in this list.
            * <p>
            * This method is identical to {@code size}, which implements the
      --- old/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java   2020-08-19 13:40:01.004521400 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/DefaultListSelectionModel.java   2020-08-19 13:39:58.580135400 +0530
      @@ -78,6 +78,11 @@
            */
           protected boolean leadAnchorNotificationEnabled = true;
      
      +    /**
      +     * Constructs a {@code DefaultListSelectionModel}.
      +     */
      +    public DefaultListSelectionModel() {}
      +
           /** {@inheritDoc} */
           public int getMinSelectionIndex() { return isSelectionEmpty() ? -1 : minIndex; }
      
      --- old/src/java.desktop/share/classes/javax/swing/DefaultSingleSelectionModel.java 2020-08-19 13:40:15.062885900 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/DefaultSingleSelectionModel.java 2020-08-19 13:40:12.581486200 +0530
      @@ -59,6 +59,11 @@
           private int index = -1;
      
           /**
      +     * Constructs a {@code DefaultSingleSelectionModel}.
      +     */
      +    public DefaultSingleSelectionModel() {}
      +
      +    /**
            * {@inheritDoc}
            */
           public int getSelectedIndex() {
      --- old/src/java.desktop/share/classes/javax/swing/FocusManager.java    2020-08-19 13:40:33.663755300 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/FocusManager.java    2020-08-19 13:40:30.481403700 +0530
      @@ -65,6 +65,11 @@
           private static boolean enabled = true;
      
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected FocusManager() {}
      +
      +    /**
            * Returns the current <code>KeyboardFocusManager</code> instance
            * for the calling thread's context.
            *
      --- old/src/java.desktop/share/classes/javax/swing/InputVerifier.java   2020-08-19 13:40:47.662072500 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/InputVerifier.java   2020-08-19 13:40:45.537317300 +0530
      @@ -99,6 +99,11 @@
       public abstract class InputVerifier {
      
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected InputVerifier() {}
      +
      +    /**
            * Checks whether the JComponent's input is valid. This method should
            * have no side effects. It returns a boolean indicating the status
            * of the argument's input.
      --- old/src/java.desktop/share/classes/javax/swing/InternalFrameFocusTraversalPolicy.java   2020-08-19 13:41:00.966203500 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/InternalFrameFocusTraversalPolicy.java   2020-08-19 13:40:58.595364200 +0530
      @@ -42,6 +42,10 @@
       public abstract class InternalFrameFocusTraversalPolicy
           extends FocusTraversalPolicy
       {
      +    /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected InternalFrameFocusTraversalPolicy() {}
      
           /**
            * Returns the Component that should receive the focus when a
      --- old/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java 2020-08-19 13:41:13.637202700 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java 2020-08-19 13:41:11.572384900 +0530
      @@ -870,6 +870,11 @@
            */
           public abstract static class AbstractFormatterFactory {
               /**
      +         * Constructor for subclasses to call.
      +         */
      +        protected AbstractFormatterFactory() {}
      +
      +        /**
                * Returns an <code>AbstractFormatter</code> that can handle formatting
                * of the passed in <code>JFormattedTextField</code>.
                *
      @@ -915,6 +920,11 @@
               private JFormattedTextField ftf;
      
               /**
      +         * Constructor for subclasses to call.
      +         */
      +        protected AbstractFormatter() {}
      +
      +        /**
                * Installs the <code>AbstractFormatter</code> onto a particular
                * <code>JFormattedTextField</code>.
                * This will invoke <code>valueToString</code> to convert the
      --- old/src/java.desktop/share/classes/javax/swing/LookAndFeel.java 2020-08-19 13:41:26.024720500 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/LookAndFeel.java 2020-08-19 13:41:23.818024300 +0530
      @@ -151,6 +151,10 @@
        */
       public abstract class LookAndFeel
       {
      +    /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected LookAndFeel() {}
      
           /**
            * Convenience method for setting a component's foreground
      --- old/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java    2020-08-19 13:41:38.122153500 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/MenuSelectionManager.java    2020-08-19 13:41:36.044212700 +0530
      @@ -52,6 +52,11 @@
                              new StringBuilder("javax.swing.MenuSelectionManager");
      
           /**
      +     * Constructs a {@code MenuSelectionManager}.
      +     */
      +    public MenuSelectionManager() {}
      +
      +    /**
            * Returns the default menu selection manager.
            *
            * @return a MenuSelectionManager object
      --- old/src/java.desktop/share/classes/javax/swing/PopupFactory.java    2020-08-19 13:41:50.784686000 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/PopupFactory.java    2020-08-19 13:41:48.212379200 +0530
      @@ -115,6 +115,10 @@
            */
           private int popupType = LIGHT_WEIGHT_POPUP;
      
      +    /**
      +     * Constructs a {@code PopupFactory}.
      +     */
      +    public PopupFactory() {}
      
           /**
            * Sets the <code>PopupFactory</code> that will be used to obtain
      --- old/src/java.desktop/share/classes/javax/swing/RowFilter.java   2020-08-19 13:42:03.643804100 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/RowFilter.java   2020-08-19 13:42:01.122577600 +0530
      @@ -129,6 +129,11 @@
           }
      
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected RowFilter() {}
      +
      +    /**
            * Throws an IllegalArgumentException if any of the values in
            * columns are {@literal <} 0.
            */
      --- old/src/java.desktop/share/classes/javax/swing/ScrollPaneLayout.java    2020-08-19 13:42:18.124228900 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/ScrollPaneLayout.java    2020-08-19 13:42:15.696322700 +0530
      @@ -154,6 +154,10 @@
            */
           protected int hsbPolicy = HORIZONTAL_SCROLLBAR_AS_NEEDED;
      
      +    /**
      +     * Constructs a {@code ScrollPaneLayout}.
      +     */
      +    public ScrollPaneLayout() {}
      
           /**
            * This method is invoked after the ScrollPaneLayout is set as the
      @@ -1116,5 +1120,10 @@
           /**
            * The UI resource version of <code>ScrollPaneLayout</code>.
            */
      -    public static class UIResource extends ScrollPaneLayout implements javax.swing.plaf.UIResource {}
      +    public static class UIResource extends ScrollPaneLayout implements javax.swing.plaf.UIResource {
      +        /**
      +         * Constructs a {@code UIResource}.
      +         */
      +        public UIResource() {}
      +    }
       }
      --- old/src/java.desktop/share/classes/javax/swing/UIManager.java   2020-08-19 13:42:30.799514800 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/UIManager.java   2020-08-19 13:42:28.750321300 +0530
      @@ -235,6 +235,11 @@
           private static final Object classLock = new Object();
      
           /**
      +     * Constructs a {@code UIManager}.
      +     */
      +    public UIManager() {}
      +
      +    /**
            * Return the <code>LAFState</code> object, lazily create one if necessary.
            * All access to the <code>LAFState</code> fields is done via this method,
            * for example:
      --- old/src/java.desktop/share/classes/javax/swing/ViewportLayout.java  2020-08-19 13:42:43.385657600 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/ViewportLayout.java  2020-08-19 13:42:41.167560600 +0530
      @@ -64,6 +64,11 @@
           static ViewportLayout SHARED_INSTANCE = new ViewportLayout();
      
           /**
      +     * Constructs a {@code ViewportLayout}.
      +     */
      +    public ViewportLayout() {}
      +
      +    /**
            * Adds the specified component to the layout. Not used by this class.
            * @param name the name of the component
            * @param c the component to be added
      --- old/src/java.desktop/share/classes/javax/swing/border/AbstractBorder.java   2020-08-19 13:42:58.801705200 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/border/AbstractBorder.java   2020-08-19 13:42:56.523501200 +0530
      @@ -50,6 +50,11 @@
       public abstract class AbstractBorder implements Border, Serializable
       {
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected AbstractBorder() {}
      +
      +    /**
            * This default implementation does no painting.
            * @param c the component for which this border is being painted
            * @param g the paint graphics
      --- old/src/java.desktop/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java  2020-08-19 13:43:11.913209900 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java  2020-08-19 13:43:09.669832900 +0530
      @@ -74,6 +74,11 @@
           private JColorChooser chooser;
      
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected AbstractColorChooserPanel() {}
      +
      +    /**
             * Invoked automatically when the model's state changes.
             * It is also called by <code>installChooserPanel</code> to allow
             * you to set up the initial state of your chooser.
      --- old/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java 2020-08-19 13:43:24.585777500 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/event/EventListenerList.java 2020-08-19 13:43:22.125740000 +0530
      @@ -105,6 +105,11 @@
           protected transient volatile Object[] listenerList = NULL_ARRAY;
      
           /**
      +     * Constructs a {@code EventListenerList}.
      +     */
      +    public EventListenerList() {}
      +
      +    /**
            * Passes back the event listener list as an array
            * of ListenerType-listener pairs.  Note that for
            * performance reasons, this implementation passes back
      --- old/src/java.desktop/share/classes/javax/swing/event/InternalFrameAdapter.java  2020-08-19 13:43:37.140192100 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/event/InternalFrameAdapter.java  2020-08-19 13:43:34.906007200 +0530
      @@ -42,6 +42,11 @@
        */
       public abstract class InternalFrameAdapter implements InternalFrameListener {
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected InternalFrameAdapter() {}
      +
      +    /**
            * Invoked when an internal frame has been opened.
            */
           public void internalFrameOpened(InternalFrameEvent e) {}
      --- old/src/java.desktop/share/classes/javax/swing/event/MouseInputAdapter.java 2020-08-19 13:43:50.211518100 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/event/MouseInputAdapter.java 2020-08-19 13:43:47.711429200 +0530
      @@ -39,4 +39,8 @@
        */
       public abstract class MouseInputAdapter extends MouseAdapter
                                               implements MouseInputListener {
      +    /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected MouseInputAdapter() {}
       }
      --- old/src/java.desktop/share/classes/javax/swing/filechooser/FileFilter.java  2020-08-19 13:44:02.857215600 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/filechooser/FileFilter.java  2020-08-19 13:44:00.666226000 +0530
      @@ -50,6 +50,11 @@
        */
       public abstract class FileFilter {
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected FileFilter() {}
      +
      +    /**
            * Whether the given file is accepted by this filter.
            *
            * @param f the File to test
      --- old/src/java.desktop/share/classes/javax/swing/filechooser/FileView.java    2020-08-19 13:44:15.512320500 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/filechooser/FileView.java    2020-08-19 13:44:13.455569100 +0530
      @@ -67,6 +67,11 @@
        */
       public abstract class FileView {
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected FileView() {}
      +
      +    /**
            * The name of the file. Normally this would be simply
            * <code>f.getName()</code>.
            *
      --- old/src/java.desktop/share/classes/javax/swing/table/AbstractTableModel.java    2020-08-19 13:44:28.259764900 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/table/AbstractTableModel.java    2020-08-19 13:44:26.114664300 +0530
      @@ -67,6 +67,11 @@
           /** List of listeners */
           protected EventListenerList listenerList = new EventListenerList();
      
      +    /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected AbstractTableModel() {}
      +
       //
       // Default Implementation of the Interface
       //
      --- old/src/java.desktop/share/classes/javax/swing/table/DefaultTableCellRenderer.java  2020-08-19 13:44:40.607670100 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/table/DefaultTableCellRenderer.java  2020-08-19 13:44:38.435469300 +0530
      @@ -400,6 +400,10 @@
           public static class UIResource extends DefaultTableCellRenderer
               implements javax.swing.plaf.UIResource
           {
      +        /**
      +         * Constructs a {@code UIResource}.
      +         */
      +        public UIResource() {}
           }
      
       }
      --- old/src/java.desktop/share/classes/javax/swing/table/TableStringConverter.java  2020-08-19 13:44:53.727231000 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/table/TableStringConverter.java  2020-08-19 13:44:51.074466600 +0530
      @@ -33,6 +33,11 @@
        */
       public abstract class TableStringConverter {
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected TableStringConverter() {}
      +
      +    /**
            * Returns the string representation of the value at the specified
            * location.
            *
      --- old/src/java.desktop/share/classes/javax/swing/text/DefaultTextUI.java  2020-08-19 13:45:07.803714200 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/DefaultTextUI.java  2020-08-19 13:45:05.436890600 +0530
      @@ -37,6 +37,9 @@
        */
       @Deprecated
       public abstract class DefaultTextUI extends BasicTextUI {
      -
      +    /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected DefaultTextUI() {}
      
       }
      --- old/src/java.desktop/share/classes/javax/swing/text/DocumentFilter.java 2020-08-19 13:45:20.548443500 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/DocumentFilter.java 2020-08-19 13:45:18.243731400 +0530
      @@ -61,6 +61,11 @@
        */
       public class DocumentFilter {
           /**
      +     * Constructs a {@code DocumentFilter}.
      +     */
      +    public DocumentFilter() {}
      +
      +    /**
            * Invoked prior to removal of the specified region in the
            * specified Document. Subclasses that want to conditionally allow
            * removal should override this and only call supers implementation as
      @@ -131,6 +136,11 @@
            */
           public abstract static class FilterBypass {
               /**
      +         * Constructor for subclasses to call.
      +         */
      +        protected FilterBypass() {}
      +
      +        /**
                * Returns the Document the mutation is occurring on.
                *
                * @return Document that remove/insertString will operate on
      --- old/src/java.desktop/share/classes/javax/swing/text/FlowView.java   2020-08-19 13:45:33.059413800 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/FlowView.java   2020-08-19 13:45:30.984412400 +0530
      @@ -341,6 +341,11 @@
            * @since 1.3
            */
           public static class FlowStrategy {
      +        /**
      +         * Constructs a {@code FlowStrategy}.
      +         */
      +        public FlowStrategy() {}
      +
               Position damageStart = null;
               Vector<View> viewBuffer;
      
      --- old/src/java.desktop/share/classes/javax/swing/text/GlyphView.java  2020-08-19 13:45:45.513919900 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/GlyphView.java  2020-08-19 13:45:43.371330400 +0530
      @@ -1140,6 +1140,11 @@
           public abstract static class GlyphPainter {
      
               /**
      +         * Constructor for subclasses to call.
      +         */
      +        protected GlyphPainter() {}
      +
      +        /**
                * Determine the span the glyphs given a start location
                * (for tab expansion).
                * @param v  the {@code GlyphView}
      --- old/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java 2020-08-19 13:45:58.222810900 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/LayeredHighlighter.java 2020-08-19 13:45:56.114963600 +0530
      @@ -35,6 +35,11 @@
        */
       public abstract class LayeredHighlighter implements Highlighter {
           /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected LayeredHighlighter() {}
      +
      +    /**
            * When leaf Views (such as LabelView) are rendering they should
            * call into this method. If a highlight is in the given region it will
            * be drawn immediately.
      @@ -57,6 +62,11 @@
            */
           public abstract static class LayerPainter implements Highlighter.HighlightPainter {
               /**
      +         * Constructor for subclasses to call.
      +         */
      +        protected LayerPainter() {}
      +
      +        /**
                * @return a shape
                * @param g Graphics used to draw
                * @param p0 starting offset of view
      --- old/src/java.desktop/share/classes/javax/swing/text/NavigationFilter.java   2020-08-19 13:46:10.993575300 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/NavigationFilter.java   2020-08-19 13:46:08.795601700 +0530
      @@ -50,6 +50,11 @@
        */
       public class NavigationFilter {
           /**
      +     * Constructs a {@code NavigationFilter}.
      +     */
      +    public NavigationFilter() {}
      +
      +    /**
            * Invoked prior to the Caret setting the dot. The default implementation
            * calls directly into the <code>FilterBypass</code> with the passed
            * in arguments. Subclasses may wish to conditionally
      @@ -122,6 +127,11 @@
            */
           public abstract static class FilterBypass {
               /**
      +         * Constructor for subclasses to call.
      +         */
      +        protected FilterBypass() {}
      +
      +        /**
                * Returns the Caret that is changing.
                *
                * @return Caret that is changing
      --- old/src/java.desktop/share/classes/javax/swing/text/Utilities.java  2020-08-19 13:46:23.440604300 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/Utilities.java  2020-08-19 13:46:21.348230100 +0530
      @@ -50,6 +50,11 @@
        */
       public class Utilities {
           /**
      +     * Constructs a {@code Utilities}.
      +     */
      +    public Utilities() {}
      +
      +    /**
            * If <code>view</code>'s container is a <code>JComponent</code> it
            * is returned, after casting.
            */
      --- old/src/java.desktop/share/classes/javax/swing/text/html/HTML.java  2020-08-19 13:46:36.888359100 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/html/HTML.java  2020-08-19 13:46:34.112527500 +0530
      @@ -41,6 +41,11 @@
       public class HTML {
      
           /**
      +     * Constructs a {@code HTML}.
      +     */
      +    public HTML() {}
      +
      +    /**
            * Typesafe enumeration for an HTML tag.  Although the
            * set of HTML tags is a closed set, we have left the
            * set open so that people can add their own tag types
      --- old/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java  2020-08-19 13:46:49.431826700 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java  2020-08-19 13:46:46.897772300 +0530
      @@ -1889,6 +1889,11 @@
           public abstract static class Iterator {
      
               /**
      +         * Constructor for subclasses to call.
      +         */
      +        protected Iterator() {}
      +
      +        /**
                * Return the attributes for this tag.
                * @return the <code>AttributeSet</code> for this tag, or
                *      <code>null</code> if none can be found
      @@ -2966,6 +2971,10 @@
                * switch statement.
                */
               public class TagAction {
      +            /**
      +             * Constructs a {@code TagAction}.
      +             */
      +            public TagAction() {}
      
                   /**
                    * Called when a start tag is seen for the
      @@ -3000,6 +3009,10 @@
                * Action assigned by default to handle the Block task of the reader.
                */
               public class BlockAction extends TagAction {
      +            /**
      +             * Constructs a {@code BlockAction}.
      +             */
      +            public BlockAction() {}
      
                   public void start(HTML.Tag t, MutableAttributeSet attr) {
                       blockOpen(t, attr);
      @@ -3041,6 +3054,11 @@
                */
               public class ParagraphAction extends BlockAction {
      
      +            /**
      +             * Constructs a {@code ParagraphAction}.
      +             */
      +            public ParagraphAction() {}
      +
                   public void start(HTML.Tag t, MutableAttributeSet a) {
                       super.start(t, a);
                       inParagraph = true;
      @@ -3056,6 +3074,10 @@
                * Action assigned by default to handle the Special task of the reader.
                */
               public class SpecialAction extends TagAction {
      +            /**
      +             * Constructs a {@code SpecialAction}.
      +             */
      +            public SpecialAction() {}
      
                   public void start(HTML.Tag t, MutableAttributeSet a) {
                       addSpecialElement(t, a);
      @@ -3068,6 +3090,11 @@
                */
               public class IsindexAction extends TagAction {
      
      +            /**
      +             * Constructs a {@code IsindexAction}.
      +             */
      +            public IsindexAction() {}
      +
                   public void start(HTML.Tag t, MutableAttributeSet a) {
                       blockOpen(HTML.Tag.IMPLIED, new SimpleAttributeSet());
                       addSpecialElement(t, a);
      @@ -3082,6 +3109,11 @@
                */
               public class HiddenAction extends TagAction {
      
      +            /**
      +             * Constructs a {@code HiddenAction}.
      +             */
      +            public HiddenAction() {}
      +
                   public void start(HTML.Tag t, MutableAttributeSet a) {
                       addSpecialElement(t, a);
                   }
      @@ -3311,6 +3343,11 @@
                */
               public class PreAction extends BlockAction {
      
      +            /**
      +             * Constructs a {@code PreAction}.
      +             */
      +            public PreAction() {}
      +
                   public void start(HTML.Tag t, MutableAttributeSet attr) {
                       inPre = true;
                       blockOpen(t, attr);
      @@ -3332,6 +3369,11 @@
                */
               public class CharacterAction extends TagAction {
      
      +            /**
      +             * Constructs a {@code CharacterAction}.
      +             */
      +            public CharacterAction() {}
      +
                   public void start(HTML.Tag t, MutableAttributeSet attr) {
                       pushCharacterStyle();
                       if (!foundInsertTag) {
      @@ -3584,6 +3626,11 @@
                */
               public class FormAction extends SpecialAction {
      
      +            /**
      +             * Constructs a {@code FormAction}.
      +             */
      +            public FormAction() {}
      +
                   public void start(HTML.Tag t, MutableAttributeSet attr) {
                       if (t == HTML.Tag.INPUT) {
                           String type = (String)
      --- old/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java 2020-08-19 13:47:02.152518200 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java 2020-08-19 13:46:59.952555400 +0530
      @@ -675,6 +675,11 @@
               private int curOffset;
      
               /**
      +         * Constructs a {@code LinkController}.
      +         */
      +        public LinkController() {}
      +
      +        /**
                * Called for a mouse click event.
                * If the component is read-only (ie a browser) then
                * the clicked event is used to drive an attempt to
      @@ -990,6 +995,11 @@
            */
           public abstract static class Parser {
               /**
      +         * Constructor for subclasses to call.
      +         */
      +        protected Parser() {}
      +
      +        /**
                * Parse the given stream and drive the given callback
                * with the results of the parse.  This method should
                * be implemented to be thread-safe.
      @@ -1017,6 +1027,11 @@
            */
           public static class ParserCallback {
               /**
      +         * Constructs a {@code ParserCallback}.
      +         */
      +        public ParserCallback() {}
      +
      +        /**
                * This is passed as an attribute in the attributeset to indicate
                * the element is implied eg, the string '&lt;&gt;foo&lt;\t&gt;'
                * contains an implied html element and an implied body element.
      @@ -1236,6 +1251,10 @@
            * </table>
            */
           public static class HTMLFactory implements ViewFactory {
      +        /**
      +         * Constructs a {@code HTMLFactory}.
      +         */
      +        public HTMLFactory() {}
      
               /**
                * Creates a view from an element.
      --- old/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java    2020-08-19 13:47:18.628292900 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/tree/AbstractLayoutCache.java    2020-08-19 13:47:15.692403000 +0530
      @@ -64,6 +64,10 @@
             */
           protected int                rowHeight;
      
      +    /**
      +     * Constructor for subclasses to call.
      +     */
      +    protected AbstractLayoutCache() {}
      
           /**
            * Sets the renderer that is responsible for drawing nodes in the tree
      @@ -511,6 +515,11 @@
            */
           public abstract static class NodeDimensions {
               /**
      +         * Constructor for subclasses to call.
      +         */
      +        protected NodeDimensions() {}
      +
      +        /**
                * Returns, by reference in bounds, the size and x origin to
                * place value at. The calling method is responsible for determining
                * the Y location. If bounds is <code>null</code>, a newly created
      --- old/src/java.desktop/share/classes/javax/swing/undo/CannotRedoException.java    2020-08-19 13:47:31.868025100 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/undo/CannotRedoException.java    2020-08-19 13:47:29.765698600 +0530
      @@ -40,4 +40,8 @@
        */
       @SuppressWarnings("serial") // Same-version serialization only
       public class CannotRedoException extends RuntimeException {
      +    /**
      +     * Constructs a {@code CannotRedoException}.
      +     */
      +    public CannotRedoException() {}
       }
      --- old/src/java.desktop/share/classes/javax/swing/undo/CannotUndoException.java    2020-08-19 13:47:43.994836600 +0530
      +++ new/src/java.desktop/share/classes/javax/swing/undo/CannotUndoException.java    2020-08-19 13:47:41.923992200 +0530
      @@ -41,4 +41,8 @@
        */
       @SuppressWarnings("serial") // Same-version serialization only
       public class CannotUndoException extends RuntimeException {
      +    /**
      +     * Constructs a {@code CannotUndoException}.
      +     */
      +    public CannotUndoException() {}
       }
      --- old/src/jdk.unsupported.desktop/share/classes/jdk/swing/interop/SwingInterOpUtils.java  2020-08-19 13:47:56.623746600 +0530
      +++ new/src/jdk.unsupported.desktop/share/classes/jdk/swing/interop/SwingInterOpUtils.java  2020-08-19 13:47:54.494092100 +0530
      @@ -41,6 +41,11 @@
        */
       public class SwingInterOpUtils {
      
      +    /**
      +     * Constructs a {@code SwingInterOpUtils}.
      +     */
      +    public SwingInterOpUtils() {}
      +
           public static void postEvent(Object target, java.awt.AWTEvent e) {
               AppContext context = SunToolkit.targetToAppContext(target);
               if (context != null) {

            psadhukhan Prasanta Sadhukhan
            prr Philip Race
            Sergey Bylokhov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: