7116950: Reduce number of warnings in swing
Reviewed-by: art
This commit is contained in:
parent
84ee878ee3
commit
7acd8858d0
@ -29,5 +29,5 @@ package com.sun.java.swing;
|
||||
*
|
||||
* @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 {
|
||||
* 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 class PropertyDescriptor extends FeatureDescriptor {
|
||||
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 class PropertyDescriptor extends FeatureDescriptor {
|
||||
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 @@ public class PropertyDescriptor extends FeatureDescriptor {
|
||||
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 class PropertyDescriptor extends FeatureDescriptor {
|
||||
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 @@ public class PropertyDescriptor extends FeatureDescriptor {
|
||||
* 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);
|
||||
|
@ -1349,6 +1349,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl
|
||||
return new ButtonActionPropertyChangeListener(this, a);
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private static class ButtonActionPropertyChangeListener
|
||||
extends ActionPropertyChangeListener<AbstractButton> {
|
||||
ButtonActionPropertyChangeListener(AbstractButton b, Action a) {
|
||||
@ -1976,6 +1977,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl
|
||||
* 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 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl
|
||||
//
|
||||
// Listeners that are added to model
|
||||
//
|
||||
@SuppressWarnings("serial")
|
||||
class Handler implements ActionListener, ChangeListener, ItemListener,
|
||||
Serializable {
|
||||
//
|
||||
@ -2472,7 +2475,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl
|
||||
// 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();
|
||||
|
@ -55,6 +55,7 @@ import java.util.Set;
|
||||
* @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;
|
||||
|
@ -101,9 +101,9 @@ abstract class ActionPropertyChangeListener<T extends JComponent>
|
||||
// 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 @@ abstract class ActionPropertyChangeListener<T extends JComponent>
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ import java.io.Serializable;
|
||||
* @author Dave Moore
|
||||
*/
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
class AncestorNotifier implements ComponentListener, PropertyChangeListener, Serializable
|
||||
{
|
||||
Component firstInvisibleAncestor;
|
||||
|
@ -133,7 +133,7 @@ class ArrayTable implements Cloneable {
|
||||
if ((size==ARRAY_BOUNDARY) && isArray()) {
|
||||
grow();
|
||||
}
|
||||
((Hashtable)table).put(key, value);
|
||||
((Hashtable<Object,Object>)table).put(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -259,8 +259,8 @@ class ArrayTable implements Cloneable {
|
||||
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 @@ class ArrayTable implements Cloneable {
|
||||
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 @@ class ArrayTable implements Cloneable {
|
||||
* 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()) {
|
||||
|
@ -76,6 +76,7 @@ import javax.accessibility.*;
|
||||
*
|
||||
* @author Timothy Prinzing
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
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.
|
||||
* Please see {@link java.beans.XMLEncoder}.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public static class Filler extends JComponent implements Accessible {
|
||||
|
||||
/**
|
||||
@ -380,6 +382,7 @@ public class Box extends JComponent implements Accessible {
|
||||
* 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 @@ public class Box extends JComponent implements Accessible {
|
||||
* This class implements accessibility support for the
|
||||
* <code>Box</code> class.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleBox extends AccessibleAWTContainer {
|
||||
// AccessibleContext methods
|
||||
//
|
||||
|
@ -135,6 +135,7 @@ import java.io.PrintStream;
|
||||
*
|
||||
* @author Timothy Prinzing
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BoxLayout implements LayoutManager2, Serializable {
|
||||
|
||||
/**
|
||||
|
@ -65,6 +65,7 @@ import java.io.Serializable;
|
||||
*
|
||||
* @author Jeff Dinkins
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ButtonGroup implements Serializable {
|
||||
|
||||
// the list of buttons participating in this group
|
||||
|
@ -35,6 +35,7 @@ package javax.swing;
|
||||
* @author Scott Violet
|
||||
* @since 1.3
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ComponentInputMap extends InputMap {
|
||||
/** Component binding is created for. */
|
||||
private JComponent component;
|
||||
|
@ -52,6 +52,7 @@ import java.util.Set;
|
||||
* @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;
|
||||
|
@ -75,6 +75,7 @@ import java.io.IOException;
|
||||
*
|
||||
* @author Jeff Dinkins
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
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.
|
||||
* Please see {@link java.beans.XMLEncoder}.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleJButton extends AccessibleAbstractButton {
|
||||
|
||||
/**
|
||||
|
@ -2109,7 +2109,8 @@ public abstract class JComponent extends Container implements Serializable,
|
||||
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 @@ public abstract class JComponent extends Container implements Serializable,
|
||||
* <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 @@ public abstract class JComponent extends Container implements Serializable,
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
static class KeyboardState implements Serializable {
|
||||
private static final Object keyCodesKey =
|
||||
JComponent.KeyboardState.class;
|
||||
@ -4125,13 +4128,13 @@ public abstract class JComponent extends Container implements Serializable,
|
||||
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 @@ public abstract class JComponent extends Container implements Serializable,
|
||||
*
|
||||
* @return true if this component is lightweight
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public static boolean isLightweightComponent(Component c) {
|
||||
return c.getPeer() instanceof LightweightPeer;
|
||||
}
|
||||
|
@ -104,6 +104,7 @@ import java.util.*;
|
||||
*
|
||||
* @author Hans Muller
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
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.
|
||||
* Please see {@link java.beans.XMLEncoder}.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleJLabel extends AccessibleJComponent
|
||||
implements AccessibleText, AccessibleExtendedComponent {
|
||||
|
||||
|
@ -154,6 +154,7 @@ import javax.accessibility.*;
|
||||
*
|
||||
* @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 class JLayeredPane extends JComponent implements Accessible {
|
||||
*/
|
||||
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 @@ public class JLayeredPane extends JComponent implements Accessible {
|
||||
* has been added to the <code>java.beans</code> package.
|
||||
* Please see {@link java.beans.XMLEncoder}.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleJLayeredPane extends AccessibleJComponent {
|
||||
|
||||
/**
|
||||
|
@ -109,6 +109,7 @@ import java.lang.ref.WeakReference;
|
||||
* @see JMenuBar
|
||||
* @see JPopupMenu
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JMenu extends JMenuItem implements Accessible,MenuElement
|
||||
{
|
||||
/**
|
||||
@ -134,13 +135,6 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement
|
||||
*/
|
||||
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 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement
|
||||
void configureAcceleratorFromAction(Action a) {
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
class MenuChangeListener implements ChangeListener, Serializable {
|
||||
boolean isSelected = false;
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
@ -1158,6 +1153,7 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement
|
||||
* 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 @@ public class JMenu extends JMenuItem implements Accessible,MenuElement
|
||||
* 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 {
|
||||
|
||||
|
@ -82,6 +82,7 @@ import javax.accessibility.*;
|
||||
* @see JPopupMenu
|
||||
* @see JMenuItem
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
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.
|
||||
* Please see {@link java.beans.XMLEncoder}.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleJMenuBar extends AccessibleJComponent
|
||||
implements AccessibleSelection {
|
||||
|
||||
|
@ -87,6 +87,7 @@ import javax.accessibility.*;
|
||||
* @see JCheckBoxMenuItem
|
||||
* @see JRadioButtonMenuItem
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
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.
|
||||
* Please see {@link java.beans.XMLEncoder}.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleJMenuItem extends AccessibleAbstractButton implements ChangeListener {
|
||||
|
||||
private boolean isArmed = false;
|
||||
|
@ -81,6 +81,7 @@ import java.applet.Applet;
|
||||
* @author David Karlton
|
||||
* @author Arnaud Weber
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
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
|
||||
* elements.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleJPopupMenu extends AccessibleJComponent
|
||||
implements PropertyChangeListener {
|
||||
|
||||
@ -1268,7 +1270,7 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
|
||||
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 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
|
||||
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 @@ public class JPopupMenu extends JComponent implements Accessible,MenuElement {
|
||||
/**
|
||||
* A popup menu-specific separator.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
static public class Separator extends JSeparator
|
||||
{
|
||||
public Separator( )
|
||||
|
@ -199,6 +199,7 @@ import sun.security.action.GetBooleanAction;
|
||||
* @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 @@ public class JRootPane extends JComponent implements Accessible {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
static class DefaultAction extends AbstractAction {
|
||||
JButton owner;
|
||||
JRootPane root;
|
||||
@ -900,6 +902,7 @@ public class JRootPane extends JComponent implements Accessible {
|
||||
* 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 @@ public class JRootPane extends JComponent implements Accessible {
|
||||
* 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.
|
||||
|
@ -71,6 +71,7 @@ import java.io.IOException;
|
||||
* @author Georges Saab
|
||||
* @author Jeff Shapiro
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
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.
|
||||
* Please see {@link java.beans.XMLEncoder}.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleJSeparator extends AccessibleJComponent {
|
||||
|
||||
/**
|
||||
|
@ -66,6 +66,7 @@ import java.io.IOException;
|
||||
* @author Dave Moore
|
||||
* @author Rich Shiavi
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JToolTip extends JComponent implements Accessible {
|
||||
/**
|
||||
* @see #getUIClassID
|
||||
@ -251,6 +252,7 @@ public class JToolTip extends JComponent implements Accessible {
|
||||
* has been added to the <code>java.beans</code> package.
|
||||
* Please see {@link java.beans.XMLEncoder}.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleJToolTip extends AccessibleJComponent {
|
||||
|
||||
/**
|
||||
|
@ -142,6 +142,7 @@ import static sun.swing.SwingUtilities2.Section.*;
|
||||
* @author Ray Ryan
|
||||
* @author Scott Violet
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JTree extends JComponent implements Scrollable, Accessible
|
||||
{
|
||||
/**
|
||||
@ -421,6 +422,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
*/
|
||||
private int expandRow = -1;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
private class TreeTimer extends Timer {
|
||||
public TreeTimer() {
|
||||
super(2000, null);
|
||||
@ -3077,7 +3079,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
|
||||
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 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
*/
|
||||
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 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
* 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 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
* 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 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
{
|
||||
if(toRemove != null) {
|
||||
while(toRemove.hasMoreElements()) {
|
||||
Enumeration descendants = getDescendantToggledPaths
|
||||
Enumeration<?> descendants = getDescendantToggledPaths
|
||||
(toRemove.nextElement());
|
||||
|
||||
if(descendants != null) {
|
||||
@ -3861,6 +3865,7 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
* 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 class JTree extends JComponent implements Scrollable, Accessible
|
||||
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 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
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 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
* 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 @@ public class JTree extends JComponent implements Scrollable, Accessible
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFocusTraversable() {
|
||||
AccessibleContext ac = getCurrentAccessibleContext();
|
||||
if (ac instanceof AccessibleComponent) {
|
||||
|
@ -89,6 +89,7 @@ import javax.accessibility.*;
|
||||
*
|
||||
* @author David Kloba
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class JWindow extends Window implements Accessible,
|
||||
RootPaneContainer,
|
||||
TransferHandler.HasGetTransferHandler
|
||||
@ -663,6 +664,7 @@ public class JWindow extends Window implements Accessible,
|
||||
* Java Accessibility API appropriate to window user-interface
|
||||
* elements.
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
protected class AccessibleJWindow extends AccessibleAWTWindow {
|
||||
// everything is in the new parent, AccessibleAWTWindow
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ public class MenuSelectionManager {
|
||||
MenuElement menuElement;
|
||||
MenuElement subElements[];
|
||||
MenuElement path[];
|
||||
Vector tmp;
|
||||
Vector<MenuElement> tmp;
|
||||
int selectionSize;
|
||||
p = event.getPoint();
|
||||
|
||||
@ -242,7 +242,7 @@ public class MenuSelectionManager {
|
||||
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 @@ public class MenuSelectionManager {
|
||||
int cWidth,cHeight;
|
||||
MenuElement menuElement;
|
||||
MenuElement subElements[];
|
||||
Vector tmp;
|
||||
Vector<MenuElement> tmp;
|
||||
int selectionSize;
|
||||
|
||||
SwingUtilities.convertPointToScreen(p,source);
|
||||
@ -385,7 +385,7 @@ public class MenuSelectionManager {
|
||||
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);
|
||||
|
@ -98,6 +98,8 @@ public class Popup {
|
||||
* 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 @@ public class Popup {
|
||||
* on a <code>disposed</code> <code>Popup</code>, indeterminate
|
||||
* behavior will result.
|
||||
*/
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public void hide() {
|
||||
Component component = getComponent();
|
||||
|
||||
|
@ -744,7 +744,6 @@ public class RepaintManager
|
||||
int localBoundsY = 0;
|
||||
int localBoundsH;
|
||||
int localBoundsW;
|
||||
Enumeration keys;
|
||||
|
||||
roots = new ArrayList<Component>(count);
|
||||
|
||||
@ -1073,9 +1072,9 @@ public class RepaintManager
|
||||
}
|
||||
}
|
||||
// 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();
|
||||
|
@ -146,6 +146,7 @@ import javax.swing.event.EventListenerList;
|
||||
*
|
||||
* @author Dave Moore
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class Timer implements Serializable
|
||||
{
|
||||
/*
|
||||
|
@ -46,6 +46,7 @@ import java.io.Serializable;
|
||||
*
|
||||
* @author David Kloba
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class AbstractBorder implements Border, Serializable
|
||||
{
|
||||
/**
|
||||
|
@ -54,6 +54,7 @@ import java.beans.ConstructorProperties;
|
||||
*
|
||||
* @author David Kloba
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class CompoundBorder extends AbstractBorder {
|
||||
protected Border outsideBorder;
|
||||
protected Border insideBorder;
|
||||
|
@ -46,6 +46,7 @@ import java.beans.ConstructorProperties;
|
||||
*
|
||||
* @author David Kloba
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class EmptyBorder extends AbstractBorder implements Serializable
|
||||
{
|
||||
protected int left, right, top, bottom;
|
||||
|
@ -46,6 +46,7 @@ import javax.swing.Icon;
|
||||
*
|
||||
* @author Amy Fowler
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MatteBorder extends EmptyBorder
|
||||
{
|
||||
protected Color color;
|
||||
|
@ -67,6 +67,7 @@ import javax.swing.plaf.basic.BasicHTML;
|
||||
* @author David Kloba
|
||||
* @author Amy Fowler
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TitledBorder extends AbstractBorder
|
||||
{
|
||||
protected String title;
|
||||
|
@ -43,6 +43,7 @@ import javax.swing.*;
|
||||
*
|
||||
* @author Dave Moore
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class AncestorEvent extends AWTEvent {
|
||||
/**
|
||||
* An ancestor-component was added to the hierarchy of
|
||||
|
@ -42,6 +42,7 @@ import java.util.EventObject;
|
||||
*
|
||||
* @author Jeff Dinkins
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ChangeEvent extends EventObject {
|
||||
/**
|
||||
* Constructs a ChangeEvent object.
|
||||
|
@ -96,6 +96,7 @@ import java.lang.reflect.Array;
|
||||
* @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 @@ public class EventListenerList implements Serializable {
|
||||
|
||||
// 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());
|
||||
|
@ -42,6 +42,7 @@ import java.util.EventObject;
|
||||
*
|
||||
* @author Hans Muller
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ListDataEvent extends EventObject
|
||||
{
|
||||
/** Identifies one or more changes in the lists contents. */
|
||||
|
@ -47,6 +47,7 @@ import java.awt.Component;
|
||||
*
|
||||
* @author Georges Saab
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MenuDragMouseEvent extends MouseEvent {
|
||||
private MenuElement path[];
|
||||
private MenuSelectionManager manager;
|
||||
|
@ -44,6 +44,7 @@ import java.util.EventObject;
|
||||
* @author Georges Saab
|
||||
* @author David Karlton
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MenuEvent extends EventObject {
|
||||
/**
|
||||
* Constructs a MenuEvent object.
|
||||
|
@ -47,6 +47,7 @@ import java.awt.Component;
|
||||
*
|
||||
* @author Georges Saab
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class MenuKeyEvent extends KeyEvent {
|
||||
private MenuElement path[];
|
||||
private MenuSelectionManager manager;
|
||||
|
@ -41,6 +41,7 @@ import java.util.EventObject;
|
||||
*
|
||||
* @author Arnaud Weber
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class PopupMenuEvent extends EventObject {
|
||||
/**
|
||||
* Constructs a PopupMenuEvent object.
|
||||
|
@ -244,6 +244,7 @@ public abstract class ComponentUI {
|
||||
* @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);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ package javax.swing.text;
|
||||
*
|
||||
* @author Timothy Prinzing
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BadLocationException extends Exception
|
||||
{
|
||||
/**
|
||||
|
@ -61,6 +61,7 @@ import javax.swing.DefaultListSelectionModel;
|
||||
*
|
||||
* @author Scott Violet
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class DefaultTreeSelectionModel implements Cloneable, Serializable, TreeSelectionModel
|
||||
{
|
||||
/** Property name for selectionMode. */
|
||||
@ -1073,7 +1074,7 @@ public class DefaultTreeSelectionModel implements Cloneable, Serializable, TreeS
|
||||
* @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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user