Uploaded image for project: 'CCC Migration Project'
  1. CCC Migration Project
  2. CCC-8043548

Fix raw and unchecked lint warnings in javax.swing.plaf.*

    XMLWordPrintable

Details

    • source
    • low
    • Usual generification exercise. Will monitor feedback on the changes during JDK 9 development and adjust if necessary.
    • Java API
    • SE

    Description

      Summary

      Generify portions of the javax.swing.plaf package.

      Problem

      Various rawtypes warnings in javax.swing.plaf.* are due to the API not being generified.

      Solution

      Generify javax.swing.plaf.* according to the usual JDK policies.

      Specification

      UPDATE: one change was omitted from the previously approved version of the ccc request:

      javax.swing.plaf.basic.BasicListUI:
      method:
      paintCell(Graphics,int,Rectangle,ListCellRenderer,ListModel,ListSelectionModel,int)
      
      is changed to:
      paintCell(Graphics,int,Rectangle,ListCellRenderer<java.lang.Object>,ListModel<Object>,ListSelectionModel,int)
      
      src/share/classes/javax/swing/JSlider.java
      
      @@ -791,11 +791,11 @@
            * Returns the dictionary of what labels to draw at which values.
            *
            * @return the <code>Dictionary</code> containing labels and
            *    where to draw them
            */
      -    public Dictionary getLabelTable() {
      +    public Dictionary<Integer, JComponent> getLabelTable() {
       /*
               if ( labelTable == null && getMajorTickSpacing() > 0 ) {
                   setLabelTable( createStandardLabels( getMajorTickSpacing() ) );
               }
       */
      
      @@ -824,12 +824,12 @@
            *       hidden: true
            *        bound: true
            *    attribute: visualUpdate true
            *  description: Specifies what labels will be drawn for any given value.
            */
      -    public void setLabelTable( Dictionary labels ) {
      -        Dictionary oldTable = labelTable;
      +    public void setLabelTable( Dictionary<Integer, JComponent> labels ) {
      +        Dictionary<Integer, JComponent> oldTable = labelTable;
               labelTable = labels;
               updateLabelUIs();
               firePropertyChange("labelTable", oldTable, labelTable );
               if (labels != oldTable) {
                   revalidate();
      
      @@ -892,11 +892,11 @@
            * @see #setLabelTable
            * @see #setPaintLabels
            * @throws IllegalArgumentException if {@code increment} is less than or
            *          equal to zero
            */
      -    public Hashtable createStandardLabels( int increment ) {
      +    public Hashtable<Integer, JComponent> createStandardLabels( int increment ) {
               return createStandardLabels( increment, getMinimum() );
           }
       
       
           /**
      
      @@ -920,20 +920,20 @@
            * @see #setPaintLabels
            * @exception IllegalArgumentException if {@code start} is
            *          out of range, or if {@code increment} is less than or equal
            *          to zero
            */
      -    public Hashtable createStandardLabels( int increment, int start ) {
      +    public Hashtable<Integer, JComponent> createStandardLabels( int increment, int start ) {
               if ( start > getMaximum() || start < getMinimum() ) {
                   throw new IllegalArgumentException( "Slider label start point out of range." );
               }
       
               if ( increment <= 0 ) {
                   throw new IllegalArgumentException( "Label incremement must be > 0" );
               }
      
      
      --- old/src/share/classes/javax/swing/plaf/ComboBoxUI.java    2014-06-25 15:48:29.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/ComboBoxUI.java    2014-06-25 15:48:29.000000000 -0700
      @@ -38,15 +38,15 @@
           /**
            * Set the visibility of the popup
            */
      -    public abstract void setPopupVisible( JComboBox c, boolean v );
      +    public abstract void setPopupVisible( JComboBox<?> c, boolean v );
       
           /**
            * Determine the visibility of the popup
            */
      -    public abstract boolean isPopupVisible( JComboBox c );
      +    public abstract boolean isPopupVisible( JComboBox<?> c );
       
           /**
            * Determine whether or not the combo box itself is traversable
            */
      -    public abstract boolean isFocusTraversable( JComboBox c );
      +    public abstract boolean isFocusTraversable( JComboBox<?> c );
       }
      
      --- old/src/share/classes/javax/swing/plaf/ListUI.java    2014-06-25 15:48:30.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/ListUI.java    2014-06-25 15:48:30.000000000 -0700
      @@ -50,7 +50,7 @@
            * @return the cell index closest to the given location, or {@code -1}
            * @throws NullPointerException if {@code location} is null
            */
      -    public abstract int locationToIndex(JList list, Point location);
      +    public abstract int locationToIndex(JList<?> list, Point location);
       
       
           /**
      @@ -62,7 +62,7 @@
            * @param index the cell index
            * @return the origin of the cell, or {@code null}
            */
      -    public abstract Point indexToLocation(JList list, int index);
      +    public abstract Point indexToLocation(JList<?> list, int index);
       
       
           /**
      @@ -80,5 +80,5 @@
            * @param index2 the second index in the range
            * @return the bounding rectangle for the range of cells, or {@code null}
            */
      -    public abstract Rectangle getCellBounds(JList list, int index1, int index2);
      +    public abstract Rectangle getCellBounds(JList<?> list, int index1, int index2);
       }
      
      --- old/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java    2014-06-25 15:48:31.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java    2014-06-25 15:48:31.000000000 -0700
      @@ -49,7 +49,7 @@
        */
       @SuppressWarnings("serial") // Same-version serialization only
       public class BasicComboBoxRenderer extends JLabel
      -implements ListCellRenderer, Serializable {
      +implements ListCellRenderer<Object>, Serializable {
       
          /**
           * An empty <code>Border</code>. This field might not be used. To change the
      @@ -89,7 +89,7 @@
           }
       
           public Component getListCellRendererComponent(
      -                                                 JList list,
      +                                                 JList<? extends Object> list,
                                                        Object value,
                                                        int index,
                                                        boolean isSelected,
      
      --- old/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java    2014-06-25 15:48:32.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java    2014-06-25 15:48:32.000000000 -0700
      @@ -61,7 +61,7 @@
        * @author Mark Davidson
        */
       public class BasicComboBoxUI extends ComboBoxUI {
      -    protected JComboBox comboBox;
      +    protected JComboBox<Object> comboBox;
           /**
            * This protected field is implementation specific. Do not access directly
            * or override.
      @@ -74,7 +74,7 @@
           private static final String IS_TABLE_CELL_EDITOR = "JComboBox.isTableCellEditor";
       
           // This list is for drawing the current item in the combo box.
      -    protected JList   listBox;
      +    protected JList<Object>   listBox;
       
           // Used to render the currently selected item in the combo box.
           // It doesn't have anything to do with the popup's rendering.
      
      @@ -508,7 +511,7 @@
            * @return a <code>ListCellRender</code> used for the combo box
            * @see javax.swing.JComboBox#setRenderer
            */
      -    protected ListCellRenderer createRenderer() {
      +    protected ListCellRenderer<Object> createRenderer() {
               return new BasicComboBoxRenderer.UIResource();
           }
       
      @@ -865,14 +868,14 @@
           /**
            * Tells if the popup is visible or not.
            */
      -    public boolean isPopupVisible( JComboBox c ) {
      +    public boolean isPopupVisible( JComboBox<?> c ) {
               return popup.isVisible();
           }
       
           /**
            * Hides the popup.
            */
      -    public void setPopupVisible( JComboBox c, boolean v ) {
      +    public void setPopupVisible( JComboBox<?> c, boolean v ) {
               if ( v ) {
                   popup.show();
               } else {
      @@ -884,7 +887,7 @@
            * Determines if the JComboBox is focus traversable.  If the JComboBox is editable
            * this returns false, otherwise it returns true.
            */
      -    public boolean isFocusTraversable( JComboBox c ) {
      +    public boolean isFocusTraversable( JComboBox<?> c ) {
               return !comboBox.isEditable();
           }
       
      @@ -1205,7 +1208,7 @@
            * Paints the currently selected item.
            */
           public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) {
      -        ListCellRenderer renderer = comboBox.getRenderer();
      +        ListCellRenderer<Object> renderer = comboBox.getRenderer();
               Component c;
      
      @@ -1959,7 +1967,7 @@
               private String prefix = "";
               private String typedString = "";
       
      -        public int selectionForKey(char aKey,ComboBoxModel aModel) {
      +        public int selectionForKey(char aKey,ComboBoxModel<?> aModel) {
                   if (lastTime == 0L) {
                       prefix = "";
                       typedString = "";
      --- old/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java    2014-06-25 15:48:33.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java    2014-06-25 15:48:32.000000000 -0700
      @@ -71,11 +71,11 @@
               public void removeListDataListener(ListDataListener l) {}
           };
       
      -    static final ListModel EmptyListModel = new EmptyListModelClass();
      +    static final ListModel<Object> EmptyListModel = new EmptyListModelClass();
       
           private static Border LIST_BORDER = new LineBorder(Color.BLACK, 1);
       
      -    protected JComboBox                comboBox;
      +    protected JComboBox<Object>             comboBox;
           /**
            * This protected field is implementation specific. Do not access directly
            * or override. Use the accessor methods instead.
      @@ -83,7 +83,7 @@
            * @see #getList
            * @see #createList
            */
      -    protected JList                    list;
      +    protected JList<Object>                 list;
           /**
            * This protected field is implementation specific. Do not access directly
            * or override. Use the create method instead
      @@ -229,7 +229,7 @@
           /**
            * Implementation of ComboPopup.getList().
            */
      -    public JList getList() {
      +    public JList<Object> getList() {
               return list;
           }
       
      @@ -303,7 +303,7 @@
            * @param model The combo box model to install listeners
            * @see #installComboBoxModelListeners
            */
      -    protected void uninstallComboBoxModelListeners( ComboBoxModel model ) {
      +    protected void uninstallComboBoxModelListeners( ComboBoxModel<?> model ) {
               if (model != null && listDataListener != null) {
                   model.removeListDataListener(listDataListener);
               }
      @@ -319,7 +319,7 @@
           //===================================================================
           // begin Initialization routines
           //
      -    public BasicComboPopup( JComboBox combo ) {
      +    public BasicComboPopup( JComboBox<Object> combo ) {
               super();
               setName("ComboPopup.popup");
               comboBox = combo;
      @@ -481,8 +481,8 @@
            *
            * @return a <code>JList</code> used to display the combo box items
            */
      -    protected JList createList() {
      -        return new JList( comboBox.getModel() ) {
      +    protected JList<Object> createList() {
      +        return new JList<Object>( comboBox.getModel() ) {
                   public void processMouseEvent(MouseEvent e)  {
                       if (BasicGraphicsUtils.isMenuShortcutKeyDown(e))  {
                           // Fix for 4234053. Filter out the Control Key from the list.
      @@ -610,7 +610,7 @@
            * @param model The combo box model to install listeners
            * @see #uninstallComboBoxModelListeners
            */
      -    protected void installComboBoxModelListeners( ComboBoxModel model ) {
      +    protected void installComboBoxModelListeners( ComboBoxModel<?> model ) {
               if (model != null && (listDataListener = createListDataListener()) != null) {
                   model.addListDataListener(listDataListener);
               }
      
      --- old/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java    2014-06-25 15:48:34.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java    2014-06-25 15:48:34.000000000 -0700
      @@ -436,7 +436,7 @@
           }
       
           protected MouseListener createDoubleClickListener(JFileChooser fc,
      -                                                      JList list) {
      +                                                      JList<?> list) {
               return new Handler(list);
           }
       @@ -570,7 +571,7 @@
               // new functionality add it to the Handler, but make sure this
               // class calls into the Handler.
               Handler handler;
      -        public  DoubleClickListener(JList list) {
      +        public  DoubleClickListener(JList<?> list) {
                   handler = new Handler(list);
               }
       
      --- old/src/share/classes/javax/swing/plaf/basic/BasicListUI.java    2014-06-25 15:48:34.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/basic/BasicListUI.java    2014-06-25 15:48:34.000000000 -0700
      @@ -59,7 +59,7 @@
           private static final StringBuilder BASELINE_COMPONENT_KEY =
               new StringBuilder("List.baselineComponent");
       
      -    protected JList list = null;
      +    protected JList<Object> list = null;
           protected CellRendererPane rendererPane;
       
           // Listeners that this UI attaches to the JList
      @@ -925,7 +930,7 @@
            * {@inheritDoc}
            * @throws NullPointerException {@inheritDoc}
            */
      -    public int locationToIndex(JList list, Point location) {
      +    public int locationToIndex(JList<?> list, Point location) {
               maybeUpdateLayoutState();
               return convertLocationToModel(location.x, location.y);
           }
      @@ -934,7 +939,7 @@
           /**
            * {@inheritDoc}
            */
      -    public Point indexToLocation(JList list, int index) {
      +    public Point indexToLocation(JList<?> list, int index) {
               maybeUpdateLayoutState();
               Rectangle rect = getCellBounds(list, index, index);
       
      @@ -948,7 +953,7 @@
           /**
            * {@inheritDoc}
            */
      -    public Rectangle getCellBounds(JList list, int index1, int index2) {
      +    public Rectangle getCellBounds(JList<?> list, int index1, int index2) {
               maybeUpdateLayoutState();
       
               int minIndex = Math.min(index1, index2);
      
      --- old/src/share/classes/javax/swing/plaf/basic/ComboPopup.java    2014-06-25 15:48:41.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/basic/ComboPopup.java    2014-06-25 15:48:41.000000000 -0700
      @@ -70,7 +70,7 @@
            * This method is highly implementation specific and should not be used
            * for general list manipulation.
            */
      -    public JList getList();
      +    public JList<Object> getList();
       
           /**
            * Returns a mouse listener that will be added to the combo box or null.
      
      --- old/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java    2014-06-25 15:48:43.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java    2014-06-25 15:48:42.000000000 -0700
      @@ -50,14 +50,14 @@
        */
       @SuppressWarnings("serial") // Same-version serialization only
       public class MetalComboBoxButton extends JButton {
      -    protected JComboBox comboBox;
      -    protected JList listBox;
      +    protected JComboBox<Object> comboBox;
      +    protected JList<Object> listBox;
           protected CellRendererPane rendererPane;
           protected Icon comboIcon;
           protected boolean iconOnly = false;
       
      -    public final JComboBox getComboBox() { return comboBox;}
      -    public final void setComboBox( JComboBox cb ) { comboBox = cb;}
      +    public final JComboBox<Object> getComboBox() { return comboBox;}
      +    public final void setComboBox( JComboBox<Object> cb ) { comboBox = cb;}
       
           public final Icon getComboIcon() { return comboIcon;}
           public final void setComboIcon( Icon i ) { comboIcon = i;}
      @@ -75,8 +75,8 @@
               setModel( model );
           }
       
      -    public MetalComboBoxButton( JComboBox cb, Icon i,
      -                                CellRendererPane pane, JList list ) {
      +    public MetalComboBoxButton( JComboBox<Object> cb, Icon i,
      +                                CellRendererPane pane, JList<Object> list ) {
               this();
               comboBox = cb;
               comboIcon = i;
      @@ -85,8 +85,8 @@
               setEnabled( comboBox.isEnabled() );
           }
       
      -    public MetalComboBoxButton( JComboBox cb, Icon i, boolean onlyIcon,
      -                                CellRendererPane pane, JList list ) {
      +    public MetalComboBoxButton( JComboBox<Object> cb, Icon i, boolean onlyIcon,
      +                                CellRendererPane pane, JList<Object> list ) {
               this( cb, i, pane, list );
               iconOnly = onlyIcon;
           }
      --- old/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java    2014-06-25 15:48:43.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java    2014-06-25 15:48:43.000000000 -0700
      @@ -367,7 +367,7 @@
           @Deprecated
           public class MetalComboPopup extends BasicComboPopup {
       
      -        public MetalComboPopup( JComboBox cBox) {
      +        public MetalComboPopup( JComboBox<Object> cBox) {
                   super( cBox );
               }
       
      --- old/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java    2014-06-25 15:48:44.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java    2014-06-25 15:48:44.000000000 -0700
      @@ -196,7 +196,7 @@
                   return MetalFileChooserUI.this.getNewFolderAction();
               }
       
      -        public MouseListener createDoubleClickListener(JList list) {
      +        public MouseListener createDoubleClickListener(JList<?> list) {
                   return MetalFileChooserUI.this.createDoubleClickListener(getFileChooser(),
                                                                            list);
               }
      @@ -533,7 +533,7 @@
       
           // Obsolete class, not used in this version.
           protected class SingleClickListener extends MouseAdapter {
      -        public  SingleClickListener(JList list) {
      +        public  SingleClickListener(JList<?> list) {
               }
           }
      
      @@ -1051,7 +1051,7 @@
            */
           @SuppressWarnings("serial") // Superclass is not serializable across versions
           public class FilterComboBoxRenderer extends DefaultListCellRenderer {
      -        public Component getListCellRendererComponent(JList list,
      +        public Component getListCellRendererComponent(JList<?> list,
                   Object value, int index, boolean isSelected,
                   boolean cellHasFocus) {
      
      --- old/src/share/classes/javax/swing/plaf/metal/MetalUtils.java    2014-06-25 15:48:45.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/metal/MetalUtils.java    2014-06-25 15:48:45.000000000 -0700
      @@ -251,7 +252,7 @@
               }
       
               public void paint(Component c, Graphics2D g,
      -                          java.util.List gradient, int x, int y, int w,
      +                          java.util.List<?> gradient, int x, int y, int w,
                                 int h, boolean isVertical) {
                   int imageWidth;
                   int imageHeight;
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiButtonUI.java    2014-06-25 15:48:46.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiButtonUI.java    2014-06-25 15:48:46.000000000 -0700
      @@ -47,7 +47,7 @@
            * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
            * obtained from the default look and feel.
            */
      -    protected Vector uis = new Vector();
      +    protected Vector<ComponentUI> uis = new Vector<>();
       
       ////////////////////
       // Common UI methods
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiColorChooserUI.java    2014-06-25 15:48:47.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiColorChooserUI.java    2014-06-25 15:48:46.000000000 -0700
      @@ -47,7 +47,7 @@
            * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
            * obtained from the default look and feel.
            */
      -    protected Vector uis = new Vector();
      +    protected Vector<ComponentUI> uis = new Vector<>();
       
       ////////////////////
       // Common UI methods
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiComboBoxUI.java    2014-06-25 15:48:47.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiComboBoxUI.java    2014-06-25 15:48:47.000000000 -0700
      @@ -48,7 +48,7 @@
            * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
            * obtained from the default look and feel.
            */
      -    protected Vector uis = new Vector();
      +    protected Vector<ComponentUI> uis = new Vector<>();
       
       ////////////////////
       // Common UI methods
      @@ -75,7 +75,7 @@
            * @return the value obtained from the first UI, which is
            * the UI obtained from the default <code>LookAndFeel</code>
            */
      -    public boolean isFocusTraversable(JComboBox a) {
      +    public boolean isFocusTraversable(JComboBox<?> a) {
               boolean returnValue =
                   ((ComboBoxUI) (uis.elementAt(0))).isFocusTraversable(a);
               for (int i = 1; i < uis.size(); i++) {
      @@ -87,7 +87,7 @@
           /**
            * Invokes the <code>setPopupVisible</code> method on each UI handled by this object.
            */
      -    public void setPopupVisible(JComboBox a, boolean b) {
      +    public void setPopupVisible(JComboBox<?> a, boolean b) {
               for (int i = 0; i < uis.size(); i++) {
                   ((ComboBoxUI) (uis.elementAt(i))).setPopupVisible(a,b);
               }
      @@ -99,7 +99,7 @@
            * @return the value obtained from the first UI, which is
            * the UI obtained from the default <code>LookAndFeel</code>
            */
      -    public boolean isPopupVisible(JComboBox a) {
      +    public boolean isPopupVisible(JComboBox<?> a) {
               boolean returnValue =
                   ((ComboBoxUI) (uis.elementAt(0))).isPopupVisible(a);
               for (int i = 1; i < uis.size(); i++) {
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiDesktopIconUI.java    2014-06-25 15:48:48.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiDesktopIconUI.java    2014-06-25 15:48:48.000000000 -0700
      @@ -47,7 +47,7 @@
            * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
            * obtained from the default look and feel.
            */
      -    protected Vector uis = new Vector();
      +    protected Vector<ComponentUI> uis = new Vector<>();
       
       ////////////////////
       // Common UI methods
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiDesktopPaneUI.java    2014-06-25 15:48:48.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiDesktopPaneUI.java    2014-06-25 15:48:48.000000000 -0700
      @@ -47,7 +47,7 @@
            * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
            * obtained from the default look and feel.
            */
      -    protected Vector uis = new Vector();
      +    protected Vector<ComponentUI> uis = new Vector<>();
       
       ////////////////////
       // Common UI methods
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiFileChooserUI.java    2014-06-25 15:48:49.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiFileChooserUI.java    2014-06-25 15:48:49.000000000 -0700
      @@ -52,7 +52,7 @@
            * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
            * obtained from the default look and feel.
            */
      -    protected Vector uis = new Vector();
      +    protected Vector<ComponentUI> uis = new Vector<>();
       
       ////////////////////
       // Common UI methods
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiInternalFrameUI.java    2014-06-25 15:48:50.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiInternalFrameUI.java    2014-06-25 15:48:49.000000000 -0700
      @@ -47,7 +47,7 @@
            * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
            * obtained from the default look and feel.
            */
      -    protected Vector uis = new Vector();
      +    protected Vector<ComponentUI> uis = new Vector<>();
       
       ////////////////////
       // Common UI methods
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiLabelUI.java    2014-06-25 15:48:50.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiLabelUI.java    2014-06-25 15:48:50.000000000 -0700
      @@ -47,7 +47,7 @@
            * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
            * obtained from the default look and feel.
            */
      -    protected Vector uis = new Vector();
      +    protected Vector<ComponentUI> uis = new Vector<>();
       
       ////////////////////
       // Common UI methods
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiListUI.java    2014-06-25 15:48:51.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiListUI.java    2014-06-25 15:48:50.000000000 -0700
      @@ -50,7 +50,7 @@
            * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI
            * obtained from the default look and feel.
            */
      -    protected Vector uis = new Vector();
      +    protected Vector<ComponentUI> uis = new Vector<>();
       
       ////////////////////
       // Common UI methods
      
      @@ -77,7 +77,7 @@
            * @return the value obtained from the first UI, which is
            * the UI obtained from the default <code>LookAndFeel</code>
            */
      -    public int locationToIndex(JList a, Point b) {
      +    public int locationToIndex(JList<?> a, Point b) {
               int returnValue =
                   ((ListUI) (uis.elementAt(0))).locationToIndex(a,b);
               for (int i = 1; i < uis.size(); i++) {
      @@ -92,7 +92,7 @@
            * @return the value obtained from the first UI, which is
            * the UI obtained from the default <code>LookAndFeel</code>
            */
      -    public Point indexToLocation(JList a, int b) {
      +    public Point indexToLocation(JList<?> a, int b) {
               Point returnValue =
                   ((ListUI) (uis.elementAt(0))).indexToLocation(a,b);
               for (int i = 1; i < uis.size(); i++) {
      @@ -107,7 +107,7 @@
            * @return the value obtained from the first UI, which is
            * the UI obtained from the default <code>LookAndFeel</code>
            */
      -    public Rectangle getCellBounds(JList a, int b, int c) {
      +    public Rectangle getCellBounds(JList<?> a, int b, int c) {
               Rectangle returnValue =
                   ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c);
               for (int i = 1; i < uis.size(); i++) {
      
      --- old/src/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java    2014-06-25 15:48:51.000000000 -0700
      +++ new/src/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java    2014-06-25 15:48:51.000000000 -0700
      @@ -221,7 +221,7 @@
            * @see MultiButtonUI#createUI
            */
           public static ComponentUI createUIs(ComponentUI mui,
      -                                        Vector      uis,
      +                                        Vector<ComponentUI> uis,
                                               JComponent  target) {
               ComponentUI ui;
       
      @@ -269,7 +269,7 @@
            * @return an array equivalent to the passed-in vector
            *
            */
      -    protected static ComponentUI[] uisToArray(Vector uis) {
      +    protected static ComponentUI[] uisToArray(Vector<? extends ComponentUI> uis) {          if (uis == null) {              return new ComponentUI[0];          } else { --- old/src/share/classes/javax/swing/plaf/multi/MultiMenuBarUI.java    2014-06-25 15:48:52.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiMenuBarUI.java    2014-06-25 15:48:52.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiMenuItemUI.java    2014-06-25 15:48:52.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiMenuItemUI.java    2014-06-25 15:48:52.000000000 -0700 @@ -48,7 +48,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiOptionPaneUI.java    2014-06-25 15:48:53.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiOptionPaneUI.java    2014-06-25 15:48:53.000000000 -0700 @@ -48,7 +48,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiPanelUI.java    2014-06-25 15:48:54.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiPanelUI.java    2014-06-25 15:48:53.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiPopupMenuUI.java    2014-06-25 15:48:54.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiPopupMenuUI.java    2014-06-25 15:48:54.000000000 -0700 @@ -50,7 +50,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiProgressBarUI.java    2014-06-25 15:48:55.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiProgressBarUI.java    2014-06-25 15:48:55.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiRootPaneUI.java    2014-06-25 15:48:56.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiRootPaneUI.java    2014-06-25 15:48:55.000000000 -0700 @@ -48,7 +48,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiScrollBarUI.java    2014-06-25 15:48:56.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiScrollBarUI.java    2014-06-25 15:48:56.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiScrollPaneUI.java    2014-06-25 15:48:57.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiScrollPaneUI.java    2014-06-25 15:48:57.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiSeparatorUI.java    2014-06-25 15:48:57.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiSeparatorUI.java    2014-06-25 15:48:57.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiSliderUI.java    2014-06-25 15:48:58.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiSliderUI.java    2014-06-25 15:48:58.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiSpinnerUI.java    2014-06-25 15:48:58.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiSpinnerUI.java    2014-06-25 15:48:58.000000000 -0700 @@ -48,7 +48,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiSplitPaneUI.java    2014-06-25 15:48:59.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiSplitPaneUI.java    2014-06-25 15:48:59.000000000 -0700 @@ -48,7 +48,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiTabbedPaneUI.java    2014-06-25 15:49:01.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTabbedPaneUI.java    2014-06-25 15:49:01.000000000 -0700 @@ -49,7 +49,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiTableHeaderUI.java    2014-06-25 15:49:02.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTableHeaderUI.java    2014-06-25 15:49:02.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiTableUI.java    2014-06-25 15:49:02.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTableUI.java    2014-06-25 15:49:02.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiTextUI.java    2014-06-25 15:49:03.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTextUI.java    2014-06-25 15:49:03.000000000 -0700 @@ -55,7 +55,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiToolBarUI.java    2014-06-25 15:49:03.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiToolBarUI.java    2014-06-25 15:49:03.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiToolTipUI.java    2014-06-25 15:49:04.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiToolTipUI.java    2014-06-25 15:49:04.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiTreeUI.java    2014-06-25 15:49:05.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTreeUI.java    2014-06-25 15:49:04.000000000 -0700 @@ -50,7 +50,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/multi/MultiViewportUI.java    2014-06-25 15:49:05.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiViewportUI.java    2014-06-25 15:49:05.000000000 -0700 @@ -47,7 +47,7 @@       * the <code>getUIs</code> method.  The first element is guaranteed to be the real UI       * obtained from the default look and feel.       */ -    protected Vector uis = new Vector(); +    protected Vector<ComponentUI> uis = new Vector<>();    ////////////////////  // Common UI methods --- old/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java    2014-06-25 15:49:06.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java    2014-06-25 15:49:06.000000000 -0700 @@ -698,14 +706,14 @@       * @return The background painter associated for the given state, or null if       * none could be found.       */ -    public Painter getBackgroundPainter(SynthContext ctx) { +    public Painter<Object> getBackgroundPainter(SynthContext ctx) { @@ -733,14 +741,14 @@       * @return The foreground painter associated for the given state, or null if       * none could be found.       */ -    public Painter getForegroundPainter(SynthContext ctx) { +    public Painter<Object> getForegroundPainter(SynthContext ctx) {          Values v = getValues(ctx);          int xstate = getExtendedState(ctx, v); @@ -768,14 +776,14 @@       * @return The border painter associated for the given state, or null if       * none could be found.       */ -    public Painter getBorderPainter(SynthContext ctx) { +    public Painter<Object> getBorderPainter(SynthContext ctx) {          Values v = getValues(ctx);          int xstate = getExtendedState(ctx, v); --- old/src/share/classes/javax/swing/plaf/nimbus/State.java    2014-06-25 15:49:07.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/nimbus/State.java    2014-06-25 15:49:07.000000000 -0700 @@ -72,13 +72,13 @@   */  public abstract class State<T extends JComponent>{      static final Map<String, StandardState> standardStates = new HashMap<String, StandardState>(7); -    static final State Enabled = new StandardState(SynthConstants.ENABLED); -    static final State MouseOver = new StandardState(SynthConstants.MOUSE_OVER); -    static final State Pressed = new StandardState(SynthConstants.PRESSED); -    static final State Disabled = new StandardState(SynthConstants.DISABLED); -    static final State Focused = new StandardState(SynthConstants.FOCUSED); -    static final State Selected = new StandardState(SynthConstants.SELECTED); -    static final State Default = new StandardState(SynthConstants.DEFAULT); +    static final State<JComponent> Enabled = new StandardState(SynthConstants.ENABLED); +    static final State<JComponent> MouseOver = new StandardState(SynthConstants.MOUSE_OVER); +    static final State<JComponent> Pressed = new StandardState(SynthConstants.PRESSED); +    static final State<JComponent> Disabled = new StandardState(SynthConstants.DISABLED); +    static final State<JComponent> Focused = new StandardState(SynthConstants.FOCUSED); +    static final State<JComponent> Selected = new StandardState(SynthConstants.SELECTED); +    static final State<JComponent> Default = new StandardState(SynthConstants.DEFAULT);        private String name;   --- old/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java    2014-06-25 15:49:11.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java    2014-06-25 15:49:11.000000000 -0700 @@ -263,7 +263,7 @@       * {@inheritDoc}       */      @Override -    protected ListCellRenderer createRenderer() { +    protected ListCellRenderer<Object> createRenderer() {          return new SynthComboBoxRenderer();      }   --- old/src/share/classes/javax/swing/plaf/synth/SynthComboPopup.java    2014-06-25 15:49:11.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthComboPopup.java    2014-06-25 15:49:11.000000000 -0700 @@ -38,7 +38,7 @@   */  @SuppressWarnings("serial") // Superclass is not serializable across versions  class SynthComboPopup extends BasicComboPopup { -    public SynthComboPopup( JComboBox combo ) { +    public SynthComboPopup( JComboBox<Object> combo ) {          super(combo);      }   --- old/src/share/classes/javax/swing/plaf/synth/SynthListUI.java    2014-06-25 15:49:12.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthListUI.java    2014-06-25 15:49:12.000000000 -0700 @@ -207,7 +207,7 @@              }          }   -        @Override public Component getListCellRendererComponent(JList list, Object value, +        @Override public Component getListCellRendererComponent(JList<?> list, Object value,                    int index, boolean isSelected, boolean cellHasFocus) {              if (!useListColors && (isSelected || cellHasFocus)) {                  SynthLookAndFeel.setSelectedUI((SynthLabelUI)SynthLookAndFeel.

      Attachments

        Issue Links

          Activity

            People

              darcy Joe Darcy
              darcy Joe Darcy
              Petr Pchelko (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: