I'm committing the attached patch to merge some simple classes that currently reside only in the generics branch. These are mainly just marker interfaces and exceptions. They compile fine in the HEAD branch (no 1.5 features -- they compile fine with jikes and gcj 3.3.5) and are functionally simplistic.
2005-02-20 Andrew John Hughes <[EMAIL PROTECTED]>
Merge of interfaces and exceptions to HEAD from
the generics branch.
* java/lang/StringBuilder.java: Serial version updated.
* java/lang/annotation/AnnotationTypeMismatchException.java: Likewise.
Changes from generics branch:
2005-02-20 Andrew John Hughes <[EMAIL PROTECTED]>
* java/io/Closeable.java: Documented.
* java/io/Flushable.java: Documented.
* java/lang/Appendable.java: Corrected line overrun.
* java/lang/Readable.java: Corrected indentation.
* java/lang/TypeNotPresentException.java: Documented.
* java/lang/annotation/AnnotationFormatError.java: Likewise.
* java/lang/annotation/AnnotationTypeMismatchException.java: Likewise.
* java/lang/reflect/GenericArrayType.java: Likewise.
* java/lang/reflect/GenericSignatureFormatError.java: Likewise.
* java/lang/reflect/ParameterizedType.java: Likewise.
* java/lang/reflect/Type.java: Likewise.
* java/lang/reflect/WildcardType.java: Likewise.
2005-01-07 Andrew John Hughes <[EMAIL PROTECTED]>
* java/lang/annotation/AnnotationTypeMismatchException.java:
Added import of java.lang.reflect.Method
2004-08-26 Tom Tromey <[EMAIL PROTECTED]>
* java/lang/reflect/GenericSignatureFormatError.java: New file.
* java/lang/reflect/WildcardType.java: New file.
* java/lang/reflect/ParameterizedType.java: New file.
* java/lang/reflect/GenericArrayType.java: New file.
* java/lang/reflect/Type.java: New file.
* java/io/Flushable.java: New file.
* java/io/Closeable.java: New file.
2004-08-07 Tom Tromey <[EMAIL PROTECTED]>
* java/lang/annotation/AnnotationFormatError.java: New file.
* java/lang/annotation/AnnotationTypeMismatchException.java: New
file.
2004-08-06 Tom Tromey <[EMAIL PROTECTED]>
* java/lang/Readable.java: New file.
--
Andrew :-)
Please avoid sending me Microsoft Office (e.g. Word, PowerPoint) attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
No software patents in Europe -- http://nosoftwarepatents.com
"Value your freedom, or you will lose it, teaches history.
`Don't bother us with politics' respond those who don't want to learn."
-- Richard Stallman
"We've all been part of the biggest beta test the world has ever known --
Windows"
-- Victor Wheatman, Gartner
Index: java/io/Closeable.java
===================================================================
RCS file: java/io/Closeable.java
diff -N java/io/Closeable.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/io/Closeable.java 20 Feb 2005 23:30:42 -0000
@@ -0,0 +1,63 @@
+/* Closeable.java -- Closeable object
+ Copyright (C) 2004, 2005 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.io;
+
+/**
+ * A <code>Closeable</code> class represents a stream of
+ * data, which can be closed when it is no longer needed.
+ * Closing a stream allows the resources it uses to be
+ * freed for an alternate use.
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @since 1.5
+ */
+public interface Closeable
+{
+
+ /**
+ * Closes the stream represented by this class, thus freeing
+ * system resources. In that case that the stream is already
+ * in the closed state, this method has no effect.
+ *
+ * @throws IOException if an I/O error occurs in closing.
+ */
+ void close()
+ throws IOException;
+
+}
Index: java/io/Flushable.java
===================================================================
RCS file: java/io/Flushable.java
diff -N java/io/Flushable.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/io/Flushable.java 20 Feb 2005 23:30:42 -0000
@@ -0,0 +1,62 @@
+/* Flushable.java -- Flushable object
+ Copyright (C) 2004, 2005 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.io;
+
+/**
+ * A <code>Flushable</code> class represents a stream of
+ * data, for which internally buffered data can be `flushed'.
+ * Flushing such a stream causes the buffered data to be
+ * written to the stream.
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @since 1.5
+ */
+public interface Flushable
+{
+
+ /**
+ * Flushes the stream represented by this class,
+ * so that any buffered data is written to the stream.
+ *
+ * @throws IOException if an I/O error occurs in flushing.
+ */
+ void flush()
+ throws IOException;
+
+}
Index: java/lang/Appendable.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/Appendable.java,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 Appendable.java
--- java/lang/Appendable.java 18 Jan 2005 21:17:36 -0000 1.2
+++ java/lang/Appendable.java 20 Feb 2005 23:30:42 -0000
@@ -55,7 +55,8 @@ import java.io.IOException;
* </p>
* <p>
* <strong>Note</strong>: implementation of this interface is required for
- * any class that wishes to receive data from a <code>Formatter</code>
instance.
+ * any class that wishes to receive data from a <code>Formatter</code>
+ * instance.
* </p>
*
* @author Tom Tromey ([EMAIL PROTECTED])
Index: java/lang/Readable.java
===================================================================
RCS file: java/lang/Readable.java
diff -N java/lang/Readable.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/Readable.java 20 Feb 2005 23:30:42 -0000
@@ -0,0 +1,71 @@
+/* Readable.java -- A character source
+ Copyright (C) 2004, 2005 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang;
+
+import java.io.IOException;
+import java.nio.CharBuffer;
+
+/**
+ * A <code>Readable</code> object is simply a source for Unicode character
+ * data. On request, a <code>Readable</code> will provide its data in
+ * a supplied <code>CharBuffer</code>.
+ *
+ * @author Tom Tromey <[EMAIL PROTECTED]>
+ * @author Andrew John Hughes <[EMAIL PROTECTED]>
+ * @since 1.5
+ */
+public interface Readable
+{
+
+ /**
+ * Adds the character data supplied by this <code>Readable</code>
+ * to the specified character buffer. This method simply places
+ * each character into the buffer as supplied, using <code>put()</code>,
+ * without flipping or rewinding.
+ *
+ * @param buf the buffer to place the character data in.
+ * @return the number of <code>char</code> values placed in the buffer,
+ * or -1 if no more characters are available.
+ * @throws IOException if an I/O error occurs.
+ * @throws NullPointerException if buf is null.
+ * @throws ReadOnlyBufferException if buf is read only.
+ */
+ int read(CharBuffer buf)
+ throws IOException;
+
+}
Index: java/lang/StringBuilder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/StringBuilder.java,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 StringBuilder.java
--- java/lang/StringBuilder.java 16 Feb 2005 07:05:33 -0000 1.3
+++ java/lang/StringBuilder.java 20 Feb 2005 23:30:43 -0000
@@ -82,9 +82,9 @@ public final class StringBuilder
// want to change StringBuffer as well.
/**
- * Compatible with JDK 1.0+.
+ * For compatability with Sun's JDK
*/
- private static final long serialVersionUID = 3388685877147921107L;
+ private static final long serialVersionUID = 4383685877147921099L;
/**
* Index of next available character (and thus the size of the current
Index: java/lang/TypeNotPresentException.java
===================================================================
RCS file: java/lang/TypeNotPresentException.java
diff -N java/lang/TypeNotPresentException.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/TypeNotPresentException.java 20 Feb 2005 23:30:43 -0000
@@ -0,0 +1,97 @@
+/* TypeNotPresentException.java -- Thrown when a string-based type is missing
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang;
+
+/**
+ * <p>
+ * Thrown when a type is accessed using a <code>String</code>-based
+ * representation, but no definition of the supplied type is found.
+ * This is effectively an unchecked equivalent of the existing
+ * <code>ClassNotFound</code> exception.
+ * </p>
+ * <p>
+ * It may occur due to an attempt to load a missing class, interface or
+ * annotation, or when an undefined type variable is accessed.
+ * </p>
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @see ClassNotFoundException
+ * @since 1.5
+ */
+public class TypeNotPresentException
+ extends RuntimeException
+{
+
+ /**
+ * Constructs a <code>TypeNotPresentException</code> for
+ * the supplied type. The specified cause <code>Throwable</code>
+ * may be used to provide additional history, with regards to the
+ * root of the problem. It is perfectly valid for this to be null,
+ * if the cause of the problem is unknown.
+ *
+ * @param typeName the name of the missing type.
+ * @param cause the cause of this exception, or null if the cause
+ * is unknown.
+ */
+ public TypeNotPresentException(String typeName, Throwable cause)
+ {
+ super("type \"" + typeName + "\" not found", cause);
+ this.typeName = typeName;
+ }
+
+ /**
+ * Returns the name of the missing type.
+ *
+ * @return the missing type's name.
+ */
+ public String typeName()
+ {
+ return typeName;
+ }
+
+ /**
+ * The name of the missing type.
+ *
+ * @serial the missing type's name.
+ */
+ // Name fixed by serialization.
+ private String typeName;
+
+}
Index: java/lang/annotation/AnnotationFormatError.java
===================================================================
RCS file: java/lang/annotation/AnnotationFormatError.java
diff -N java/lang/annotation/AnnotationFormatError.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/annotation/AnnotationFormatError.java 20 Feb 2005 23:30:43
-0000
@@ -0,0 +1,104 @@
+/* AnnotationFormatError.java - Thrown when an binary annotation is malformed
+ Copyright (C) 2004, 2005 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang.annotation;
+
+/**
+ * Thrown when an annotation found in a class file is
+ * malformed. When the virtual machine finds a class file
+ * containing annotations, it attempts to parse them.
+ * This error is thrown if this operation fails.
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @since 1.5
+ */
+public class AnnotationFormatError extends Error
+{
+
+ /**
+ * Constructs a new <code>AnnotationFormatError</code>
+ * using the specified message to give details of the error.
+ *
+ * @param message the message to use in the error output.
+ */
+ public AnnotationFormatError(String message)
+ {
+ super(message);
+ }
+
+ /**
+ * <p>
+ * Constructs a new <code>AnnotationFormatError</code>
+ * using the specified message to give details of the error.
+ * The supplied cause <code>Throwable</code> is used to
+ * provide additional history, with regards to the root
+ * of the problem. It is perfectly valid for this to be null, if
+ * the cause is unknown.
+ * </p>
+ * <p>
+ * <strong>Note</strong>: if a cause is supplied, the error
+ * message from this cause is not automatically included in the
+ * error message given by this error.
+ * </p>
+ *
+ * @param message the message to use in the error output
+ * @param cause the cause of this error, or null if the cause
+ * is unknown.
+ */
+ public AnnotationFormatError(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new <code>AnnotationFormatError</code> using
+ * the supplied cause <code>Throwable</code> to
+ * provide additional history, with regards to the root
+ * of the problem. It is perfectly valid for this to be null, if
+ * the cause is unknown. If the cause is not null, the error
+ * message from this cause will also be used as the message
+ * for this error.
+ *
+ * @param cause the cause of the error.
+ */
+ public AnnotationFormatError(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Index: java/lang/annotation/AnnotationTypeMismatchException.java
===================================================================
RCS file: java/lang/annotation/AnnotationTypeMismatchException.java
diff -N java/lang/annotation/AnnotationTypeMismatchException.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/annotation/AnnotationTypeMismatchException.java 20 Feb 2005
23:30:43 -0000
@@ -0,0 +1,116 @@
+/* AnnotationTypeMismatchException.java - Thrown when annotation has changed
+ Copyright (C) 2004, 2005 Free Software Foundation
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package java.lang.annotation;
+
+import java.lang.reflect.Method;
+
+/**
+ * Thrown when accessing an element within an annotation for
+ * which the type has changed, since compilation or serialization
+ * took place. The mismatch between the compiled or serialized
+ * type and the current type causes this exception to be thrown.
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @since 1.5
+ */
+public class AnnotationTypeMismatchException extends RuntimeException
+{
+
+ /**
+ * For compatability with Sun's JDK
+ */
+ private static final long serialVersionUID = 8125925355765570191L;
+
+ /**
+ * Constructs an <code>AnnotationTypeMismatchException</code>
+ * which is due to a mismatched type in the annotation
+ * element, <code>m</code>. The erroneous type used for the
+ * data in <code>m</code> is represented by the string,
+ * <code>type</code>. This string is of an undefined format,
+ * and may contain the value as well as the type.
+ *
+ * @param m the element from the annotation.
+ * @param type the name of the erroneous type found in <code>m</code>.
+ */
+ public AnnotationTypeMismatchException(Method m, String type)
+ {
+ this.element = m;
+ this.foundType = type;
+ }
+
+ /**
+ * Returns the element from the annotation, for which a
+ * mismatch occurred.
+ *
+ * @return the element with the mismatched type.
+ */
+ public Method element()
+ {
+ return element;
+ }
+
+ /**
+ * Returns the erroneous type used by the element,
+ * represented as a <code>String</code>. The format
+ * of this <code>String</code> is not explicitly specified,
+ * and may contain the value as well as the type.
+ *
+ * @return the type found in the element.
+ */
+ public String foundType()
+ {
+ return foundType;
+ }
+
+ // Names are chosen from serialization spec.
+ /**
+ * The element from the annotation.
+ *
+ * @serial the element with the mismatched type.
+ */
+ private Method element;
+
+ /**
+ * The erroneous type used by the element.
+ *
+ * @serial the type found in the element.
+ */
+ private String foundType;
+
+}
Index: java/lang/reflect/GenericArrayType.java
===================================================================
RCS file: java/lang/reflect/GenericArrayType.java
diff -N java/lang/reflect/GenericArrayType.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/reflect/GenericArrayType.java 20 Feb 2005 23:30:43 -0000
@@ -0,0 +1,61 @@
+/* GenericArrayType.java - Represent an array type with a generic component
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang.reflect;
+
+/**
+ * Represents the type of an array's components, which may be
+ * either a parameterized type or a type variable.
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @since 1.5
+ */
+public interface GenericArrayType
+ extends Type
+{
+
+ /**
+ * Returns the <code>Type</code> of the components within the array.
+ *
+ * @return a <code>Type</code> instance representing the type of
+ * the array's components.
+ */
+ Type getGenericComponentType();
+
+}
Index: java/lang/reflect/GenericSignatureFormatError.java
===================================================================
RCS file: java/lang/reflect/GenericSignatureFormatError.java
diff -N java/lang/reflect/GenericSignatureFormatError.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/reflect/GenericSignatureFormatError.java 20 Feb 2005 23:30:43
-0000
@@ -0,0 +1,62 @@
+/* GenericSignatureFormatError.java - Thrown when a signature is malformed.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang.reflect;
+
+/**
+ * Thrown on encountering a syntactically malformed signature in
+ * a reflective method. During reflection, the generic type signature
+ * of a type, method or constructor may be interpreted by the virtual
+ * machine. This error is thrown if this operation fails.
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @since 1.5
+ */
+public class GenericSignatureFormatError
+ extends ClassFormatError
+{
+
+ /**
+ * Constructs a new <code>GenericSignatureFormatError</code>.
+ */
+ public GenericSignatureFormatError()
+ {
+ }
+
+}
Index: java/lang/reflect/ParameterizedType.java
===================================================================
RCS file: java/lang/reflect/ParameterizedType.java
diff -N java/lang/reflect/ParameterizedType.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/reflect/ParameterizedType.java 20 Feb 2005 23:30:43 -0000
@@ -0,0 +1,122 @@
+/* ParameterizedType.java -- Represents parameterized types e.g. List<String>
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang.reflect;
+
+/**
+ * <p>
+ * Represents a type which is parameterized over one or more other
+ * types. For example, <code>List<Integer></code> is a parameterized
+ * type, with <code>List</code> parameterized over the type
+ * <code>Integer</code>.
+ * </p>
+ * <p>
+ * Instances of this classes are created as needed, during reflection.
+ * On creating a parameterized type, <code>p</code>, the
+ * <code>GenericTypeDeclaration</code> corresponding to <code>p</code>
+ * is created and resolved. Each type argument of <code>p</code>
+ * is then created recursively; details of this process are availble
+ * in the documentation of <code>TypeVariable</code>. This creation
+ * process only happens once; repetition has no effect.
+ * </p>
+ * <p>
+ * Implementors of this interface must implement an appropriate
+ * <code>equals()</code> method. This method should equate any
+ * two instances of the implementing class that have the same
+ * <code>GenericTypeDeclaration</code> and <code>Type</code>
+ * parameters.
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @see GenericTypeDeclaration
+ * @see TypeVariable
+ * @since 1.5
+ */
+public interface ParameterizedType
+ extends Type
+{
+
+ /**
+ * <p>
+ * Returns an array of <code>Type</code> objects, which gives
+ * the parameters of this type.
+ * </p>
+ * <p>
+ * <strong>Note</code>: the returned array may be empty. This
+ * occurs if the supposed <code>ParameterizedType</code> is simply
+ * a normal type wrapped inside a parameterized type.
+ * </p>
+ *
+ * @return an array of <code>Type</code>s, representing the arguments
+ * of this type.
+ * @throws TypeNotPresentException if any of the types referred to by
+ * the parameters of this type do not actually exist.
+ * @throws MalformedParameterizedTypeException if any of the types
+ * refer to a type which can not be instantiated.
+ */
+ Type[] getActualTypeArguments();
+
+ /**
+ * Returns the type of which this type is a member. For example,
+ * in <code>Top<String>.Bottom<Integer></code>,
+ * <code>Bottom<Integer></code> is a member of
+ * <code>Top<String></code>, and so the latter is returned
+ * by this method. Calling this method on top-level types (such as
+ * <code>Top<String></code>) returns null.
+ *
+ * @return the type which owns this type.
+ * @throws TypeNotPresentException if the owner type referred to by
+ * this type do not actually exist.
+ * @throws MalformedParameterizedTypeException if the owner type
+ * referred to by this type can not be instantiated.
+ */
+ Type getOwnerType();
+
+ /**
+ * Returns a version of this type without parameters, which corresponds
+ * to the class or interface which declared the type. For example,
+ * the raw type corresponding to <code>List<Double></code>
+ * is <code>List</code>, which was declared by the <code>List</code>
+ * class.
+ *
+ * @return the raw variant of this type (i.e. the type without
+ * parameters).
+ */
+ Type getRawType();
+
+}
Index: java/lang/reflect/Type.java
===================================================================
RCS file: java/lang/reflect/Type.java
diff -N java/lang/reflect/Type.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/reflect/Type.java 20 Feb 2005 23:30:43 -0000
@@ -0,0 +1,55 @@
+/* Type.java - Superinterface for all types.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang.reflect;
+
+/**
+ * Represents any <code>Type</code> within the Java programming
+ * language. This may be a primitive type (e.g. <code>int</code>,
+ * an array type (e.g. <code>double[]>/code>), a raw type
+ * (e.g. <code>Calendar</code>), a parameterized type
+ * (e.g. <code>List<Boolean></code>, or a type
+ * variable (e.g. <code>T extends String</code>).
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @since 1.5
+ */
+public interface Type
+{
+}
Index: java/lang/reflect/WildcardType.java
===================================================================
RCS file: java/lang/reflect/WildcardType.java
diff -N java/lang/reflect/WildcardType.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/lang/reflect/WildcardType.java 20 Feb 2005 23:30:43 -0000
@@ -0,0 +1,115 @@
+/* WildcardType.java -- A wildcard type expression e.g. ? extends String
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang.reflect;
+
+/**
+ * Represents a wildcard type expression, where the type variable
+ * is unnamed. The simplest example of this is <code>?</code>,
+ * which represents any unbounded type. Another example is
+ * <code>? extends Number</code>, which specifies any type
+ * which is a subclass of <code>Number</code> (<code>Number</code>
+ * is the upper bound).
+ * </p>
+ * <p>
+ * <code>? super String</code> gives the type a less common lower bound,
+ * which means that the type must be either a <code>String</code> or one
+ * of its superclasses. This can be useful in working with collections.
+ * You may want a method to add instances of a class to a collection
+ * with a more generic type (e.g. adding <code>String</code>s to
+ * a list of <code>Object</code>s), but don't want to allow users
+ * to pass in a collection with a more specific type.
+ * </p>
+ *
+ * @author Tom Tromey ([EMAIL PROTECTED])
+ * @author Andrew John Hughes ([EMAIL PROTECTED])
+ * @since 1.5
+ */
+public interface WildcardType extends Type
+{
+
+ /**
+ * <p>
+ * Returns an array of <code>Type</code>s, which specify the
+ * lower bounds of this type. The default lower bound is
+ * <code>null</code>, which causes this method to return an
+ * empty array.
+ * </p>
+ * <p>
+ * In generating the array of <code>Type</code>s, each
+ * <code>ParameterizedType</code> or <code>TypeVariable</code> is
+ * created, (see the documentation for these classes for details of this
+ * process), if necessary, while all other types are simply
+ * resolved.
+ * </p>
+ *
+ * @return an array of <code>Type</code> objects, representing
+ * the wildcard type's lower bounds.
+ * @throws TypeNotPresentException if any of the types referred to by
+ * the lower bounds of this type do not actually exist.
+ * @throws MalformedParameterizedTypeException if any of the types
+ * refer to a type which can not be instantiated.
+ */
+ Type[] getLowerBounds();
+
+ /**
+ * <p>
+ * Returns an array of <code>Type</code>s, which specify the
+ * upper bounds of this type. The default upper bound is
+ * <code>Object</code>, which causes this method to return an
+ * array, containing just the <code>Type</code> instance for
+ * <code>Object</code>.
+ * </p>
+ * <p>
+ * In generating the array of <code>Type</code>s, each
+ * <code>ParameterizedType</code> or <code>TypeVariable</code> is
+ * created, (see the documentation for these classes for details of this
+ * process), if necessary, while all other types are simply
+ * resolved.
+ * </p>
+ *
+ * @return an array of <code>Type</code> objects, representing
+ * the wildcard type's upper bounds.
+ * @throws TypeNotPresentException if any of the types referred to by
+ * the upper bounds of this type do not actually exist.
+ * @throws MalformedParameterizedTypeException if any of the types
+ * refer to a type which can not be instantiated.
+ */
+ Type[] getUpperBounds();
+
+}
signature.asc
Description: Digital signature
_______________________________________________ Classpath-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath-patches
