OpenJDK / zgc / zgc
changeset 11268:f0e59c4852de
7116950: Reduce number of warnings in swing
Reviewed-by: art
line wrap: on
line diff
--- a/jdk/src/share/classes/com/sun/java/swing/Painter.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/com/sun/java/swing/Painter.java Tue Dec 13 18:38:39 2011 +0400 @@ -29,5 +29,5 @@ * * @deprecated Use {@link javax.swing.Painter} instead. */ -public interface Painter<T> extends javax.swing.Painter { +public interface Painter<T> extends javax.swing.Painter<T> { }
--- a/jdk/src/share/classes/java/beans/PropertyDescriptor.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/java/beans/PropertyDescriptor.java Tue Dec 13 18:38:39 2011 +0400 @@ -174,7 +174,7 @@ * or {@code null} if the type cannot be determined */ public synchronized Class<?> getPropertyType() { - Class type = getPropertyType0(); + Class<?> type = getPropertyType0(); if (type == null) { try { type = findPropertyType(getReadMethod(), getWriteMethod()); @@ -205,13 +205,13 @@ public synchronized Method getReadMethod() { Method readMethod = getReadMethod0(); if (readMethod == null) { - Class cls = getClass0(); + Class<?> cls = getClass0(); if (cls == null || (readMethodName == null && readMethodRef == null)) { // The read method was explicitly set to null. return null; } if (readMethodName == null) { - Class type = getPropertyType0(); + Class<?> type = getPropertyType0(); if (type == boolean.class || type == null) { readMethodName = Introspector.IS_PREFIX + getBaseName(); } else { @@ -268,14 +268,14 @@ public synchronized Method getWriteMethod() { Method writeMethod = getWriteMethod0(); if (writeMethod == null) { - Class cls = getClass0(); + Class<?> cls = getClass0(); if (cls == null || (writeMethodName == null && writeMethodRef == null)) { // The write method was explicitly set to null. return null; } // We need the type to fetch the correct method. - Class type = getPropertyType0(); + Class<?> type = getPropertyType0(); if (type == null) { try { // Can't use getPropertyType since it will lead to recursive loop. @@ -292,7 +292,7 @@ writeMethodName = Introspector.SET_PREFIX + getBaseName(); } - Class[] args = (type == null) ? null : new Class[] { type }; + Class<?>[] args = (type == null) ? null : new Class<?>[] { type }; writeMethod = Introspector.findMethod(cls, writeMethodName, 1, args); if (writeMethod != null) { if (!writeMethod.getReturnType().equals(void.class)) { @@ -437,9 +437,9 @@ public PropertyEditor createPropertyEditor(Object bean) { Object editor = null; - Class cls = getPropertyEditorClass(); + Class<?> cls = getPropertyEditorClass(); if (cls != null) { - Constructor ctor = null; + Constructor<?> ctor = null; if (bean != null) { try { ctor = cls.getConstructor(new Class[] { Object.class }); @@ -634,9 +634,9 @@ * read and write methods are null. * @throws IntrospectionException if the read or write method is invalid */ - private Class findPropertyType(Method readMethod, Method writeMethod) + private Class<?> findPropertyType(Method readMethod, Method writeMethod) throws IntrospectionException { - Class propertyType = null; + Class<?> propertyType = null; try { if (readMethod != null) { Class[] params = getParameterTypes(getClass0(), readMethod);
--- a/jdk/src/share/classes/javax/swing/AbstractButton.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/AbstractButton.java Tue Dec 13 18:38:39 2011 +0400 @@ -1349,6 +1349,7 @@ return new ButtonActionPropertyChangeListener(this, a); } + @SuppressWarnings("serial") private static class ButtonActionPropertyChangeListener extends ActionPropertyChangeListener<AbstractButton> { ButtonActionPropertyChangeListener(AbstractButton b, Action a) { @@ -1976,6 +1977,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class ButtonChangeListener implements ChangeListener, Serializable { // NOTE: This class is NOT used, instead the functionality has // been moved to Handler. @@ -2320,6 +2322,7 @@ // // Listeners that are added to model // + @SuppressWarnings("serial") class Handler implements ActionListener, ChangeListener, ItemListener, Serializable { // @@ -2472,7 +2475,7 @@ // the members of the button group. int len = group.getButtonCount(); Object [] target = new Object[len]; - Enumeration elem = group.getElements(); + Enumeration<AbstractButton> elem = group.getElements(); for (int i = 0; i < len; i++) { if (elem.hasMoreElements()) { target[i] = elem.nextElement();
--- a/jdk/src/share/classes/javax/swing/ActionMap.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/ActionMap.java Tue Dec 13 18:38:39 2011 +0400 @@ -55,6 +55,7 @@ * @author Scott Violet * @since 1.3 */ +@SuppressWarnings("serial") public class ActionMap implements Serializable { /** Handles the mapping between Action name and Action. */ private transient ArrayTable arrayTable;
--- a/jdk/src/share/classes/javax/swing/ActionPropertyChangeListener.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/ActionPropertyChangeListener.java Tue Dec 13 18:38:39 2011 +0400 @@ -101,9 +101,9 @@ // Check to see whether any old buttons have // been enqueued for GC. If so, look up their // PCL instance and remove it from its Action. - OwnedWeakReference r; + OwnedWeakReference<?> r; while ((r = (OwnedWeakReference)queue.poll()) != null) { - ActionPropertyChangeListener oldPCL = r.getOwner(); + ActionPropertyChangeListener<?> oldPCL = r.getOwner(); Action oldAction = oldPCL.getAction(); if (oldAction!=null) { oldAction.removePropertyChangeListener(oldPCL); @@ -142,15 +142,15 @@ private static class OwnedWeakReference<U extends JComponent> extends WeakReference<U> { - private ActionPropertyChangeListener owner; + private ActionPropertyChangeListener<?> owner; OwnedWeakReference(U target, ReferenceQueue<? super U> queue, - ActionPropertyChangeListener owner) { + ActionPropertyChangeListener<?> owner) { super(target, queue); this.owner = owner; } - public ActionPropertyChangeListener getOwner() { + public ActionPropertyChangeListener<?> getOwner() { return owner; } }
--- a/jdk/src/share/classes/javax/swing/AncestorNotifier.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/AncestorNotifier.java Tue Dec 13 18:38:39 2011 +0400 @@ -42,6 +42,7 @@ * @author Dave Moore */ +@SuppressWarnings("serial") class AncestorNotifier implements ComponentListener, PropertyChangeListener, Serializable { Component firstInvisibleAncestor;
--- a/jdk/src/share/classes/javax/swing/ArrayTable.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/ArrayTable.java Tue Dec 13 18:38:39 2011 +0400 @@ -133,7 +133,7 @@ if ((size==ARRAY_BOUNDARY) && isArray()) { grow(); } - ((Hashtable)table).put(key, value); + ((Hashtable<Object,Object>)table).put(key, value); } } } @@ -259,8 +259,8 @@ newArrayTable.put(array[i], array[i+1]); } } else { - Hashtable tmp = (Hashtable)table; - Enumeration keys = tmp.keys(); + Hashtable<?,?> tmp = (Hashtable)table; + Enumeration<?> keys = tmp.keys(); while (keys.hasMoreElements()) { Object o = keys.nextElement(); newArrayTable.put(o,tmp.get(o)); @@ -289,8 +289,8 @@ keys[index] = array[i]; } } else { - Hashtable tmp = (Hashtable)table; - Enumeration enum_ = tmp.keys(); + Hashtable<?,?> tmp = (Hashtable)table; + Enumeration<?> enum_ = tmp.keys(); int counter = tmp.size(); if (keys == null) { keys = new Object[counter]; @@ -326,9 +326,9 @@ * Shrinks the storage from a hashtable to an array. */ private void shrink() { - Hashtable tmp = (Hashtable)table; + Hashtable<?,?> tmp = (Hashtable)table; Object[] array = new Object[tmp.size()*2]; - Enumeration keys = tmp.keys(); + Enumeration<?> keys = tmp.keys(); int j = 0; while (keys.hasMoreElements()) {
--- a/jdk/src/share/classes/javax/swing/Box.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/Box.java Tue Dec 13 18:38:39 2011 +0400 @@ -76,6 +76,7 @@ * * @author Timothy Prinzing */ +@SuppressWarnings("serial") public class Box extends JComponent implements Accessible { /** @@ -301,6 +302,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") public static class Filler extends JComponent implements Accessible { /** @@ -380,6 +382,7 @@ * This class implements accessibility support for the * <code>Box.Filler</code> class. */ + @SuppressWarnings("serial") protected class AccessibleBoxFiller extends AccessibleAWTComponent { // AccessibleContext methods // @@ -420,6 +423,7 @@ * This class implements accessibility support for the * <code>Box</code> class. */ + @SuppressWarnings("serial") protected class AccessibleBox extends AccessibleAWTContainer { // AccessibleContext methods //
--- a/jdk/src/share/classes/javax/swing/BoxLayout.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/BoxLayout.java Tue Dec 13 18:38:39 2011 +0400 @@ -135,6 +135,7 @@ * * @author Timothy Prinzing */ +@SuppressWarnings("serial") public class BoxLayout implements LayoutManager2, Serializable { /**
--- a/jdk/src/share/classes/javax/swing/ButtonGroup.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/ButtonGroup.java Tue Dec 13 18:38:39 2011 +0400 @@ -65,6 +65,7 @@ * * @author Jeff Dinkins */ +@SuppressWarnings("serial") public class ButtonGroup implements Serializable { // the list of buttons participating in this group
--- a/jdk/src/share/classes/javax/swing/ComponentInputMap.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/ComponentInputMap.java Tue Dec 13 18:38:39 2011 +0400 @@ -35,6 +35,7 @@ * @author Scott Violet * @since 1.3 */ +@SuppressWarnings("serial") public class ComponentInputMap extends InputMap { /** Component binding is created for. */ private JComponent component;
--- a/jdk/src/share/classes/javax/swing/InputMap.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/InputMap.java Tue Dec 13 18:38:39 2011 +0400 @@ -52,6 +52,7 @@ * @author Scott Violet * @since 1.3 */ +@SuppressWarnings("serial") public class InputMap implements Serializable { /** Handles the mapping between KeyStroke and Action name. */ private transient ArrayTable arrayTable;
--- a/jdk/src/share/classes/javax/swing/JButton.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JButton.java Tue Dec 13 18:38:39 2011 +0400 @@ -75,6 +75,7 @@ * * @author Jeff Dinkins */ +@SuppressWarnings("serial") public class JButton extends AbstractButton implements Accessible { /** @@ -307,6 +308,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJButton extends AccessibleAbstractButton { /**
--- a/jdk/src/share/classes/javax/swing/JComponent.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JComponent.java Tue Dec 13 18:38:39 2011 +0400 @@ -2109,7 +2109,8 @@ private void registerWithKeyboardManager(boolean onlyIfNew) { InputMap inputMap = getInputMap(WHEN_IN_FOCUSED_WINDOW, false); KeyStroke[] strokes; - Hashtable<KeyStroke, KeyStroke> registered = (Hashtable)getClientProperty + Hashtable<KeyStroke, KeyStroke> registered = + (Hashtable<KeyStroke, KeyStroke>)getClientProperty (WHEN_IN_FOCUSED_WINDOW_BINDINGS); if (inputMap != null) { @@ -2161,14 +2162,15 @@ * <code>WHEN_IN_FOCUSED_WINDOW</code> <code>KeyStroke</code> bindings. */ private void unregisterWithKeyboardManager() { - Hashtable registered = (Hashtable)getClientProperty + Hashtable<KeyStroke, KeyStroke> registered = + (Hashtable<KeyStroke, KeyStroke>)getClientProperty (WHEN_IN_FOCUSED_WINDOW_BINDINGS); if (registered != null && registered.size() > 0) { - Enumeration keys = registered.keys(); + Enumeration<KeyStroke> keys = registered.keys(); while (keys.hasMoreElements()) { - KeyStroke ks = (KeyStroke)keys.nextElement(); + KeyStroke ks = keys.nextElement(); unregisterWithKeyboardManager(ks); } } @@ -3469,6 +3471,7 @@ } } + @SuppressWarnings("serial") static class KeyboardState implements Serializable { private static final Object keyCodesKey = JComponent.KeyboardState.class; @@ -4125,13 +4128,13 @@ if (!getFlag(FOCUS_TRAVERSAL_KEYS_FORWARD_SET)) { super.setFocusTraversalKeys(KeyboardFocusManager. FORWARD_TRAVERSAL_KEYS, - (Set)value); + (Set<AWTKeyStroke>)value); } } else if (propertyName == "focusTraversalKeysBackward") { if (!getFlag(FOCUS_TRAVERSAL_KEYS_BACKWARD_SET)) { super.setFocusTraversalKeys(KeyboardFocusManager. BACKWARD_TRAVERSAL_KEYS, - (Set)value); + (Set<AWTKeyStroke>)value); } } else { throw new IllegalArgumentException("property \""+ @@ -4188,6 +4191,7 @@ * * @return true if this component is lightweight */ + @SuppressWarnings("deprecation") public static boolean isLightweightComponent(Component c) { return c.getPeer() instanceof LightweightPeer; }
--- a/jdk/src/share/classes/javax/swing/JLabel.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JLabel.java Tue Dec 13 18:38:39 2011 +0400 @@ -104,6 +104,7 @@ * * @author Hans Muller */ +@SuppressWarnings("serial") public class JLabel extends JComponent implements SwingConstants, Accessible { /** @@ -1067,6 +1068,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJLabel extends AccessibleJComponent implements AccessibleText, AccessibleExtendedComponent {
--- a/jdk/src/share/classes/javax/swing/JLayeredPane.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JLayeredPane.java Tue Dec 13 18:38:39 2011 +0400 @@ -154,6 +154,7 @@ * * @author David Kloba */ +@SuppressWarnings("serial") public class JLayeredPane extends JComponent implements Accessible { /// Watch the values in getObjectForLayer() /** Convenience object defining the Default layer. Equivalent to new Integer(0).*/ @@ -256,7 +257,7 @@ */ public void removeAll() { Component[] children = getComponents(); - Hashtable cToL = getComponentToLayer(); + Hashtable<Component, Integer> cToL = getComponentToLayer(); for (int counter = children.length - 1; counter >= 0; counter--) { Component c = children[counter]; if (c != null && !(c instanceof JComponent)) { @@ -768,6 +769,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJLayeredPane extends AccessibleJComponent { /**
--- a/jdk/src/share/classes/javax/swing/JMenu.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JMenu.java Tue Dec 13 18:38:39 2011 +0400 @@ -109,6 +109,7 @@ * @see JMenuBar * @see JPopupMenu */ +@SuppressWarnings("serial") public class JMenu extends JMenuItem implements Accessible,MenuElement { /** @@ -134,13 +135,6 @@ */ private MenuEvent menuEvent = null; - /* Registry of listeners created for <code>Action-JMenuItem</code> - * linkage. This is needed so that references can - * be cleaned up at remove time to allow garbage collection - * Default is <code>null</code>. - */ - private static Hashtable listenerRegistry = null; - /* * Used by the look and feel (L&F) code to handle * implementation specific menu behaviors. @@ -1111,6 +1105,7 @@ void configureAcceleratorFromAction(Action a) { } + @SuppressWarnings("serial") class MenuChangeListener implements ChangeListener, Serializable { boolean isSelected = false; public void stateChanged(ChangeEvent e) { @@ -1158,6 +1153,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class WinListener extends WindowAdapter implements Serializable { JPopupMenu popupMenu; /** @@ -1394,6 +1390,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJMenu extends AccessibleJMenuItem implements AccessibleSelection {
--- a/jdk/src/share/classes/javax/swing/JMenuBar.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JMenuBar.java Tue Dec 13 18:38:39 2011 +0400 @@ -82,6 +82,7 @@ * @see JPopupMenu * @see JMenuItem */ +@SuppressWarnings("serial") public class JMenuBar extends JComponent implements Accessible,MenuElement { /** @@ -498,6 +499,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJMenuBar extends AccessibleJComponent implements AccessibleSelection {
--- a/jdk/src/share/classes/javax/swing/JMenuItem.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JMenuItem.java Tue Dec 13 18:38:39 2011 +0400 @@ -87,6 +87,7 @@ * @see JCheckBoxMenuItem * @see JRadioButtonMenuItem */ +@SuppressWarnings("serial") public class JMenuItem extends AbstractButton implements Accessible,MenuElement { /** @@ -829,6 +830,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJMenuItem extends AccessibleAbstractButton implements ChangeListener { private boolean isArmed = false;
--- a/jdk/src/share/classes/javax/swing/JPopupMenu.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java Tue Dec 13 18:38:39 2011 +0400 @@ -81,6 +81,7 @@ * @author David Karlton * @author Arnaud Weber */ +@SuppressWarnings("serial") public class JPopupMenu extends JComponent implements Accessible,MenuElement { /** @@ -1200,6 +1201,7 @@ * Java Accessibility API appropriate to popup menu user-interface * elements. */ + @SuppressWarnings("serial") protected class AccessibleJPopupMenu extends AccessibleJComponent implements PropertyChangeListener { @@ -1268,7 +1270,7 @@ private void fireActiveDescendant() { if (JPopupMenu.this instanceof BasicComboPopup) { // get the popup list - JList popupList = ((BasicComboPopup)JPopupMenu.this).getList(); + JList<?> popupList = ((BasicComboPopup)JPopupMenu.this).getList(); if (popupList == null) { return; } @@ -1335,7 +1337,7 @@ throws IOException, ClassNotFoundException { s.defaultReadObject(); - Vector values = (Vector)s.readObject(); + Vector<?> values = (Vector)s.readObject(); int indexCounter = 0; int maxCounter = values.size(); @@ -1519,6 +1521,7 @@ /** * A popup menu-specific separator. */ + @SuppressWarnings("serial") static public class Separator extends JSeparator { public Separator( )
--- a/jdk/src/share/classes/javax/swing/JRootPane.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JRootPane.java Tue Dec 13 18:38:39 2011 +0400 @@ -199,6 +199,7 @@ * @author David Kloba */ /// PENDING(klobad) Who should be opaque in this component? +@SuppressWarnings("serial") public class JRootPane extends JComponent implements Accessible { private static final String uiClassID = "RootPaneUI"; @@ -834,6 +835,7 @@ } } + @SuppressWarnings("serial") static class DefaultAction extends AbstractAction { JButton owner; JRootPane root; @@ -900,6 +902,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class RootLayout implements LayoutManager2, Serializable { /** @@ -1065,6 +1068,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJRootPane extends AccessibleJComponent { /** * Get the role of this object.
--- a/jdk/src/share/classes/javax/swing/JSeparator.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JSeparator.java Tue Dec 13 18:38:39 2011 +0400 @@ -71,6 +71,7 @@ * @author Georges Saab * @author Jeff Shapiro */ +@SuppressWarnings("serial") public class JSeparator extends JComponent implements SwingConstants, Accessible { /** @@ -279,6 +280,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJSeparator extends AccessibleJComponent { /**
--- a/jdk/src/share/classes/javax/swing/JToolTip.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JToolTip.java Tue Dec 13 18:38:39 2011 +0400 @@ -66,6 +66,7 @@ * @author Dave Moore * @author Rich Shiavi */ +@SuppressWarnings("serial") public class JToolTip extends JComponent implements Accessible { /** * @see #getUIClassID @@ -251,6 +252,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJToolTip extends AccessibleJComponent { /**
--- a/jdk/src/share/classes/javax/swing/JTree.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JTree.java Tue Dec 13 18:38:39 2011 +0400 @@ -142,6 +142,7 @@ * @author Ray Ryan * @author Scott Violet */ +@SuppressWarnings("serial") public class JTree extends JComponent implements Scrollable, Accessible { /** @@ -421,6 +422,7 @@ */ private int expandRow = -1; + @SuppressWarnings("serial") private class TreeTimer extends Timer { public TreeTimer() { super(2000, null); @@ -3077,7 +3079,7 @@ expandedStack = new Stack<Stack<TreePath>>(); - Vector values = (Vector)s.readObject(); + Vector<?> values = (Vector)s.readObject(); int indexCounter = 0; int maxCounter = values.size(); @@ -3159,7 +3161,7 @@ */ private void unarchiveExpandedState(Object state) { if(state instanceof Vector) { - Vector paths = (Vector)state; + Vector<?> paths = (Vector)state; for(int counter = paths.size() - 1; counter >= 0; counter--) { Boolean eState = (Boolean)paths.elementAt(counter--); @@ -3240,6 +3242,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected static class EmptySelectionModel extends DefaultTreeSelectionModel { @@ -3361,6 +3364,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class TreeSelectionRedirector implements Serializable, TreeSelectionListener { @@ -3661,7 +3665,7 @@ { if(toRemove != null) { while(toRemove.hasMoreElements()) { - Enumeration descendants = getDescendantToggledPaths + Enumeration<?> descendants = getDescendantToggledPaths (toRemove.nextElement()); if(descendants != null) { @@ -3861,6 +3865,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") public static class DynamicUtilTreeNode extends DefaultMutableTreeNode { /** * Does the this <code>JTree</code> have children? @@ -3882,7 +3887,7 @@ public static void createChildren(DefaultMutableTreeNode parent, Object children) { if(children instanceof Vector) { - Vector childVector = (Vector)children; + Vector<?> childVector = (Vector)children; for(int counter = 0, maxCounter = childVector.size(); counter < maxCounter; counter++) @@ -3891,8 +3896,8 @@ childVector.elementAt(counter))); } else if(children instanceof Hashtable) { - Hashtable childHT = (Hashtable)children; - Enumeration keys = childHT.keys(); + Hashtable<?,?> childHT = (Hashtable)children; + Enumeration<?> keys = childHT.keys(); Object aKey; while(keys.hasMoreElements()) { @@ -4092,6 +4097,7 @@ * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ + @SuppressWarnings("serial") protected class AccessibleJTree extends AccessibleJComponent implements AccessibleSelection, TreeSelectionListener, TreeModelListener, TreeExpansionListener { @@ -5242,6 +5248,7 @@ } } + @SuppressWarnings("deprecation") public boolean isFocusTraversable() { AccessibleContext ac = getCurrentAccessibleContext(); if (ac instanceof AccessibleComponent) {
--- a/jdk/src/share/classes/javax/swing/JWindow.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/JWindow.java Tue Dec 13 18:38:39 2011 +0400 @@ -89,6 +89,7 @@ * * @author David Kloba */ +@SuppressWarnings("serial") public class JWindow extends Window implements Accessible, RootPaneContainer, TransferHandler.HasGetTransferHandler @@ -663,6 +664,7 @@ * Java Accessibility API appropriate to window user-interface * elements. */ + @SuppressWarnings("serial") protected class AccessibleJWindow extends AccessibleAWTWindow { // everything is in the new parent, AccessibleAWTWindow }
--- a/jdk/src/share/classes/javax/swing/MenuSelectionManager.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/MenuSelectionManager.java Tue Dec 13 18:38:39 2011 +0400 @@ -213,7 +213,7 @@ MenuElement menuElement; MenuElement subElements[]; MenuElement path[]; - Vector tmp; + Vector<MenuElement> tmp; int selectionSize; p = event.getPoint(); @@ -242,7 +242,7 @@ screenX = p.x; screenY = p.y; - tmp = (Vector)selection.clone(); + tmp = (Vector<MenuElement>)selection.clone(); selectionSize = tmp.size(); boolean success = false; for (i=selectionSize - 1;i >= 0 && success == false; i--) { @@ -377,7 +377,7 @@ int cWidth,cHeight; MenuElement menuElement; MenuElement subElements[]; - Vector tmp; + Vector<MenuElement> tmp; int selectionSize; SwingUtilities.convertPointToScreen(p,source); @@ -385,7 +385,7 @@ screenX = p.x; screenY = p.y; - tmp = (Vector)selection.clone(); + tmp = (Vector<MenuElement>)selection.clone(); selectionSize = tmp.size(); for(i=selectionSize - 1 ; i >= 0 ; i--) { menuElement = (MenuElement) tmp.elementAt(i);
--- a/jdk/src/share/classes/javax/swing/Popup.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/Popup.java Tue Dec 13 18:38:39 2011 +0400 @@ -98,6 +98,8 @@ * Makes the <code>Popup</code> visible. If the <code>Popup</code> is * currently visible, this has no effect. */ + + @SuppressWarnings("deprecation") public void show() { Component component = getComponent(); @@ -114,6 +116,8 @@ * on a <code>disposed</code> <code>Popup</code>, indeterminate * behavior will result. */ + + @SuppressWarnings("deprecation") public void hide() { Component component = getComponent();
--- a/jdk/src/share/classes/javax/swing/RepaintManager.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/RepaintManager.java Tue Dec 13 18:38:39 2011 +0400 @@ -744,7 +744,6 @@ int localBoundsY = 0; int localBoundsH; int localBoundsW; - Enumeration keys; roots = new ArrayList<Component>(count); @@ -1073,9 +1072,9 @@ } } // Clear out the VolatileImages - Iterator gcs = volatileMap.keySet().iterator(); + Iterator<GraphicsConfiguration> gcs = volatileMap.keySet().iterator(); while (gcs.hasNext()) { - GraphicsConfiguration gc = (GraphicsConfiguration)gcs.next(); + GraphicsConfiguration gc = gcs.next(); VolatileImage image = volatileMap.get(gc); if (image.getWidth() > width || image.getHeight() > height) { image.flush();
--- a/jdk/src/share/classes/javax/swing/Timer.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/Timer.java Tue Dec 13 18:38:39 2011 +0400 @@ -146,6 +146,7 @@ * * @author Dave Moore */ +@SuppressWarnings("serial") public class Timer implements Serializable { /*
--- a/jdk/src/share/classes/javax/swing/border/AbstractBorder.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/border/AbstractBorder.java Tue Dec 13 18:38:39 2011 +0400 @@ -46,6 +46,7 @@ * * @author David Kloba */ +@SuppressWarnings("serial") public abstract class AbstractBorder implements Border, Serializable { /**
--- a/jdk/src/share/classes/javax/swing/border/CompoundBorder.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/border/CompoundBorder.java Tue Dec 13 18:38:39 2011 +0400 @@ -54,6 +54,7 @@ * * @author David Kloba */ +@SuppressWarnings("serial") public class CompoundBorder extends AbstractBorder { protected Border outsideBorder; protected Border insideBorder;
--- a/jdk/src/share/classes/javax/swing/border/EmptyBorder.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/border/EmptyBorder.java Tue Dec 13 18:38:39 2011 +0400 @@ -46,6 +46,7 @@ * * @author David Kloba */ +@SuppressWarnings("serial") public class EmptyBorder extends AbstractBorder implements Serializable { protected int left, right, top, bottom;
--- a/jdk/src/share/classes/javax/swing/border/MatteBorder.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/border/MatteBorder.java Tue Dec 13 18:38:39 2011 +0400 @@ -46,6 +46,7 @@ * * @author Amy Fowler */ +@SuppressWarnings("serial") public class MatteBorder extends EmptyBorder { protected Color color;
--- a/jdk/src/share/classes/javax/swing/border/TitledBorder.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java Tue Dec 13 18:38:39 2011 +0400 @@ -67,6 +67,7 @@ * @author David Kloba * @author Amy Fowler */ +@SuppressWarnings("serial") public class TitledBorder extends AbstractBorder { protected String title;
--- a/jdk/src/share/classes/javax/swing/event/AncestorEvent.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/event/AncestorEvent.java Tue Dec 13 18:38:39 2011 +0400 @@ -43,6 +43,7 @@ * * @author Dave Moore */ +@SuppressWarnings("serial") public class AncestorEvent extends AWTEvent { /** * An ancestor-component was added to the hierarchy of
--- a/jdk/src/share/classes/javax/swing/event/ChangeEvent.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/event/ChangeEvent.java Tue Dec 13 18:38:39 2011 +0400 @@ -42,6 +42,7 @@ * * @author Jeff Dinkins */ +@SuppressWarnings("serial") public class ChangeEvent extends EventObject { /** * Constructs a ChangeEvent object.
--- a/jdk/src/share/classes/javax/swing/event/EventListenerList.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/event/EventListenerList.java Tue Dec 13 18:38:39 2011 +0400 @@ -96,6 +96,7 @@ * @author Hans Muller * @author James Gosling */ +@SuppressWarnings("serial") public class EventListenerList implements Serializable { /* A null array to be shared by all empty listener lists*/ private final static Object[] NULL_ARRAY = new Object[0]; @@ -250,7 +251,7 @@ // Save the non-null event listeners: for (int i = 0; i < lList.length; i+=2) { - Class t = (Class)lList[i]; + Class<?> t = (Class)lList[i]; EventListener l = (EventListener)lList[i+1]; if ((l!=null) && (l instanceof Serializable)) { s.writeObject(t.getName());
--- a/jdk/src/share/classes/javax/swing/event/ListDataEvent.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/event/ListDataEvent.java Tue Dec 13 18:38:39 2011 +0400 @@ -42,6 +42,7 @@ * * @author Hans Muller */ +@SuppressWarnings("serial") public class ListDataEvent extends EventObject { /** Identifies one or more changes in the lists contents. */
--- a/jdk/src/share/classes/javax/swing/event/MenuDragMouseEvent.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/event/MenuDragMouseEvent.java Tue Dec 13 18:38:39 2011 +0400 @@ -47,6 +47,7 @@ * * @author Georges Saab */ +@SuppressWarnings("serial") public class MenuDragMouseEvent extends MouseEvent { private MenuElement path[]; private MenuSelectionManager manager;
--- a/jdk/src/share/classes/javax/swing/event/MenuEvent.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/event/MenuEvent.java Tue Dec 13 18:38:39 2011 +0400 @@ -44,6 +44,7 @@ * @author Georges Saab * @author David Karlton */ +@SuppressWarnings("serial") public class MenuEvent extends EventObject { /** * Constructs a MenuEvent object.
--- a/jdk/src/share/classes/javax/swing/event/MenuKeyEvent.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/event/MenuKeyEvent.java Tue Dec 13 18:38:39 2011 +0400 @@ -47,6 +47,7 @@ * * @author Georges Saab */ +@SuppressWarnings("serial") public class MenuKeyEvent extends KeyEvent { private MenuElement path[]; private MenuSelectionManager manager;
--- a/jdk/src/share/classes/javax/swing/event/PopupMenuEvent.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/event/PopupMenuEvent.java Tue Dec 13 18:38:39 2011 +0400 @@ -41,6 +41,7 @@ * * @author Arnaud Weber */ +@SuppressWarnings("serial") public class PopupMenuEvent extends EventObject { /** * Constructs a PopupMenuEvent object.
--- a/jdk/src/share/classes/javax/swing/plaf/ComponentUI.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/plaf/ComponentUI.java Tue Dec 13 18:38:39 2011 +0400 @@ -244,6 +244,7 @@ * @see javax.swing.JComponent#contains * @see java.awt.Component#contains */ + @SuppressWarnings("deprecation") public boolean contains(JComponent c, int x, int y) { return c.inside(x, y); }
--- a/jdk/src/share/classes/javax/swing/text/BadLocationException.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/text/BadLocationException.java Tue Dec 13 18:38:39 2011 +0400 @@ -39,6 +39,7 @@ * * @author Timothy Prinzing */ +@SuppressWarnings("serial") public class BadLocationException extends Exception { /**
--- a/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Dec 13 17:30:21 2011 +0400 +++ b/jdk/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Tue Dec 13 18:38:39 2011 +0400 @@ -61,6 +61,7 @@ * * @author Scott Violet */ +@SuppressWarnings("serial") public class DefaultTreeSelectionModel implements Cloneable, Serializable, TreeSelectionModel { /** Property name for selectionMode. */ @@ -1073,7 +1074,7 @@ * @deprecated As of JDK version 1.7 */ @Deprecated - protected void notifyPathChange(Vector changedPaths, + protected void notifyPathChange(Vector<?> changedPaths, TreePath oldLeadSelection) { int cPathCount = changedPaths.size(); boolean[] newness = new boolean[cPathCount];