Index: java/awt/AWTKeyStroke.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/AWTKeyStroke.java,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 AWTKeyStroke.java --- java/awt/AWTKeyStroke.java 31 Jul 2004 16:39:15 -0000 1.5 +++ java/awt/AWTKeyStroke.java 10 Jan 2005 17:36:00 -0000 @@ -84,13 +84,15 @@ public class AWTKeyStroke implements Ser * under the assumption that garbage collection of a new keystroke is * easy when we find the old one that it matches in the cache. */ - private static final LinkedHashMap cache = new LinkedHashMap(11, 0.75f, true) + private static final LinkedHashMap cache = + new LinkedHashMap(11, 0.75f, true) { /** The largest the keystroke cache can grow. */ private static final int MAX_CACHE_SIZE = 2048; /** Prune stale entries. */ - protected boolean removeEldestEntry(Map.Entry eldest) + protected boolean removeEldestEntry(Map.Entry + eldest) { // XXX - FIXME Use Map.Entry, not just Entry as gcj 3.1 workaround. return size() > MAX_CACHE_SIZE; } @@ -112,7 +114,7 @@ public class AWTKeyStroke implements Ser * * @see #getAWTKeyStroke(String) */ - private static final HashMap vktable = new HashMap(); + private static final HashMap vktable = new HashMap(); static { // Using reflection saves the hassle of keeping this in sync with KeyEvent, @@ -227,7 +229,7 @@ public class AWTKeyStroke implements Ser * @throws IllegalArgumentException subclass doesn't have no-arg constructor * @throws ClassCastException subclass doesn't extend AWTKeyStroke */ - protected static void registerSubclass(final Class subclass) + protected static void registerSubclass(final Class subclass) { if (subclass == null) throw new IllegalArgumentException(); @@ -250,7 +252,8 @@ public class AWTKeyStroke implements Ser throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { - Constructor c = subclass.getDeclaredConstructor(null); + Constructor c = + subclass.getDeclaredConstructor((Class[])null); c.setAccessible(true); // Create a new instance, to make sure that we can, and // to cause any ClassCastException. @@ -576,7 +579,7 @@ public class AWTKeyStroke implements Ser */ protected Object readResolve() throws ObjectStreamException { - AWTKeyStroke s = (AWTKeyStroke) cache.get(this); + AWTKeyStroke s = cache.get(this); if (s != null) return s; cache.put(this, this); Index: java/awt/Component.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/Component.java,v retrieving revision 1.38 diff -u -3 -p -u -r1.38 Component.java --- java/awt/Component.java 31 Jul 2004 22:14:04 -0000 1.38 +++ java/awt/Component.java 10 Jan 2005 17:36:01 -0000 @@ -3496,7 +3496,8 @@ public abstract class Component * @see KeyboardFocusManager#UP_CYCLE_TRAVERSAL_KEYS * @since 1.4 */ - public void setFocusTraversalKeys(int id, Set keystrokes) + public void setFocusTraversalKeys(int id, + Set keystrokes) { if (keystrokes == null) { Index: java/awt/Container.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/Container.java,v retrieving revision 1.37 diff -u -3 -p -u -r1.37 Container.java --- java/awt/Container.java 31 Jul 2004 16:39:15 -0000 1.37 +++ java/awt/Container.java 10 Jan 2005 17:36:04 -0000 @@ -37,7 +37,6 @@ exception statement from your version. * package java.awt; -import java.awt.event.AWTEventListener; import java.awt.event.ContainerEvent; import java.awt.event.ContainerListener; import java.awt.event.MouseEvent; @@ -1092,7 +1091,8 @@ public class Container extends Component * * @since 1.4 */ - public void setFocusTraversalKeys(int id, Set keystrokes) + public void setFocusTraversalKeys(int id, + Set keystrokes) { if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && @@ -1180,7 +1180,8 @@ public class Container extends Component if (focusTraversalKeys == null) focusTraversalKeys = new Set[3]; - keystrokes = Collections.unmodifiableSet (new HashSet (keystrokes)); + keystrokes = + Collections.unmodifiableSet(new HashSet(keystrokes)); firePropertyChange (name, focusTraversalKeys[id], keystrokes); focusTraversalKeys[id] = keystrokes; @@ -1198,7 +1199,7 @@ public class Container extends Component * * @since 1.4 */ - public Set getFocusTraversalKeys (int id) + public Set getFocusTraversalKeys (int id) { if (id != KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS && id != KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS && Index: java/awt/GridBagLayout.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/GridBagLayout.java,v retrieving revision 1.15 diff -u -3 -p -u -r1.15 GridBagLayout.java --- java/awt/GridBagLayout.java 22 Jul 2004 19:45:38 -0000 1.15 +++ java/awt/GridBagLayout.java 10 Jan 2005 17:36:04 -0000 @@ -62,8 +62,8 @@ public class GridBagLayout // REMAINDER constraints. // Constraints kept in comptable are never modified, and constraints // kept in internalcomptable can be modified internally only. - protected Hashtable comptable; - private Hashtable internalcomptable; + protected Hashtable comptable; + private Hashtable internalcomptable; protected GridBagLayoutInfo layoutInfo; protected GridBagConstraints defaultConstraints; @@ -74,8 +74,8 @@ public class GridBagLayout public GridBagLayout () { - this.comptable = new Hashtable(); - this.internalcomptable = new Hashtable(); + this.comptable = new Hashtable(); + this.internalcomptable = new Hashtable(); this.defaultConstraints= new GridBagConstraints(); } @@ -466,16 +466,18 @@ public class GridBagLayout // Guaranteed to contain the last component added to the given row // or column, whose gridwidth/height is not REMAINDER. - HashMap lastInRow = new HashMap(); - HashMap lastInCol = new HashMap(); + HashMap lastInRow = new HashMap(); + HashMap lastInCol = new HashMap(); Component[] components = parent.getComponents(); // Components sorted by gridwidths/heights, // smallest to largest, with REMAINDER and RELATIVE at the end. // These are useful when determining sizes and weights. - ArrayList sortedByWidth = new ArrayList(components.length); - ArrayList sortedByHeight = new ArrayList(components.length); + ArrayList sortedByWidth = + new ArrayList(components.length); + ArrayList sortedByHeight = + new ArrayList(components.length); // STEP 1: first we figure out how many rows/columns for (int i = 0; i < components.length; i++) @@ -737,7 +739,7 @@ public class GridBagLayout // STEP 3: Determine sizes and weights for columns. for (int i = 0; i < sortedByWidth.size(); i++) { - Component component = (Component) sortedByWidth.get(i); + Component component = sortedByWidth.get(i); // If component is not visible we dont have to care about it. if (!component.isVisible()) @@ -851,7 +853,8 @@ public class GridBagLayout * width. Otherwise, sort by height. * FIXME: Use a better sorting algorithm. */ - private void sortBySpan (Component component, int span, ArrayList list, boolean sortByWidth) + private void sortBySpan (Component component, int span, + ArrayList list, boolean sortByWidth) { if (span == GridBagConstraints.REMAINDER || span == GridBagConstraints.RELATIVE) Index: java/awt/KeyboardFocusManager.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/KeyboardFocusManager.java,v retrieving revision 1.5 diff -u -3 -p -u -r1.5 KeyboardFocusManager.java --- java/awt/KeyboardFocusManager.java 22 Jul 2004 19:45:38 -0000 1.5 +++ java/awt/KeyboardFocusManager.java 10 Jan 2005 17:36:04 -0000 @@ -575,7 +575,7 @@ public abstract class KeyboardFocusManag * @see #UP_CYCLE_TRAVERSAL_KEYS * @see #DOWN_CYCLE_TRAVERSAL_KEYS */ - public Set getDefaultFocusTraversalKeys (int id) + public Set getDefaultFocusTraversalKeys (int id) { if (id < FORWARD_TRAVERSAL_KEYS || id > DOWN_CYCLE_TRAVERSAL_KEYS) throw new IllegalArgumentException (); Index: java/awt/dnd/DragGestureRecognizer.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/dnd/DragGestureRecognizer.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 DragGestureRecognizer.java --- java/awt/dnd/DragGestureRecognizer.java 23 Dec 2002 12:45:46 -0000 1.2 +++ java/awt/dnd/DragGestureRecognizer.java 10 Jan 2005 17:36:04 -0000 @@ -63,7 +63,7 @@ public abstract class DragGestureRecogni protected Component component; protected transient DragGestureListener dragGestureListener; protected int sourceActions; - protected ArrayList events = new ArrayList(); + protected ArrayList events = new ArrayList(); protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl) Index: java/awt/dnd/DropTargetContext.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/dnd/DropTargetContext.java,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 DropTargetContext.java --- java/awt/dnd/DropTargetContext.java 23 Mar 2003 05:40:57 -0000 1.6 +++ java/awt/dnd/DropTargetContext.java 10 Jan 2005 17:36:04 -0000 @@ -37,7 +37,6 @@ exception statement from your version. * package java.awt.dnd; -import java.awt.dnd.peer.DropTargetContextPeer; import java.io.Serializable; import java.io.IOException; import java.awt.Component; Index: java/awt/dnd/DropTargetEvent.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/dnd/DropTargetEvent.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 DropTargetEvent.java --- java/awt/dnd/DropTargetEvent.java 27 Sep 2002 04:48:15 -0000 1.1 +++ java/awt/dnd/DropTargetEvent.java 10 Jan 2005 17:36:04 -0000 @@ -41,6 +41,12 @@ import java.util.EventObject; public class DropTargetEvent extends EventObject { + + /** + * Serialization identifier for Sun 1.5 compatability + */ + private static final long serialVersionUID = 2821229066521922993L; + protected DropTargetContext context; public DropTargetEvent (DropTargetContext context) Index: java/awt/im/InputContext.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/im/InputContext.java,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 InputContext.java --- java/awt/im/InputContext.java 31 Jul 2004 22:14:04 -0000 1.6 +++ java/awt/im/InputContext.java 10 Jan 2005 17:36:04 -0000 @@ -83,7 +83,9 @@ public class InputContext /** * The list of installed input method descriptors. */ - private static final ArrayList descriptors = new ArrayList(); + private static final ArrayList descriptors + = new ArrayList(); + static { Enumeration e; @@ -120,7 +122,7 @@ public class InputContext { if (line.charAt(0) != '#') { - Class c = Class.forName(line); + Class c = Class.forName(line); descriptors.add((InputMethodDescriptor) c.newInstance()); } line = in.readLine().trim(); @@ -140,7 +142,8 @@ public class InputContext private InputMethod im; /** Map of locales to the most recently selected input method. */ - private final HashMap recent = new HashMap(); + private final HashMap recent + = new HashMap(); /** The list of acceptable character subsets. */ private Character.Subset[] subsets; Index: java/awt/im/spi/InputMethodContext.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/im/spi/InputMethodContext.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 InputMethodContext.java --- java/awt/im/spi/InputMethodContext.java 6 May 2002 16:19:20 -0000 1.2 +++ java/awt/im/spi/InputMethodContext.java 10 Jan 2005 17:36:04 -0000 @@ -37,7 +37,6 @@ exception statement from your version. * package java.awt.im.spi; -import java.awt.HeadlessException; import java.awt.Window; import java.awt.font.TextHitInfo; import java.awt.im.InputMethodRequests; Index: java/io/DeleteFileHelper.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/io/DeleteFileHelper.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 DeleteFileHelper.java --- java/io/DeleteFileHelper.java 21 May 2004 08:51:47 -0000 1.2 +++ java/io/DeleteFileHelper.java 10 Jan 2005 17:36:04 -0000 @@ -40,7 +40,6 @@ package java.io; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; -import java.util.Iterator; /** * @author Guilhem Lavaux (address@hidden) @@ -49,13 +48,13 @@ import java.util.Iterator; */ public final class DeleteFileHelper extends Thread { - private static ArrayList filesToDelete; + private static ArrayList filesToDelete; static synchronized void add(File file) { if (filesToDelete == null) { - filesToDelete = new ArrayList(); + filesToDelete = new ArrayList(); AccessController.doPrivileged(new PrivilegedAction() { @@ -80,13 +79,10 @@ public final class DeleteFileHelper exte private static synchronized void deleteFiles() { - Iterator it = filesToDelete.iterator(); - - while (it.hasNext()) + for (File file : filesToDelete) { try { - File file = (File) it.next(); file.delete(); } catch (Exception e) Index: java/io/ObjectInputStream.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/io/ObjectInputStream.java,v retrieving revision 1.43 diff -u -3 -p -u -r1.43 ObjectInputStream.java --- java/io/ObjectInputStream.java 22 Jul 2004 09:00:26 -0000 1.43 +++ java/io/ObjectInputStream.java 10 Jan 2005 17:36:04 -0000 @@ -1,5 +1,5 @@ /* ObjectInputStream.java -- Class used to read serialized objects - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -95,9 +95,9 @@ public class ObjectInputStream extends I this.blockDataInput = new DataInputStream(this); this.realInputStream = new DataInputStream(in); this.nextOID = baseWireHandle; - this.objectLookupTable = new Hashtable(); - this.validators = new Vector(); - this.classLookupTable = new Hashtable(); + this.objectLookupTable = new Hashtable(); + this.validators = new Vector(); + this.classLookupTable = new Hashtable(); setBlockDataMode(true); readStreamHeader(); } @@ -756,7 +756,7 @@ public class ObjectInputStream extends I return new ObjectStreamClass[0]; else { - Vector oscs = new Vector(); + Vector oscs = new Vector(); while (osc != null) { @@ -793,7 +793,7 @@ public class ObjectInputStream extends I } - protected Class resolveProxyClass(String[] intfs) + protected Class resolveProxyClass(String[] intfs) throws IOException, ClassNotFoundException { SecurityManager sm = System.getSecurityManager(); @@ -803,7 +803,7 @@ public class ObjectInputStream extends I ClassLoader cl = currentClassLoader(sm); - Class[] clss = new Class[intfs.length]; + Class[] clss = new Class[intfs.length]; if(cl == null) { for (int i = 0; i < intfs.length; i++) @@ -1832,14 +1832,14 @@ public class ObjectInputStream extends I private boolean useSubclassMethod; private int nextOID; private boolean resolveEnabled; - private Hashtable objectLookupTable; + private Hashtable objectLookupTable; private Object currentObject; private ObjectStreamClass currentObjectStreamClass; private boolean readDataFromBlock; private boolean isDeserializing; private boolean fieldsAlreadyRead; - private Vector validators; - private Hashtable classLookupTable; + private Vector validators; + private Hashtable classLookupTable; private GetField prereadFields; private static boolean dump = false && Configuration.DEBUG; Index: java/io/ObjectOutputStream.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/io/ObjectOutputStream.java,v retrieving revision 1.46 diff -u -3 -p -u -r1.46 ObjectOutputStream.java --- java/io/ObjectOutputStream.java 23 Jul 2004 22:29:01 -0000 1.46 +++ java/io/ObjectOutputStream.java 10 Jan 2005 17:36:04 -0000 @@ -42,7 +42,6 @@ import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; -import java.security.PrivilegedAction; import java.security.AccessController; import java.util.Hashtable; @@ -141,7 +140,7 @@ public class ObjectOutputStream extends replacementEnabled = false; isSerializing = false; nextOID = baseWireHandle; - OIDLookupTable = new Hashtable(); + OIDLookupTable = new Hashtable(); protocolVersion = defaultProtocolVersion; useSubclassMethod = false; writeStreamHeader(); @@ -1567,7 +1566,7 @@ public class ObjectOutputStream extends private boolean replacementEnabled; private boolean isSerializing; private int nextOID; - private Hashtable OIDLookupTable; + private Hashtable OIDLookupTable; private int protocolVersion; private boolean useSubclassMethod; private SetAccessibleAction setAccessible = new SetAccessibleAction(); Index: java/io/ObjectStreamClass.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/io/ObjectStreamClass.java,v retrieving revision 1.34 diff -u -3 -p -u -r1.34 ObjectStreamClass.java --- java/io/ObjectStreamClass.java 23 Jul 2004 22:29:01 -0000 1.34 +++ java/io/ObjectStreamClass.java 10 Jan 2005 17:36:04 -0000 @@ -233,7 +233,7 @@ public class ObjectStreamClass implement return new ObjectStreamClass[0]; else { - Vector oscs = new Vector(); + Vector oscs = new Vector(); while (osc != null) { @@ -861,7 +861,8 @@ outer: public static final ObjectStreamField[] NO_FIELDS = {}; - private static Hashtable classLookupTable = new Hashtable(); + private static Hashtable classLookupTable + = new Hashtable(); private static final NullOutputStream nullOutputStream = new NullOutputStream(); private static final Comparator interfaceComparator = new InterfaceComparator(); private static final Comparator memberComparator = new MemberComparator(); Index: java/io/ObjectStreamField.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/io/ObjectStreamField.java,v retrieving revision 1.18 diff -u -3 -p -u -r1.18 ObjectStreamField.java --- java/io/ObjectStreamField.java 17 May 2004 09:31:08 -0000 1.18 +++ java/io/ObjectStreamField.java 10 Jan 2005 17:36:05 -0000 @@ -52,7 +52,7 @@ import java.security.PrivilegedAction; public class ObjectStreamField implements Comparable { private String name; - private Class type; + private Class type; private String typename; private int offset = -1; // XXX make sure this is correct private boolean unshared; @@ -159,7 +159,7 @@ public class ObjectStreamField implement * * @return A class representing the type of the field. */ - public Class getType () + public Class getType () { return type; } @@ -347,7 +347,7 @@ public class ObjectStreamField implement */ void checkFieldType() throws InvalidClassException { - Class ftype = field.getType(); + Class ftype = field.getType(); if (!ftype.isAssignableFrom(type)) throw new InvalidClassException Index: java/lang/Byte.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Byte.java,v retrieving revision 1.22.2.4 diff -u -3 -p -u -r1.22.2.4 Byte.java --- java/lang/Byte.java 6 Nov 2004 22:11:53 -0000 1.22.2.4 +++ java/lang/Byte.java 10 Jan 2005 17:36:05 -0000 @@ -368,19 +368,4 @@ public final class Byte extends Number i return value - b.value; } - /** - * Behaves like compareTo(Byte) unless the Object - * is not a Byte. - * - * @param o the object to compare - * @return the comparison - * @throws ClassCastException if the argument is not a Byte - * @see #compareTo(Byte) - * @see Comparable - * @since 1.2 - */ - public int compareTo(Object o) - { - return compareTo((Byte) o); - } } Index: java/lang/Character.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Character.java,v retrieving revision 1.33.2.4 diff -u -3 -p -u -r1.33.2.4 Character.java --- java/lang/Character.java 6 Nov 2004 22:11:53 -0000 1.33.2.4 +++ java/lang/Character.java 10 Jan 2005 17:36:05 -0000 @@ -2246,23 +2246,6 @@ public final class Character implements } /** - * Compares an object to this Character. Assuming the object is a - * Character object, this method performs the same comparison as - * compareTo(Character). - * - * @param o object to compare - * @return the comparison value - * @throws ClassCastException if o is not a Character object - * @throws NullPointerException if o is null - * @see #compareTo(Character) - * @since 1.2 - */ - public int compareTo(Object o) - { - return compareTo((Character) o); - } - - /** * Returns an Character object wrapping the value. * In contrast to the Character constructor, this method * will cache some values. It is used by boxing conversion. Index: java/lang/Class.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Class.java,v retrieving revision 1.22.2.5 diff -u -3 -p -u -r1.22.2.5 Class.java --- java/lang/Class.java 7 Jan 2005 03:42:30 -0000 1.22.2.5 +++ java/lang/Class.java 10 Jan 2005 17:36:05 -0000 @@ -86,7 +86,7 @@ import java.util.HashSet; * @since 1.0 * @see ClassLoader */ -public final class Class implements Serializable +public final class Class implements Serializable { /** * Compatible with JDK 1.0+. @@ -308,7 +308,7 @@ public final class Class implements S * @see #getConstructors() * @since 1.1 */ - public Constructor getConstructor(Class... types) + public Constructor getConstructor(Class... types) throws NoSuchMethodException { memberAccessCheck(Member.PUBLIC); @@ -354,7 +354,7 @@ public final class Class implements S * @see #getDeclaredConstructors() * @since 1.1 */ - public Constructor getDeclaredConstructor(Class... types) + public Constructor getDeclaredConstructor(Class... types) throws NoSuchMethodException { memberAccessCheck(Member.DECLARED); @@ -1261,7 +1261,7 @@ public final class Class implements S * @throws ClassCastException if obj is not an instance of this class * @since 1.5 */ - public K cast(Object obj) + public T cast(Object obj) { return VMClass.cast(obj, this); } @@ -1321,4 +1321,53 @@ public final class Class implements S sm.checkPackageAccess(pkg.getName()); } } + + /** + * Returns the enumeration constants of this class, or + * null if this class is not an Enum. + * + * @return an array of Enum constants + * associated with this class, or null if this + * class is not an enum. + */ + public T[] getEnumConstants() + { + if (isEnum()) + { + try + { + return (T[]) + getMethod("values", null).invoke(null,null); + } + catch (NoSuchMethodException exception) + { + throw new Error("Enum lacks values() method"); + } + catch (IllegalAccessException exception) + { + throw new Error("Unable to access Enum class"); + } + catch (InvocationTargetException exception) + { + throw new + RuntimeException("The values method threw an exception", + exception); + } + } + else + { + return null; + } + } + + /** + * Returns true if this class is an Enum. + * + * @return true if this is an enumeration class. + */ + public boolean isEnum() + { + return getSuperclass() == Enum.class; + } + } Index: java/lang/Double.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Double.java,v retrieving revision 1.34.2.3 diff -u -3 -p -u -r1.34.2.3 Double.java --- java/lang/Double.java 6 Nov 2004 22:11:53 -0000 1.34.2.3 +++ java/lang/Double.java 10 Jan 2005 17:36:06 -0000 @@ -508,22 +508,6 @@ public final class Double extends Number } /** - * Behaves like compareTo(Double) unless the Object - * is not an Double. - * - * @param o the object to compare - * @return the comparison - * @throws ClassCastException if the argument is not a Double - * @see #compareTo(Double) - * @see Comparable - * @since 1.2 - */ - public int compareTo(Object o) - { - return compare(value, ((Double) o).value); - } - - /** * Behaves like new Double(x).compareTo(new Double(y)); in * other words this compares two doubles, special casing NaN and zero, * without the overhead of objects. Index: java/lang/Float.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Float.java,v retrieving revision 1.28.2.3 diff -u -3 -p -u -r1.28.2.3 Float.java --- java/lang/Float.java 6 Nov 2004 22:11:53 -0000 1.28.2.3 +++ java/lang/Float.java 10 Jan 2005 17:36:06 -0000 @@ -505,22 +505,6 @@ public final class Float extends Number } /** - * Behaves like compareTo(Float) unless the Object - * is not an Float. - * - * @param o the object to compare - * @return the comparison - * @throws ClassCastException if the argument is not a Float - * @see #compareTo(Float) - * @see Comparable - * @since 1.2 - */ - public int compareTo(Object o) - { - return compare(value, ((Float) o).value); - } - - /** * Behaves like new Float(x).compareTo(new Float(y)); in * other words this compares two floats, special casing NaN and zero, * without the overhead of objects. Index: java/lang/InheritableThreadLocal.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/InheritableThreadLocal.java,v retrieving revision 1.7.2.3 diff -u -3 -p -u -r1.7.2.3 InheritableThreadLocal.java --- java/lang/InheritableThreadLocal.java 7 Jan 2005 03:42:30 -0000 1.7.2.3 +++ java/lang/InheritableThreadLocal.java 10 Jan 2005 17:36:06 -0000 @@ -72,8 +72,8 @@ public class InheritableThreadLocal e * equals. */ private static final - Map>> threadMap - = Collections.synchronizedMap(new WeakHashMap>>()); + Map> threadMap + = Collections.synchronizedMap(new WeakHashMap>()); /** * Creates a new InheritableThreadLocal that has no values associated @@ -84,10 +84,10 @@ public class InheritableThreadLocal e Thread currentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will // ever modify the returned heritage and threadMap is a synchronizedMap. - List> heritage = threadMap.get(currentThread); + ArrayList heritage = threadMap.get(currentThread); if (heritage == null) { - heritage = new ArrayList>(); + heritage = new ArrayList(); threadMap.put(currentThread, heritage); } heritage.add(this); @@ -110,7 +110,7 @@ public class InheritableThreadLocal e /** * Generates the childValues of all InheritableThreadLocals * that are in the heritage of the current Thread for the newly created - * childThread. Should be called from the contructor Thread. + * childThread. Should be called from the constructor Thread. * * @param childThread the newly created thread, to inherit from this thread * @see Thread#Thread(ThreadGroup, Runnable, String) @@ -121,25 +121,25 @@ public class InheritableThreadLocal e Thread parentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will // ever modify the returned heritage and threadMap is a synchronizedMap. - ArrayList> heritage + ArrayList heritage = threadMap.get(parentThread); if (heritage != null) { threadMap.put(childThread, - (ArrayList>) heritage.clone()); + (ArrayList) heritage.clone()); // Perform the inheritance. - Iterator> it = heritage.iterator(); + Iterator it = heritage.iterator(); int i = heritage.size(); while (--i >= 0) { - InheritableThreadLocal local = it.next(); - T parentValue = local.valueMap.get(parentThread); + InheritableThreadLocal local = it.next(); + Object parentValue = local.valueMap.get(parentThread); if (parentValue != null) { - T childValue = local.childValue(parentValue == (T) NULL + Object childValue = local.childValue(parentValue == NULL ? null : parentValue); local.valueMap.put(childThread, (childValue == null - ? (T) NULL : parentValue)); + ? NULL : parentValue)); } } } Index: java/lang/Integer.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Integer.java,v retrieving revision 1.29.2.4 diff -u -3 -p -u -r1.29.2.4 Integer.java --- java/lang/Integer.java 6 Nov 2004 22:11:53 -0000 1.29.2.4 +++ java/lang/Integer.java 10 Jan 2005 17:36:06 -0000 @@ -524,22 +524,6 @@ public final class Integer extends Numbe } /** - * Behaves like compareTo(Integer) unless the Object - * is not an Integer. - * - * @param o the object to compare - * @return the comparison - * @throws ClassCastException if the argument is not an Integer - * @see #compareTo(Integer) - * @see Comparable - * @since 1.2 - */ - public int compareTo(Object o) - { - return compareTo((Integer) o); - } - - /** * Return the number of bits set in x. * @param x value to examine * @since 1.5 Index: java/lang/Long.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Long.java,v retrieving revision 1.19.2.4 diff -u -3 -p -u -r1.19.2.4 Long.java --- java/lang/Long.java 6 Nov 2004 22:11:53 -0000 1.19.2.4 +++ java/lang/Long.java 10 Jan 2005 17:36:06 -0000 @@ -515,23 +515,6 @@ public final class Long extends Number i } /** - * Behaves like compareTo(Long) unless the Object - * is not a Long. - * - * @param o the object to compare - * @return the comparison - * @throws ClassCastException if the argument is not a Long - * @see #compareTo(Long) - * @see Comparable - * @since 1.2 - */ - public int compareTo(Object o) - { - return compareTo((Long) o); - } - - - /** * Return the number of bits set in x. * @param x value to examine * @since 1.5 Index: java/lang/Short.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Short.java,v retrieving revision 1.15.2.3 diff -u -3 -p -u -r1.15.2.3 Short.java --- java/lang/Short.java 6 Nov 2004 22:11:53 -0000 1.15.2.3 +++ java/lang/Short.java 10 Jan 2005 17:36:06 -0000 @@ -369,22 +369,6 @@ public final class Short extends Number } /** - * Behaves like compareTo(Short) unless the Object - * is not a Short. - * - * @param o the object to compare - * @return the comparison - * @throws ClassCastException if the argument is not a Short - * @see #compareTo(Short) - * @see Comparable - * @since 1.2 - */ - public int compareTo(Object o) - { - return compareTo((Short)o); - } - - /** * Reverse the bytes in val. * @since 1.5 */ Index: java/util/AbstractQueue.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/Attic/AbstractQueue.java,v retrieving revision 1.1.2.2 diff -u -3 -p -u -r1.1.2.2 AbstractQueue.java --- java/util/AbstractQueue.java 16 Aug 2004 19:23:49 -0000 1.1.2.2 +++ java/util/AbstractQueue.java 10 Jan 2005 17:36:06 -0000 @@ -41,25 +41,26 @@ package java.util; /** * @since 1.5 */ -public class AbstractQueue extends AbstractCollection implements Queue +public abstract class AbstractQueue extends AbstractCollection + implements Queue { protected AbstractQueue() { } - public boolean add(T value) + public boolean add(E value) { if (offer(value)) return true; throw new IllegalStateException(); } - public boolean addAll(Collection c) + public boolean addAll(Collection c) { if (c == this) throw new IllegalArgumentException(); boolean result = false; - for (T val : c) + for (E val : c) { if (add(val)) result = true; @@ -73,17 +74,17 @@ public class AbstractQueue extends Ab ; } - public T element() + public E element() { - T result = peek(); + E result = peek(); if (result == null) throw new NoSuchElementException(); return result; } - public T remove() + public E remove() { - T result = poll(); + E result = poll(); if (result == null) throw new NoSuchElementException(); return result; Index: java/util/Collection.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/Collection.java,v retrieving revision 1.9.2.2 diff -u -3 -p -u -r1.9.2.2 Collection.java --- java/util/Collection.java 4 Nov 2004 05:08:15 -0000 1.9.2.2 +++ java/util/Collection.java 10 Jan 2005 17:36:06 -0000 @@ -152,7 +152,7 @@ public interface Collection extends I * collection does not support null values. * @throws NullPointerException if c itself is null. */ - boolean containsAll(Collection c); + boolean containsAll(Collection c); /** * Test whether this collection is equal to some object. The Collection Index: java/util/EnumMap.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/Attic/EnumMap.java,v retrieving revision 1.1.2.2 diff -u -3 -p -u -r1.1.2.2 EnumMap.java --- java/util/EnumMap.java 7 Jan 2005 03:42:30 -0000 1.1.2.2 +++ java/util/EnumMap.java 10 Jan 2005 17:36:06 -0000 @@ -63,7 +63,7 @@ public class EnumMap, public EnumMap(Class keyType) { - store = new V[keyType.getEnumConstants().length]; + store = (V[]) new Object[keyType.getEnumConstants().length]; Arrays.fill(store, emptySlot); cardinality = 0; enumClass = keyType; Index: java/util/LinkedHashMap.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/LinkedHashMap.java,v retrieving revision 1.6 diff -u -3 -p -u -r1.6 LinkedHashMap.java --- java/util/LinkedHashMap.java 6 Nov 2002 14:03:43 -0000 1.6 +++ java/util/LinkedHashMap.java 10 Jan 2005 17:36:06 -0000 @@ -106,7 +106,7 @@ package java.util; * @since 1.4 * @status updated to 1.4 */ -public class LinkedHashMap extends HashMap +public class LinkedHashMap extends HashMap { /** * Compatible with JDK 1.4. @@ -242,7 +242,7 @@ public class LinkedHashMap extends HashM * are not cloned in this constructor. * @throws NullPointerException if m is null */ - public LinkedHashMap(Map m) + public LinkedHashMap(Map m) { super(m); accessOrder = false; @@ -334,7 +334,7 @@ public class LinkedHashMap extends HashM * @see #put(Object, Object) * @see #containsKey(Object) */ - public Object get(Object key) + public V get(Object key) { int idx = hash(key); HashEntry e = buckets[idx]; @@ -389,7 +389,7 @@ public class LinkedHashMap extends HashM * earliest element inserted. * @return true if eldest should be removed */ - protected boolean removeEldestEntry(Map.Entry eldest) + protected boolean removeEldestEntry(Map.Entry eldest) { return false; } Index: java/util/PriorityQueue.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/Attic/PriorityQueue.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 PriorityQueue.java --- java/util/PriorityQueue.java 16 Aug 2004 19:23:49 -0000 1.1.2.1 +++ java/util/PriorityQueue.java 10 Jan 2005 17:36:06 -0000 @@ -71,7 +71,7 @@ public class PriorityQueue extends Ab this(Math.max(1, (int) (1.1 * c.size())), null); // Special case where we can find the comparator to use. - if (c instanceof SortedSet) + if (c instanceof SortedSet) { SortedSet ss = (SortedSet) c; this.comparator = ss.comparator(); @@ -84,7 +84,7 @@ public class PriorityQueue extends Ab storage[i++] = val; } } - else if (c instanceof PriorityQueue) + else if (c instanceof PriorityQueue) { PriorityQueue pq = (PriorityQueue) c; this.comparator = pq.comparator(); @@ -103,7 +103,7 @@ public class PriorityQueue extends Ab public PriorityQueue(int cap, Comparator comp) { this.used = 0; - this.storage = new E[cap]; + this.storage = (E[]) new Object[cap]; this.comparator = comp; } @@ -158,9 +158,9 @@ public class PriorityQueue extends Ab return storage[index]; } - void remove() + public void remove() { - remove(index); + PriorityQueue.this.remove(index); } }; } @@ -317,7 +317,7 @@ public class PriorityQueue extends Ab void resize() { - E[] new_data = new E[2 * storage.length]; + E[] new_data = (E[]) new Object[2 * storage.length]; System.arraycopy(storage, 0, new_data, 0, storage.length); storage = new_data; } Index: java/util/WeakHashMap.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/WeakHashMap.java,v retrieving revision 1.18 diff -u -3 -p -u -r1.18 WeakHashMap.java --- java/util/WeakHashMap.java 22 Apr 2004 11:24:39 -0000 1.18 +++ java/util/WeakHashMap.java 10 Jan 2005 17:36:07 -0000 @@ -82,9 +82,9 @@ import java.lang.ref.WeakReference; * @see WeakReference * @see LinkedHashMap * @since 1.2 - * @status updated to 1.4 + * @status updated to 1.4 (partial 1.5) */ -public class WeakHashMap extends AbstractMap implements Map +public class WeakHashMap extends AbstractMap { // WARNING: WeakHashMap is a CORE class in the bootstrap cycle. See the // comments in vm/reference/java/lang/Runtime for implications of this fact. @@ -561,7 +561,7 @@ public class WeakHashMap extends Abstrac * @throws NullPointerException if m is null * @since 1.3 */ - public WeakHashMap(Map m) + public WeakHashMap(Map m) { this(m.size(), DEFAULT_LOAD_FACTOR); putAll(m); @@ -757,7 +757,7 @@ public class WeakHashMap extends Abstrac * the key wasn't in this map, or if the mapped value was * explicitly set to null. */ - public Object get(Object key) + public V get(Object key) { cleanQueue(); WeakBucket.WeakEntry entry = internalGet(key); @@ -772,7 +772,7 @@ public class WeakHashMap extends Abstrac * null if the key wasn't in this map, or if the mapped value * was explicitly set to null. */ - public Object put(Object key, Object value) + public Object put(K key, V value) { cleanQueue(); WeakBucket.WeakEntry entry = internalGet(key); @@ -794,7 +794,7 @@ public class WeakHashMap extends Abstrac * null if the key wasn't in this map, or if the mapped value was * explicitly set to null. */ - public Object remove(Object key) + public V remove(Object key) { cleanQueue(); WeakBucket.WeakEntry entry = internalGet(key); @@ -814,7 +814,7 @@ public class WeakHashMap extends Abstrac * this weak hash map. * @return a set representation of the entries. */ - public Set entrySet() + public Set> entrySet() { cleanQueue(); return theEntrySet; @@ -849,7 +849,7 @@ public class WeakHashMap extends Abstrac * this weak hash map. * @return a set representation of the keys. */ - public Set keySet() + public Set keySet() { cleanQueue(); return super.keySet(); @@ -860,7 +860,7 @@ public class WeakHashMap extends Abstrac * key already exists in this map, its value is replaced. * @param m the map to copy in */ - public void putAll(Map m) + public void putAll(Map m) { super.putAll(m); } @@ -873,7 +873,7 @@ public class WeakHashMap extends Abstrac * this weak hash map. * @return a collection representation of the values. */ - public Collection values() + public Collection values() { cleanQueue(); return super.values();