提交 8d4f3fdb 编写于 作者: A alexsch

7116950: Reduce number of warnings in swing

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