Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.2386.2.41 diff -u -3 -p -u -r1.2386.2.41 ChangeLog --- ChangeLog 2 Jan 2005 22:43:44 -0000 1.2386.2.41 +++ ChangeLog 7 Jan 2005 03:38:55 -0000 @@ -1,3 +1,36 @@ +2005-01-07 Andrew John Hughes + + * java/io/PrintStream.java: + (PrintStream(String, String)): added UnsupportedEncodingException + (PrintStream(File, String)): added UnsupportedEncodingException + * java/lang/Deprecated.java: + Changed import to java.lang.annotation.RetentionPolicy.RUNTIME + * java/lang/InheritableThreadLocal.java: + Corrected typo `Locals' to `Local' + * java/lang/String.java: + (compareTo(Object)): removed + * java/lang/annotation/AnnotationTypeMismatchException.java: + Added import of java.lang.reflect.Method + * java/lang/annotation/Documentation.java: + Added import of java.lang.annotation.RetentionPolicy.RUNTIME + * java/lang/annotation/Inherited.java: + Added import of java.lang.annotation.RetentionPolicy.RUNTIME + Added import of java.lang.annotation.ElementType.ANNOTATION_TYPE + * java/lang/annotation/Retention.java: ditto + * java/lang/annotation/Target.java: ditto + * java/lang/reflect/AnnotatedElement.java: + Added import of java.lang.annotation.Annotation + * java/util/AbstractCollection.java: + (toArray(T[])): converted returned type to T[] from Object[] + * java/util/EnumMap.java: + Added import of java.io.Serializable + * java/util/EnumSet.java: ditto + * java/util/TreeSet.java: + (TreeSet(SortedMap backingMap)): type of input parameter + corrected. + * vm/reference/java/lang/VMClass.java: + (cast(Object, Class)): typed method parameterically + 2005-01-02 Tom Tromey * java/io/PrintStream.java: Implement Appendable. Index: java/io/PrintStream.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/io/PrintStream.java,v retrieving revision 1.19.2.1 diff -u -3 -p -u -r1.19.2.1 PrintStream.java --- java/io/PrintStream.java 2 Jan 2005 22:43:45 -0000 1.19.2.1 +++ java/io/PrintStream.java 7 Jan 2005 03:38:56 -0000 @@ -53,8 +53,9 @@ package java.io; *

* This class converts char's into byte's using the system default encoding. * - * @author Aaron M. Renn - * @author Tom Tromey + * @author Aaron M. Renn (address@hidden) + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) */ public class PrintStream extends FilterOutputStream implements Appendable { @@ -137,7 +138,8 @@ public class PrintStream extends FilterO } /** @since 1.5 */ - public PrintStream (String filename) throws FileNotFoundException + public PrintStream (String filename) + throws FileNotFoundException { super (new FileOutputStream (filename)); pw = new PrintWriter (new OutputStreamWriter (out), false); @@ -146,7 +148,7 @@ public class PrintStream extends FilterO /** @since 1.5 */ public PrintStream (String filename, String encoding) - throws FileNotFoundException + throws FileNotFoundException, UnsupportedEncodingException { super (new FileOutputStream (filename)); pw = new PrintWriter (new OutputStreamWriter (out, encoding), false); @@ -163,7 +165,7 @@ public class PrintStream extends FilterO /** @since 1.5 */ public PrintStream (File file, String encoding) - throws FileNotFoundException + throws FileNotFoundException, UnsupportedEncodingException { super (new FileOutputStream (file)); pw = new PrintWriter (new OutputStreamWriter (out, encoding), false); Index: java/lang/Class.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Class.java,v retrieving revision 1.22.2.4 diff -u -3 -p -u -r1.22.2.4 Class.java --- java/lang/Class.java 1 Nov 2004 15:57:08 -0000 1.22.2.4 +++ java/lang/Class.java 7 Jan 2005 03:38:56 -0000 @@ -81,8 +81,8 @@ import java.util.HashSet; * see address@hidden ObjectStreamClass}. * * @author John Keiser - * @author Eric Blake - * @author Tom Tromey + * @author Eric Blake (address@hidden) + * @author Tom Tromey (address@hidden) * @since 1.0 * @see ClassLoader */ Index: java/lang/Deprecated.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/Attic/Deprecated.java,v retrieving revision 1.1.2.5 diff -u -3 -p -u -r1.1.2.5 Deprecated.java --- java/lang/Deprecated.java 27 Sep 2004 19:09:45 -0000 1.1.2.5 +++ java/lang/Deprecated.java 7 Jan 2005 03:38:56 -0000 @@ -1,5 +1,5 @@ /* Deprecated - Annotation to mark elements as deprecated - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,13 +39,15 @@ package java.lang; import java.lang.annotation.Documented; import java.lang.annotation.Retention; -import static java.lang.annotation.RetentionPolicy.SOURCE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; /** * This annotation is used as a marker to indicate that the annotated * declaration is deprecated and should not be used in new code. * This replaces the old "@deprecated" javadoc tag. * + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @since 1.5 */ @Documented @Retention(RUNTIME) Index: java/lang/InheritableThreadLocal.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/InheritableThreadLocal.java,v retrieving revision 1.7.2.2 diff -u -3 -p -u -r1.7.2.2 InheritableThreadLocal.java --- java/lang/InheritableThreadLocal.java 8 Aug 2004 06:38:26 -0000 1.7.2.2 +++ java/lang/InheritableThreadLocal.java 7 Jan 2005 03:38:56 -0000 @@ -1,5 +1,5 @@ /* InheritableThreadLocal -- a ThreadLocal which inherits values across threads - Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -55,8 +55,10 @@ import java.util.WeakHashMap; * is in transferring items like User ID or Transaction ID across threads * automatically. * - * @author Mark Wielaard - * @author Eric Blake + * @author Mark Wielaard (address@hidden) + * @author Eric Blake (address@hidden) + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @see ThreadLocal * @since 1.2 * @status updated to 1.4 @@ -70,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 Index: java/lang/String.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/String.java,v retrieving revision 1.58.2.3 diff -u -3 -p -u -r1.58.2.3 String.java --- java/lang/String.java 19 Dec 2004 06:32:51 -0000 1.58.2.3 +++ java/lang/String.java 7 Jan 2005 03:38:57 -0000 @@ -1,5 +1,5 @@ /* String.java -- immutable character sequences; the object of string literals - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -72,6 +72,8 @@ import java.util.regex.Pattern; * @author Paul N. Fisher * @author Eric Blake (address@hidden) * @author Per Bothner (address@hidden) + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @since 1.0 * @status updated to 1.4; but could use better data sharing via offset field */ @@ -727,22 +729,6 @@ public final class String } /** - * Behaves like compareTo(java.lang.String) unless the Object - * is not a String. Then it throws a - * ClassCastException. - * - * @param o the object to compare against - * @return the comparison - * @throws NullPointerException if o is null - * @throws ClassCastException if o is not a String - * @since 1.2 - */ - public int compareTo(Object o) - { - return compareTo((String) o); - } - - /** * Compares this String and another String (case insensitive). This * comparison is similar to equalsIgnoreCase, in that it ignores * locale and multi-characater capitalization, and compares characters Index: java/lang/annotation/AnnotationTypeMismatchException.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/annotation/Attic/AnnotationTypeMismatchException.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 AnnotationTypeMismatchException.java --- java/lang/annotation/AnnotationTypeMismatchException.java 7 Aug 2004 19:01:27 -0000 1.1.2.1 +++ java/lang/annotation/AnnotationTypeMismatchException.java 7 Jan 2005 03:38:57 -0000 @@ -1,5 +1,5 @@ /* AnnotationTypeMismatchException.java - Thrown when annotation has changed - Copyright (C) 2004 Free Software Foundation + Copyright (C) 2004, 2005 Free Software Foundation This file is part of GNU Classpath. @@ -37,7 +37,11 @@ exception statement from your version. * package java.lang.annotation; +import java.lang.reflect.Method; + /** + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @since 1.5 */ public class AnnotationTypeMismatchException extends RuntimeException Index: java/lang/annotation/Documented.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/annotation/Attic/Documented.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 Documented.java --- java/lang/annotation/Documented.java 7 Aug 2004 19:01:27 -0000 1.1.2.1 +++ java/lang/annotation/Documented.java 7 Jan 2005 03:38:57 -0000 @@ -1,5 +1,5 @@ /* Documented.java - Indicates documented source element - Copyright (C) 2004 Free Software Foundation + Copyright (C) 2004, 2005 Free Software Foundation This file is part of GNU Classpath. @@ -37,7 +37,11 @@ exception statement from your version. * package java.lang.annotation; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + /** + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @since 1.5 */ @Documented @Retention(RUNTIME) Index: java/lang/annotation/Inherited.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/annotation/Attic/Inherited.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 Inherited.java --- java/lang/annotation/Inherited.java 7 Aug 2004 19:01:27 -0000 1.1.2.1 +++ java/lang/annotation/Inherited.java 7 Jan 2005 03:38:57 -0000 @@ -1,5 +1,5 @@ /* Inherited.java - Indicates inherited annotation - Copyright (C) 2004 Free Software Foundation + Copyright (C) 2004, 2005 Free Software Foundation This file is part of GNU Classpath. @@ -37,7 +37,12 @@ exception statement from your version. * package java.lang.annotation; +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; + /** + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @since 1.5 */ @Documented @Retention(RUNTIME) @Target(ANNOTATION_TYPE) Index: java/lang/annotation/Retention.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/annotation/Attic/Retention.java,v retrieving revision 1.1.2.2 diff -u -3 -p -u -r1.1.2.2 Retention.java --- java/lang/annotation/Retention.java 18 Sep 2004 23:02:32 -0000 1.1.2.2 +++ java/lang/annotation/Retention.java 7 Jan 2005 03:38:57 -0000 @@ -1,5 +1,5 @@ /* Retention.java - Retention policy for an annotation - Copyright (C) 2004 Free Software Foundation + Copyright (C) 2004, 2005 Free Software Foundation This file is part of GNU Classpath. @@ -37,10 +37,15 @@ exception statement from your version. * package java.lang.annotation; +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; + /** * This annotation is used to specify the desired lifetime of another * annotation. * + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @see RetentionPolicy * @since 1.5 */ Index: java/lang/annotation/Target.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/annotation/Attic/Target.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 Target.java --- java/lang/annotation/Target.java 7 Aug 2004 19:01:27 -0000 1.1.2.1 +++ java/lang/annotation/Target.java 7 Jan 2005 03:38:57 -0000 @@ -1,5 +1,5 @@ /* Target.java - Indicate where an annotation may be applied - Copyright (C) 2004 Free Software Foundation + Copyright (C) 2004, 2005 Free Software Foundation This file is part of GNU Classpath. @@ -37,7 +37,12 @@ exception statement from your version. * package java.lang.annotation; +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static java.lang.annotation.ElementType.ANNOTATION_TYPE; + /** + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @since 1.5 */ @Documented @Retention(RUNTIME) @Target(ANNOTATION_TYPE) Index: java/lang/reflect/AnnotatedElement.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/reflect/Attic/AnnotatedElement.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 AnnotatedElement.java --- java/lang/reflect/AnnotatedElement.java 27 Aug 2004 00:05:03 -0000 1.1.2.1 +++ java/lang/reflect/AnnotatedElement.java 7 Jan 2005 03:38:57 -0000 @@ -1,5 +1,5 @@ /* AnnotatedElement.java - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,6 +38,13 @@ exception statement from your version. * package java.lang.reflect; +import java.lang.annotation.Annotation; + +/** + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) + * @since 1.5 + */ public interface AnnotatedElement { T getAnnotation(Class annoType); Index: java/util/AbstractCollection.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/AbstractCollection.java,v retrieving revision 1.14.2.2 diff -u -3 -p -u -r1.14.2.2 AbstractCollection.java --- java/util/AbstractCollection.java 8 Aug 2004 06:38:26 -0000 1.14.2.2 +++ java/util/AbstractCollection.java 7 Jan 2005 03:38:57 -0000 @@ -1,5 +1,5 @@ /* AbstractCollection.java -- Abstract implementation of most of Collection - Copyright (C) 1998, 2000, 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 1998, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -61,7 +61,9 @@ import java.lang.reflect.Array; * * @author Original author unknown * @author Bryce McKinlay - * @author Eric Blake + * @author Eric Blake (address@hidden) + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @see Collection * @see AbstractSet * @see AbstractList @@ -399,15 +401,24 @@ public abstract class AbstractCollection { int size = size(); if (a.length < size) - a = (Object[]) Array.newInstance(a.getClass().getComponentType(), + a = (T[]) Array.newInstance(a.getClass().getComponentType(), size); else if (a.length > size) a[size] = null; Iterator itr = iterator(); for (int pos = 0; pos < size; pos++) - a[pos] = itr.next(); - + { + try + { + a[pos] = (T) (itr.next()); + } + catch (ClassCastException exception) + { + throw new ArrayStoreException("The element is of the wrong type "+ + "for storing in this array."); + } + } return a; } Index: java/util/EnumMap.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/Attic/EnumMap.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 EnumMap.java --- java/util/EnumMap.java 3 Sep 2004 20:59:08 -0000 1.1.2.1 +++ java/util/EnumMap.java 7 Jan 2005 03:38:58 -0000 @@ -1,5 +1,5 @@ /* EnumMap.java - Map where keys are enum constants - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,7 +38,14 @@ exception statement from your version. * package java.util; -/** @since 1.5 */ +import java.io.Serializable; + +/** + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) + * @since 1.5 + */ + public class EnumMap, V> extends AbstractMap implements Cloneable, Serializable Index: java/util/EnumSet.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/Attic/EnumSet.java,v retrieving revision 1.1.2.1 diff -u -3 -p -u -r1.1.2.1 EnumSet.java --- java/util/EnumSet.java 3 Sep 2004 20:59:08 -0000 1.1.2.1 +++ java/util/EnumSet.java 7 Jan 2005 03:38:58 -0000 @@ -1,5 +1,5 @@ /* EnumSet.java - Set of enum objects - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,7 +38,14 @@ exception statement from your version. * package java.util; -/** @since 1.5 */ +import java.io.Serializable; + +/** + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) + * @since 1.5 + */ + // FIXME: serialization is special. public class EnumSet> extends AbstractSet Index: java/util/TreeSet.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/TreeSet.java,v retrieving revision 1.15.2.2 diff -u -3 -p -u -r1.15.2.2 TreeSet.java --- java/util/TreeSet.java 8 Aug 2004 06:38:26 -0000 1.15.2.2 +++ java/util/TreeSet.java 7 Jan 2005 03:38:58 -0000 @@ -1,5 +1,5 @@ /* TreeSet.java -- a class providing a TreeMap-backed SortedSet - Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -67,7 +67,9 @@ import java.io.Serializable; * * @author Jon Zeppieri * @author Bryce McKinlay - * @author Eric Blake + * @author Eric Blake (address@hidden) + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) * @see Collection * @see Set * @see HashSet @@ -158,7 +160,7 @@ public class TreeSet extends Abstract * * @param backingMap the submap */ - private TreeSet(SortedMap backingMap) + private TreeSet(SortedMap backingMap) { map = backingMap; } Index: vm/reference/java/lang/VMClass.java =================================================================== RCS file: /cvsroot/classpath/classpath/vm/reference/java/lang/VMClass.java,v retrieving revision 1.10.2.1 diff -u -3 -p -u -r1.10.2.1 VMClass.java --- vm/reference/java/lang/VMClass.java 7 Aug 2004 00:27:06 -0000 1.10.2.1 +++ vm/reference/java/lang/VMClass.java 7 Jan 2005 03:38:58 -0000 @@ -1,5 +1,5 @@ /* VMClass.java -- VM Specific Class methods - Copyright (C) 2003, 2004 Free Software Foundation + Copyright (C) 2003, 2004, 2005 Free Software Foundation This file is part of GNU Classpath. @@ -49,9 +49,11 @@ import java.lang.reflect.Method; /** * - * @author Etienne Gagnon - * @author Archie Cobbs - * @author C. Brian Jones + * @author Etienne Gagnon (address@hidden) + * @author Archie Cobbs (address@hidden) + * @author C. Brian Jones (address@hidden) + * @author Tom Tromey (address@hidden) + * @author Andrew John Hughes (address@hidden) */ final class VMClass { @@ -293,5 +295,5 @@ final class VMClass /** * Downcast object to the class' type. */ - static native Object cast(Object obj, Class k); + static native K cast(Object obj, Class k); } // class VMClass