From 7eee682ba80fbddd26e9ab9ddfa320711485a405 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 2 Sep 2001 06:18:49 +0000 Subject: [PATCH] Makefile.in: Rebuilt. * Makefile.in: Rebuilt. * Makefile.am (core_java_source_files): Added UnsupportedClassVersionError. * java/lang/UnsupportedClassVersionError.java: New file from Classpath. * java/io/CharConversionException.java, java/io/EOFException.java, java/io/FileNotFoundException.java, java/io/IOException.java, java/io/InterruptedIOException.java, java/io/ObjectStreamException.java, java/io/OptionalDataException.java, java/io/StreamCorruptedException.java, java/io/SyncFailedException.java, java/io/UTFDataFormatException.java, java/io/UnsupportedEncodingException.java, java/lang/AbstractMethodError.java, java/lang/ArithmeticException.java, java/lang/ArrayIndexOutOfBoundsException.java, java/lang/ArrayStoreException.java, java/lang/ClassCastException.java, java/lang/ClassCircularityError.java, java/lang/ClassFormatError.java, java/lang/CloneNotSupportedException.java, java/lang/Error.java, java/lang/Exception.java, java/lang/ExceptionInInitializerError.java, java/lang/IllegalAccessError.java, java/lang/IllegalAccessException.java, java/lang/IllegalArgumentException.java, java/lang/IllegalMonitorStateException.java, java/lang/IllegalStateException.java, java/lang/IllegalThreadStateException.java, java/lang/IncompatibleClassChangeError.java, java/lang/IndexOutOfBoundsException.java, java/lang/InstantiationError.java, java/lang/InstantiationException.java, java/lang/InternalError.java, java/lang/InterruptedException.java, java/lang/LinkageError.java, java/lang/NegativeArraySizeException.java, java/lang/NoClassDefFoundError.java, java/lang/NoSuchFieldError.java, java/lang/NoSuchFieldException.java, java/lang/NoSuchMethodError.java, java/lang/NoSuchMethodException.java, java/lang/NullPointerException.java, java/lang/NumberFormatException.java, java/lang/OutOfMemoryError.java, java/lang/RuntimeException.java, java/lang/SecurityException.java, java/lang/StackOverflowError.java, java/lang/StringIndexOutOfBoundsException.java, java/lang/ThreadDeath.java, java/lang/UnknownError.java, java/lang/UnsatisfiedLinkError.java, java/lang/UnsupportedOperationException.java, java/lang/VerifyError.java, java/lang/VirtualMachineError.java, java/lang/reflect/InvocationTargetException.java, java/net/BindException.java, java/net/ConnectException.java, java/net/MalformedURLException.java, java/net/NoRouteToHostException.java, java/net/ProtocolException.java, java/net/SocketException.java, java/net/UnknownHostException.java, java/net/UnknownServiceException.java, java/text/ParseException.java: Copied from Classpath, thanks to Mark Wielaard who did the merge. * java/lang/System.java (getProperty): Use single argument form of SecurityManager.checkPropertyAccess. * Makefile.in: Rebuilt. * Makefile.am (core_java_source_files): Added VMSecurityManager. * java/lang/VMSecurityManager.java: New file. * java/lang/SecurityManager.java: Merged with Classpath. From-SVN: r45353 --- libjava/ChangeLog | 72 ++ libjava/Makefile.am | 2 + libjava/Makefile.in | 9 +- libjava/java/io/CharConversionException.java | 79 +- libjava/java/io/EOFException.java | 83 +- libjava/java/io/FileNotFoundException.java | 79 +- libjava/java/io/IOException.java | 81 +- libjava/java/io/InterruptedIOException.java | 108 +- libjava/java/io/ObjectStreamException.java | 82 +- libjava/java/io/StreamCorruptedException.java | 83 +- libjava/java/io/SyncFailedException.java | 76 +- libjava/java/io/UTFDataFormatException.java | 79 +- .../java/io/UnsupportedEncodingException.java | 81 +- libjava/java/lang/AbstractMethodError.java | 73 +- libjava/java/lang/ArithmeticException.java | 74 +- .../lang/ArrayIndexOutOfBoundsException.java | 77 +- libjava/java/lang/ArrayStoreException.java | 73 +- libjava/java/lang/ClassCastException.java | 78 +- libjava/java/lang/ClassCircularityError.java | 71 +- libjava/java/lang/ClassFormatError.java | 70 +- .../java/lang/CloneNotSupportedException.java | 77 +- libjava/java/lang/Error.java | 77 +- libjava/java/lang/Exception.java | 73 +- .../lang/ExceptionInInitializerError.java | 181 ++-- libjava/java/lang/IllegalAccessError.java | 77 +- libjava/java/lang/IllegalAccessException.java | 78 +- .../java/lang/IllegalArgumentException.java | 71 +- .../lang/IllegalMonitorStateException.java | 76 +- libjava/java/lang/IllegalStateException.java | 74 +- .../lang/IllegalThreadStateException.java | 75 +- .../lang/IncompatibleClassChangeError.java | 74 +- .../java/lang/IndexOutOfBoundsException.java | 78 +- libjava/java/lang/InstantiationError.java | 77 +- libjava/java/lang/InstantiationException.java | 75 +- libjava/java/lang/InternalError.java | 73 +- libjava/java/lang/InterruptedException.java | 76 +- libjava/java/lang/LinkageError.java | 74 +- .../java/lang/NegativeArraySizeException.java | 74 +- libjava/java/lang/NoClassDefFoundError.java | 77 +- libjava/java/lang/NoSuchFieldError.java | 74 +- libjava/java/lang/NoSuchFieldException.java | 73 +- libjava/java/lang/NoSuchMethodError.java | 74 +- libjava/java/lang/NoSuchMethodException.java | 73 +- libjava/java/lang/NullPointerException.java | 74 +- libjava/java/lang/NumberFormatException.java | 75 +- libjava/java/lang/OutOfMemoryError.java | 72 +- libjava/java/lang/RuntimeException.java | 76 +- libjava/java/lang/SecurityException.java | 73 +- libjava/java/lang/SecurityManager.java | 993 +++++++++++++----- libjava/java/lang/StackOverflowError.java | 73 +- .../lang/StringIndexOutOfBoundsException.java | 86 +- libjava/java/lang/System.java | 2 +- libjava/java/lang/ThreadDeath.java | 53 +- libjava/java/lang/UnknownError.java | 71 +- libjava/java/lang/UnsatisfiedLinkError.java | 74 +- .../lang/UnsupportedClassVersionError.java | 58 + .../lang/UnsupportedOperationException.java | 61 +- libjava/java/lang/VMSecurityManager.java | 71 ++ libjava/java/lang/VerifyError.java | 71 +- libjava/java/lang/VirtualMachineError.java | 77 +- .../reflect/InvocationTargetException.java | 149 ++- libjava/java/net/BindException.java | 78 +- libjava/java/net/ConnectException.java | 80 +- libjava/java/net/MalformedURLException.java | 78 +- libjava/java/net/NoRouteToHostException.java | 79 +- libjava/java/net/ProtocolException.java | 79 +- libjava/java/net/SocketException.java | 81 +- libjava/java/net/UnknownHostException.java | 81 +- libjava/java/net/UnknownServiceException.java | 80 +- libjava/java/text/ParseException.java | 95 +- 70 files changed, 4654 insertions(+), 1547 deletions(-) create mode 100644 libjava/java/lang/UnsupportedClassVersionError.java create mode 100644 libjava/java/lang/VMSecurityManager.java diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 250258ab106..d2249949cf6 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,75 @@ +2001-09-01 Tom Tromey + + * Makefile.in: Rebuilt. + * Makefile.am (core_java_source_files): Added + UnsupportedClassVersionError. + * java/lang/UnsupportedClassVersionError.java: New file from + Classpath. + + * java/io/CharConversionException.java, java/io/EOFException.java, + java/io/FileNotFoundException.java, java/io/IOException.java, + java/io/InterruptedIOException.java, + java/io/ObjectStreamException.java, + java/io/OptionalDataException.java, + java/io/StreamCorruptedException.java, + java/io/SyncFailedException.java, + java/io/UTFDataFormatException.java, + java/io/UnsupportedEncodingException.java, + java/lang/AbstractMethodError.java, + java/lang/ArithmeticException.java, + java/lang/ArrayIndexOutOfBoundsException.java, + java/lang/ArrayStoreException.java, + java/lang/ClassCastException.java, + java/lang/ClassCircularityError.java, + java/lang/ClassFormatError.java, + java/lang/CloneNotSupportedException.java, java/lang/Error.java, + java/lang/Exception.java, + java/lang/ExceptionInInitializerError.java, + java/lang/IllegalAccessError.java, + java/lang/IllegalAccessException.java, + java/lang/IllegalArgumentException.java, + java/lang/IllegalMonitorStateException.java, + java/lang/IllegalStateException.java, + java/lang/IllegalThreadStateException.java, + java/lang/IncompatibleClassChangeError.java, + java/lang/IndexOutOfBoundsException.java, + java/lang/InstantiationError.java, + java/lang/InstantiationException.java, + java/lang/InternalError.java, java/lang/InterruptedException.java, + java/lang/LinkageError.java, + java/lang/NegativeArraySizeException.java, + java/lang/NoClassDefFoundError.java, + java/lang/NoSuchFieldError.java, + java/lang/NoSuchFieldException.java, + java/lang/NoSuchMethodError.java, + java/lang/NoSuchMethodException.java, + java/lang/NullPointerException.java, + java/lang/NumberFormatException.java, + java/lang/OutOfMemoryError.java, java/lang/RuntimeException.java, + java/lang/SecurityException.java, + java/lang/StackOverflowError.java, + java/lang/StringIndexOutOfBoundsException.java, + java/lang/ThreadDeath.java, java/lang/UnknownError.java, + java/lang/UnsatisfiedLinkError.java, + java/lang/UnsupportedOperationException.java, + java/lang/VerifyError.java, java/lang/VirtualMachineError.java, + java/lang/reflect/InvocationTargetException.java, + java/net/BindException.java, java/net/ConnectException.java, + java/net/MalformedURLException.java, + java/net/NoRouteToHostException.java, + java/net/ProtocolException.java, java/net/SocketException.java, + java/net/UnknownHostException.java, + java/net/UnknownServiceException.java, + java/text/ParseException.java: Copied from Classpath, thanks to + Mark Wielaard who did the merge. + + * java/lang/System.java (getProperty): Use single argument form of + SecurityManager.checkPropertyAccess. + * Makefile.in: Rebuilt. + * Makefile.am (core_java_source_files): Added VMSecurityManager. + * java/lang/VMSecurityManager.java: New file. + * java/lang/SecurityManager.java: Merged with Classpath. + 2001-08-31 Per Bothner * gcj/javaprims.h (_Jv_RegisterClassHook): New extern declaration. diff --git a/libjava/Makefile.am b/libjava/Makefile.am index c88d63c0633..963f631cf8e 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -965,10 +965,12 @@ java/lang/ThreadLocal.java \ java/lang/Throwable.java \ java/lang/UnknownError.java \ java/lang/UnsatisfiedLinkError.java \ +java/lang/UnsupportedClassVersionError.java \ java/lang/UnsupportedOperationException.java \ java/lang/VerifyError.java \ java/lang/VirtualMachineError.java \ java/lang/VMClassLoader.java \ +java/lang/VMSecurityManager.java \ java/lang/Void.java \ java/io/BufferedInputStream.java \ java/io/BufferedOutputStream.java \ diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 7d1122dbb8a..334ea77848d 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -720,10 +720,12 @@ java/lang/ThreadLocal.java \ java/lang/Throwable.java \ java/lang/UnknownError.java \ java/lang/UnsatisfiedLinkError.java \ +java/lang/UnsupportedClassVersionError.java \ java/lang/UnsupportedOperationException.java \ java/lang/VerifyError.java \ java/lang/VirtualMachineError.java \ java/lang/VMClassLoader.java \ +java/lang/VMSecurityManager.java \ java/lang/Void.java \ java/io/BufferedInputStream.java \ java/io/BufferedOutputStream.java \ @@ -1798,10 +1800,11 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \ .deps/java/lang/ThreadDeath.P .deps/java/lang/ThreadGroup.P \ .deps/java/lang/ThreadLocal.P .deps/java/lang/Throwable.P \ .deps/java/lang/UnknownError.P .deps/java/lang/UnsatisfiedLinkError.P \ +.deps/java/lang/UnsupportedClassVersionError.P \ .deps/java/lang/UnsupportedOperationException.P \ -.deps/java/lang/VMClassLoader.P .deps/java/lang/VerifyError.P \ -.deps/java/lang/VirtualMachineError.P .deps/java/lang/Void.P \ -.deps/java/lang/dtoa.P .deps/java/lang/e_acos.P \ +.deps/java/lang/VMClassLoader.P .deps/java/lang/VMSecurityManager.P \ +.deps/java/lang/VerifyError.P .deps/java/lang/VirtualMachineError.P \ +.deps/java/lang/Void.P .deps/java/lang/dtoa.P .deps/java/lang/e_acos.P \ .deps/java/lang/e_asin.P .deps/java/lang/e_atan2.P \ .deps/java/lang/e_exp.P .deps/java/lang/e_fmod.P \ .deps/java/lang/e_log.P .deps/java/lang/e_pow.P \ diff --git a/libjava/java/io/CharConversionException.java b/libjava/java/io/CharConversionException.java index 938d605d0f9..e090dfc60ba 100644 --- a/libjava/java/io/CharConversionException.java +++ b/libjava/java/io/CharConversionException.java @@ -1,34 +1,75 @@ -// CharConversionException.java - Problem converting char to byte encoding. +/* CharConversionException.java -- Character conversion exceptions + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.io; -/** - * @author Tom Tromey - * @date September 25, 1998 - */ - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * Status: Complete to 1.1. */ +/** + * This exception is thrown to indicate that a problem occured with + * an attempted character conversion. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey + * @date September 25, 1998 + */ public class CharConversionException extends IOException { - public CharConversionException () - { - super (); - } - public CharConversionException (String s) - { - super (s); - } +/* + * Constructors + */ + +/** + * Create a new CharConversionException without a descriptive error message + */ +public +CharConversionException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new CharConversionException with a descriptive error message String + * + * @param message The descriptive error message + */ +public +CharConversionException(String message) +{ + super(message); +} + +} // class CharConversionException + diff --git a/libjava/java/io/EOFException.java b/libjava/java/io/EOFException.java index e5ae1f01034..9a57f5fe345 100644 --- a/libjava/java/io/EOFException.java +++ b/libjava/java/io/EOFException.java @@ -1,34 +1,79 @@ -// EOFException.java - End of file exception +/* EOFException.java -- Unexpected end of file exception + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.io; -/** - * @author Tom Tromey - * @date September 24, 1998 - */ - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * Status: Complete to 1.1. */ +/** + * This exception is thrown when the end of the file or stream was + * encountered unexpectedly. This is not the normal way that a normal + * EOF condition is reported. Normally a special value such as -1 is + * returned. However, certain types of streams expecting certain data + * in a certain format might reach EOF before reading their expected + * data pattern and thus throw this exception. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey + * @date September 24, 1998 + */ public class EOFException extends IOException { - public EOFException () - { - super (); - } - public EOFException (String s) - { - super (s); - } +/* + * Constructors + */ + +/** + * Create a new EOFException without a descriptive error message + */ +public +EOFException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new EOFException with a descriptive error message String + * + * @param message The descriptive error message + */ +public +EOFException(String message) +{ + super(message); +} + +} // class EOFException + diff --git a/libjava/java/io/FileNotFoundException.java b/libjava/java/io/FileNotFoundException.java index 9482b2eefbf..16150b4d44a 100644 --- a/libjava/java/io/FileNotFoundException.java +++ b/libjava/java/io/FileNotFoundException.java @@ -1,34 +1,75 @@ -// FileNotFoundException.java +/* FileNotFoundException.java -- The requested file could not be found + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.io; -/** - * @author Tom Tromey - * @date September 24, 1998 - */ - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * Status: Complete to 1.1. */ +/** + * This exception is thrown when an attempt is made to access a file that + * does not exist. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey + * @date September 24, 1998 + */ public class FileNotFoundException extends IOException { - public FileNotFoundException () - { - super (); - } - public FileNotFoundException (String s) - { - super (s); - } +/* + * Constructors + */ + +/** + * Create a new FileNotFoundException without a descriptive error message + */ +public +FileNotFoundException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new FileNotFoundException with a descriptive error message String + * + * @param message The descriptive error message + */ +public +FileNotFoundException(String message) +{ + super(message); +} + +} // class FileNotFoundException + diff --git a/libjava/java/io/IOException.java b/libjava/java/io/IOException.java index e9b22768243..815d92698a9 100644 --- a/libjava/java/io/IOException.java +++ b/libjava/java/io/IOException.java @@ -1,34 +1,77 @@ -// IOException.java - Base class for I/O Exceptions +/* IOException.java -- Generic input/output exception + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.io; -/** - * @author Tom Tromey - * @date September 24, 1998 - */ - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * Status: Complete to 1.1. */ +/** + * This exception is thrown to indicate an I/O problem of some sort + * occurred. Since this is a fairly generic exception, often a subclass + * of IOException will actually be thrown in order to provide a more + * detailed indication of what happened. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey + * @date September 24, 1998 + */ public class IOException extends Exception { - public IOException () - { - super (); - } - public IOException (String s) - { - super (s); - } +/* + * Constructors + */ + +/** + * Create a new IOException without a descriptive error message + */ +public +IOException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new IOException with a descriptive error message String + * + * @param message The descriptive error message + */ +public +IOException(String message) +{ + super(message); +} + +} // class IOException + diff --git a/libjava/java/io/InterruptedIOException.java b/libjava/java/io/InterruptedIOException.java index 75623824392..372286307ad 100644 --- a/libjava/java/io/InterruptedIOException.java +++ b/libjava/java/io/InterruptedIOException.java @@ -1,36 +1,104 @@ -// InterruptedIOException.java +/* InterruptedIOException.java -- An I/O operation was interrupted. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.io; -/** - * @author Tom Tromey - * @date September 24, 1998 - */ - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * Status: Complete to 1.1. */ +/** + * This exception is thrown when a in process I/O operation is + * interrupted for some reason. The field bytesTransferred will contain + * the number of bytes that were read/written prior to the interruption. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey + * @date September 24, 1998 + */ public class InterruptedIOException extends IOException { - public InterruptedIOException () - { - super (); - } - public InterruptedIOException (String s) - { - super (s); - } +private static final long serialVersionUID = 4020568460727500567L; - public int bytesTransferred = 0; +/* + * Instance Variables + */ + +/** + * The number of bytes read/written prior to the interruption + */ +public int bytesTransferred; + +/*************************************************************************/ + +/* + * Constructors + */ + +/** + * Create a new InterruptedIOException without a descriptive error message + */ +public +InterruptedIOException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new InterruptedIOException with a descriptive error message String + * + * @param message The descriptive error message + */ +public +InterruptedIOException(String message) +{ + super(message); +} + +/*************************************************************************/ + +/** + * Create a new InterruptedIOException with a descriptive error message + * String. Also sets the value of the bytesTransferred field. + * + * @param message The descriptive error message + * @param bytesTransferred The number of bytes tranferred before the interruption + */ +InterruptedIOException(String message, int bytesTransferred) +{ + super(message); + this.bytesTransferred = bytesTransferred; +} + +} // class InterruptedIOException + diff --git a/libjava/java/io/ObjectStreamException.java b/libjava/java/io/ObjectStreamException.java index cb293e8ec8c..f006321b130 100644 --- a/libjava/java/io/ObjectStreamException.java +++ b/libjava/java/io/ObjectStreamException.java @@ -1,31 +1,75 @@ -/* Copyright (C) 2000 Free Software Foundation +/* ObjectStreamException.java -- Superclass of all serialisation exceptions + Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.io; -/** - * @author Warren Levy - * @date February 7, 2000. - */ - /* Written using on-line Java Platform 1.2 API Specification. * Status: Believed complete and correct. */ -public abstract class ObjectStreamException extends IOException +/** + * This exception is thrown when a problem occurs during serialization. + * There are more specific subclasses than give more fine grained + * indications of the precise failure. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy + * @date February 7, 2000. + */ +public abstract class ObjectStreamException extends IOException { - protected ObjectStreamException() - { - super(); - } - protected ObjectStreamException(String msg) - { - super(msg); - } +/* + * Constructors + */ + +/** + * Create a new ObjectStreamException without a descriptive error message + */ +protected +ObjectStreamException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new ObjectStreamException with a descriptive error message String + * + * @param message The descriptive error message + */ +protected +ObjectStreamException(String message) +{ + super(message); +} + +} // class ObjectStreamException + diff --git a/libjava/java/io/StreamCorruptedException.java b/libjava/java/io/StreamCorruptedException.java index 2741319daa4..7f807ca2f2d 100644 --- a/libjava/java/io/StreamCorruptedException.java +++ b/libjava/java/io/StreamCorruptedException.java @@ -1,31 +1,74 @@ -/* Copyright (C) 2000 Free Software Foundation +/* StreamCorruptedException.java -- Error in stream during serialization + Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.io; -/** - * @author Warren Levy - * @date February 7, 2000. - */ - /* Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ - + +/** + * This exception is thrown when there is an error in the data that is + * read from a stream during de-serialization. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy + * @date February 7, 2000. + */ public class StreamCorruptedException extends ObjectStreamException { - public StreamCorruptedException() - { - super(); - } - public StreamCorruptedException(String msg) - { - super(msg); - } +/* + * Constructors + */ + +/** + * Create a new StreamCorruptedException without a descriptive error message + */ +public +StreamCorruptedException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new StreamCorruptedException with a descriptive error message String + * + * @param message The descriptive error message + */ +public +StreamCorruptedException(String message) +{ + super(message); +} + +} // class StreamCorruptedException + diff --git a/libjava/java/io/SyncFailedException.java b/libjava/java/io/SyncFailedException.java index 964d24a220b..0ec75d657ef 100644 --- a/libjava/java/io/SyncFailedException.java +++ b/libjava/java/io/SyncFailedException.java @@ -1,29 +1,75 @@ -// SyncFailedException.java +/* SyncFailedException.java -- The sync failed (?) + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.io; -/** - * @author Tom Tromey - * @date September 24, 1998 - */ - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * Status: Complete to 1.1. */ +/** + * I really wish I knew what caused this exception to be thrown. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey + * @date September 24, 1998 + */ public class SyncFailedException extends IOException { - public SyncFailedException (String s) - { - super (s); - } + +private static final long serialVersionUID = -2353342684412443330L; + +/* + * Constructors + */ + +/** + * Create a new SyncFailedException without a descriptive error message + */ +SyncFailedException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new SyncFailedException with a descriptive error message String + * + * @param message The descriptive error message + */ +public +SyncFailedException(String message) +{ + super(message); +} + +} // class SyncFailedException + diff --git a/libjava/java/io/UTFDataFormatException.java b/libjava/java/io/UTFDataFormatException.java index 16445cdcfe5..378e992c409 100644 --- a/libjava/java/io/UTFDataFormatException.java +++ b/libjava/java/io/UTFDataFormatException.java @@ -1,34 +1,75 @@ -// UTFDataFormatException.java +/* UTFDataFormatException.java -- Bad format in UTF data + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.io; -/** - * @author Tom Tromey - * @date September 24, 1998 - */ - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * Status: Complete to 1.1. */ +/** + * When reading a UTF string from an input stream, this exception is thrown + * to indicate that the data read is invalid. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey + * @date September 24, 1998 + */ public class UTFDataFormatException extends IOException { - public UTFDataFormatException () - { - super (); - } - public UTFDataFormatException (String s) - { - super (s); - } +/* + * Constructors + */ + +/** + * Create a new UTFDataFormatException without a descriptive error message + */ +public +UTFDataFormatException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new UTFDataFormatException with a descriptive error message String + * + * @param message The descriptive error message + */ +public +UTFDataFormatException(String message) +{ + super(message); +} + +} // class UTFDataFormatException + diff --git a/libjava/java/io/UnsupportedEncodingException.java b/libjava/java/io/UnsupportedEncodingException.java index 8ab868eb787..8ea7f03225b 100644 --- a/libjava/java/io/UnsupportedEncodingException.java +++ b/libjava/java/io/UnsupportedEncodingException.java @@ -1,32 +1,75 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* UnsupportedEncodingException.java -- The requested encoding isn't supported + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. -package java.io; +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. -/** - * @author Per Bothner - * @date April 17, 1998. - */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + +package java.io; /* Written using "Java Class Libraries", 2nd edition, plus online * API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * This exception is thrown when the requested character encoding is + * not supported. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Per Bothner + * @date April 17, 1998. + */ public class UnsupportedEncodingException extends IOException { - public UnsupportedEncodingException () - { - super(); - } - public UnsupportedEncodingException (String msg) - { - super(msg); - } +/* + * Constructors + */ + +/** + * Create a new UnsupportedEncodingException without a descriptive error message + */ +public +UnsupportedEncodingException() +{ + super(); } + +/*************************************************************************/ + +/** + * Create a new UnsupportedEncodingException with a descriptive error message String + * + * @param message The descriptive error message + */ +public +UnsupportedEncodingException(String message) +{ + super(message); +} + +} // class UnsupportedEncodingException + diff --git a/libjava/java/lang/AbstractMethodError.java b/libjava/java/lang/AbstractMethodError.java index 782e595a9ba..b1e48fea083 100644 --- a/libjava/java/lang/AbstractMethodError.java +++ b/libjava/java/lang/AbstractMethodError.java @@ -1,34 +1,67 @@ -// AbstractMethodError.java +/* AbstractMethodError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ +/** + * An AbstractMethodError is thrown when an application + * attempts to access an abstract method. Compilers typically detect + * this error, but it can be thrown at run time if the definition of a + * class has changed since the application was last compiled. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class AbstractMethodError extends IncompatibleClassChangeError { - public AbstractMethodError () - { - super (); - } + static final long serialVersionUID = -1654391082989018462L; - public AbstractMethodError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public AbstractMethodError() + { + super(); + } + + /** + * Create an error with a message. + */ + public AbstractMethodError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/ArithmeticException.java b/libjava/java/lang/ArithmeticException.java index 15278e06a9f..542a9093c9b 100644 --- a/libjava/java/lang/ArithmeticException.java +++ b/libjava/java/lang/ArithmeticException.java @@ -1,32 +1,68 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* ArithmeticException.java -- exception thrown to indicate conditions + like divide by zero. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional circumstances. + * In this case an ArithmeticException is thrown when things like trying + * to divide a number by zero. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class ArithmeticException extends RuntimeException { - public ArithmeticException() - { - super(); - } + static final long serialVersionUID = 2256477558314496007L; - public ArithmeticException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public ArithmeticException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public ArithmeticException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/ArrayIndexOutOfBoundsException.java b/libjava/java/lang/ArrayIndexOutOfBoundsException.java index 4b912c22007..e30af6107c5 100644 --- a/libjava/java/lang/ArrayIndexOutOfBoundsException.java +++ b/libjava/java/lang/ArrayIndexOutOfBoundsException.java @@ -1,37 +1,76 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* ArrayIndexOutOfBoundsException.java -- exception thrown when accessing + an illegal index. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions, in this case + * when trying to access an illegal index. This exception is thrown when + * accessing an index which is either negative or greater than the size of + * the array minus one. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException { - public ArrayIndexOutOfBoundsException() - { + static final long serialVersionUID = -5116101128118950844L; + + /** + * Create an exception without a message. + */ + public ArrayIndexOutOfBoundsException() { super(); } - public ArrayIndexOutOfBoundsException(int index) - { - this("Array index out of range: " + index); + /** + * Create an exception with a message. + */ + public ArrayIndexOutOfBoundsException(String s) { + super(s); } - public ArrayIndexOutOfBoundsException(String msg) - { - super(msg); + /** + * Create an exception indicating the illegal index. + */ + public ArrayIndexOutOfBoundsException(int index) { + super("Array index out of range: " + index); } + } diff --git a/libjava/java/lang/ArrayStoreException.java b/libjava/java/lang/ArrayStoreException.java index 720308e5acf..c2446c6f544 100644 --- a/libjava/java/lang/ArrayStoreException.java +++ b/libjava/java/lang/ArrayStoreException.java @@ -1,32 +1,67 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* ArrayStoreException.java -- exception thrown to when trying to store an + object into an array of a different type. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions, in this case + * when trying to store an object into an array of a different type. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class ArrayStoreException extends RuntimeException { - public ArrayStoreException() - { - super(); - } + static final long serialVersionUID = -4522193890499838241L; - public ArrayStoreException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public ArrayStoreException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public ArrayStoreException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/ClassCastException.java b/libjava/java/lang/ClassCastException.java index 912e870a2c2..1e0512e8b9a 100644 --- a/libjava/java/lang/ClassCastException.java +++ b/libjava/java/lang/ClassCastException.java @@ -1,32 +1,72 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* ClassCastException.java -- exception thrown when incorrectly trying to + cast an object to a subclass it does not belong to. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. In this case + * when incorrectly trying to cast an object to a subclass it does not + * belong to. The following code generates a ClassCastException. + *
+ * Object o = new Vector();
+ * String s = (String)o;
+ * 
+ * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class ClassCastException extends RuntimeException { - public ClassCastException() - { - super(); - } + static final long serialVersionUID = -9223365651070458532L; - public ClassCastException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public ClassCastException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public ClassCastException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/ClassCircularityError.java b/libjava/java/lang/ClassCircularityError.java index 21bda92c421..c41856ed545 100644 --- a/libjava/java/lang/ClassCircularityError.java +++ b/libjava/java/lang/ClassCircularityError.java @@ -1,34 +1,65 @@ -// ClassCircularityError.java +/* ClassCircularityError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ +/** + * A ClassCircularityError is thrown when a circular dependency + * has been detected while initializing a class. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class ClassCircularityError extends LinkageError { - public ClassCircularityError () - { - super (); - } + static final long serialVersionUID = 1054362542914539689L; - public ClassCircularityError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public ClassCircularityError() + { + super(); + } + + /** + * Create an error with a message. + */ + public ClassCircularityError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/ClassFormatError.java b/libjava/java/lang/ClassFormatError.java index 2af50083151..51866ba5ca4 100644 --- a/libjava/java/lang/ClassFormatError.java +++ b/libjava/java/lang/ClassFormatError.java @@ -1,34 +1,64 @@ -// ClassFormatError.java +/* ClassFormatError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ +/** + * A ClassFormatError is thrown when a Java Virtual Machine + * unable to read a class file because the file is corrupted or cannot be + * interpreted as a class file. + * + * @since JDK 1.0 + * + * @author Brian Jones + */ public class ClassFormatError extends LinkageError { - public ClassFormatError () - { - super (); - } + static final long serialVersionUID = -8420114879011949195L; - public ClassFormatError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public ClassFormatError() + { + super(); + } + + /** + * Create an error with a message. + */ + public ClassFormatError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/CloneNotSupportedException.java b/libjava/java/lang/CloneNotSupportedException.java index 62c0c04c997..23e199a27f0 100644 --- a/libjava/java/lang/CloneNotSupportedException.java +++ b/libjava/java/lang/CloneNotSupportedException.java @@ -1,32 +1,71 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* CloneNotSupportedException.java -- exception thrown to indicate that + the object calling the clone method of Object does not implement the + Cloneable interface. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Thrown to indicate an object should not or could not be cloned. + * For example CloneNotSupportedException is thrown by + * the clone method of Object to indicate + * that object does not implement the Cloneable interface. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class CloneNotSupportedException extends Exception { - public CloneNotSupportedException() - { - super(); - } + static final long serialVersionUID = 5195511250079656443L; - public CloneNotSupportedException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public CloneNotSupportedException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public CloneNotSupportedException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/Error.java b/libjava/java/lang/Error.java index a9f9d80215a..5a0c3cc840d 100644 --- a/libjava/java/lang/Error.java +++ b/libjava/java/lang/Error.java @@ -1,34 +1,71 @@ -// Error.java +/* Error.java - Indication of fatal abnormal conditions + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ +/** + * Applications should not try to catch errors since they indicate + * abnormal conditions. An abnormal condition is something which should not + * occur. A few errors, like ThreadDeath error do normally + * occur, but most applications should not catch it. + *

+ * A method is not required to declare any subclass of Error in + * its throws clause which might be thrown but not caught while + * executing the method.. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class Error extends Throwable { - public Error () - { - super (); - } + static final long serialVersionUID = 4980196508277280342L; - public Error (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public Error() + { + super(); + } + + /** + * Create an error with a message. + */ + public Error(String s) + { + super(s); + } } diff --git a/libjava/java/lang/Exception.java b/libjava/java/lang/Exception.java index 71df1dd9d3c..90fc888686e 100644 --- a/libjava/java/lang/Exception.java +++ b/libjava/java/lang/Exception.java @@ -1,32 +1,67 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* Exception.java -- generic exception thrown to indicate an exceptional + condition has occurred. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with the cause of the exception, such as + * mouse movements, keyboard clicking, etc. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class Exception extends Throwable { - public Exception() - { - super(); - } + static final long serialVersionUID = -3387516993124229948L; - public Exception(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public Exception() + { + super(); + } + + /** + * Create an exception with a message. + */ + public Exception(String s) + { + super(s); + } } diff --git a/libjava/java/lang/ExceptionInInitializerError.java b/libjava/java/lang/ExceptionInInitializerError.java index d43a8599127..3ecc5f5e256 100644 --- a/libjava/java/lang/ExceptionInInitializerError.java +++ b/libjava/java/lang/ExceptionInInitializerError.java @@ -1,85 +1,144 @@ -// ExceptionInInitializerError.java +/* ExceptionInInitializerError.java + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.lang; + import java.io.PrintStream; import java.io.PrintWriter; -/** - * @author Tom Tromey - * @date October 1, 1998 - */ /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ +/** + * An ExceptionInInitializerError is thrown when an + * unexpected exception has occurred in a static initializer or the + * initializer for a static variable. + * + * @since JDK 1.1 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class ExceptionInInitializerError extends LinkageError { - public ExceptionInInitializerError () - { - super (); - exception = null; - } + static final long serialVersionUID = 1521711792217232256L; - public ExceptionInInitializerError (String msg) - { - super (msg); - exception = null; - } + private Throwable exception = null; - public ExceptionInInitializerError (Throwable e) - { - super (e.toString()); - exception = e; - } + /** + * Create an error without a message. + */ + public ExceptionInInitializerError() + { + super(); + } - public Throwable getException () - { - return exception; - } + /** + * Create an error with a message. + */ + public ExceptionInInitializerError(String s) + { + super(s); + } - public void printStackTrace () - { - if (exception != null) - { - System.err.print (this.getClass().getName() + ": "); - exception.printStackTrace (); - } - else - super.printStackTrace (); - } + /** + * Creates an error an saves a reference to the Throwable + * object. + * + * @param t the exception thrown + */ + public ExceptionInInitializerError(Throwable t) + { + super(t.toString()); + exception = t; + } - public void printStackTrace (PrintStream ps) - { - if (exception != null) - { - ps.print (this.getClass().getName() + ": "); - exception.printStackTrace (ps); - } - else - super.printStackTrace (ps); - } + /** + * Return the exception that caused this error to be created. + * @return the stored Throwable object or null + * if this ExceptionInInitializerError has no stored + * Throwable object. + */ + public Throwable getException() + { + return exception; + } - public void printStackTrace (PrintWriter pw) - { - if (exception != null) - { - pw.print (this.getClass().getName() + ": "); - exception.printStackTrace (pw); - } - else - super.printStackTrace (pw); - } + /** + * Print a stack trace of the exception that occurred. + */ + public void printStackTrace() + { + if (exception == null) + { + super.printStackTrace(); + } + else + { + System.err.print(this.getClass() + ": "); + exception.printStackTrace(); + } + } - // The exception that caused this error. - private Throwable exception; + /** + * Print a stack trace of the exception that occurred to + * the specified PrintStream. + */ + public void printStackTrace(PrintStream ps) + { + if (exception == null) + { + super.printStackTrace(ps); + } + else + { + ps.print(this.getClass() + ": "); + exception.printStackTrace(ps); + } + } + + /** + * Print a stack trace of the exception that occurred to + * the specified PrintWriter. + */ + public void printStackTrace(PrintWriter pw) + { + if (exception == null) + { + super.printStackTrace(pw); + } + else + { + pw.print(this.getClass() + ": "); + exception.printStackTrace(pw); + } + } } diff --git a/libjava/java/lang/IllegalAccessError.java b/libjava/java/lang/IllegalAccessError.java index a2cf57dea15..3fbde947036 100644 --- a/libjava/java/lang/IllegalAccessError.java +++ b/libjava/java/lang/IllegalAccessError.java @@ -1,34 +1,69 @@ -// IllegalAccessError.java +/* IllegalAccessError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * An IllegalAccessError is thrown when an attempt is made to + * call a method, or access or modify a field that the application does not + * have access to. Because this error is usually caught by a compiler, + * the error only occurs at runtime when the definition of a class has + * changed in a way that is incompatible with the previously compiled + * application. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class IllegalAccessError extends IncompatibleClassChangeError { - public IllegalAccessError () - { - super (); - } + static final long serialVersionUID = -8988904074992417891L; - public IllegalAccessError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public IllegalAccessError() + { + super(); + } + + /** + * Create an error with a message. + */ + public IllegalAccessError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/IllegalAccessException.java b/libjava/java/lang/IllegalAccessException.java index d3618113776..af15fd2d7c7 100644 --- a/libjava/java/lang/IllegalAccessException.java +++ b/libjava/java/lang/IllegalAccessException.java @@ -1,32 +1,72 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* IllegalAccessException.java -- exception thrown when trying to load a + class that is not public and in another package. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Thrown in two cases. The first is when try to load a class that is + * not public and in another package using specific methods from + * ClassLoader and Class. The second case is + * when trying to create a new instance of a class to which you do not have + * access to the zero argument constructor as in using the + * newsInstance method of class Class. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class IllegalAccessException extends Exception { - public IllegalAccessException() - { - super(); - } + static final long serialVersionUID = 6616958222490762034L; - public IllegalAccessException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public IllegalAccessException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public IllegalAccessException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/IllegalArgumentException.java b/libjava/java/lang/IllegalArgumentException.java index 935092bcf7d..7d2d547015a 100644 --- a/libjava/java/lang/IllegalArgumentException.java +++ b/libjava/java/lang/IllegalArgumentException.java @@ -1,32 +1,67 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* IllegalArgumentException.java -- exception may be thrown when a method + is passed an illegal or inappropriate argument. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * When a method is passed an illegal or inappropriate argument + * this exception may be thrown. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class IllegalArgumentException extends RuntimeException { + static final long serialVersionUID = -5365630128856068164L; + + /** + * Create an exception without a message. + */ public IllegalArgumentException() - { - super(); - } + { + super(); + } - public IllegalArgumentException(String msg) - { - super(msg); - } + /** + * Create an exception with a message. + */ + public IllegalArgumentException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/IllegalMonitorStateException.java b/libjava/java/lang/IllegalMonitorStateException.java index 32b50f468c9..dcaa76570a8 100644 --- a/libjava/java/lang/IllegalMonitorStateException.java +++ b/libjava/java/lang/IllegalMonitorStateException.java @@ -1,32 +1,70 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* IllegalMonitorStateException.java -- exception thrown when a thread + attempts to wait on an object's monitor. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * If a thread attempts to wait on an object's monitor then + * IllegalMonitorStateException can be thrown. This + * exception is also thrown to give a message to other threads also waiting + * on an object's monitor without owning the monitor. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class IllegalMonitorStateException extends RuntimeException { - public IllegalMonitorStateException() - { - super(); - } + static final long serialVersionUID = 3713306369498869069L; - public IllegalMonitorStateException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public IllegalMonitorStateException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public IllegalMonitorStateException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/IllegalStateException.java b/libjava/java/lang/IllegalStateException.java index 90abb524505..1f154c0a41d 100644 --- a/libjava/java/lang/IllegalStateException.java +++ b/libjava/java/lang/IllegalStateException.java @@ -1,32 +1,68 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* IllegalStateException.java -- exception thrown when invoking a method at + an illegal or inappropriate time. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Invoking a method at an illegal or inappropriate time can result + * in an IllegalStateException. + * + * @since JDK 1.1 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class IllegalStateException extends RuntimeException { - public IllegalStateException() - { - super(); - } + static final long serialVersionUID = -1848914673093119416L; - public IllegalStateException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public IllegalStateException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public IllegalStateException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/IllegalThreadStateException.java b/libjava/java/lang/IllegalThreadStateException.java index f6b63924180..7b4693ea49f 100644 --- a/libjava/java/lang/IllegalThreadStateException.java +++ b/libjava/java/lang/IllegalThreadStateException.java @@ -1,32 +1,69 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* IllegalThreadStateException.java -- exception thrown when trying to + suspend or resume an object of class Thread when it is not in an + appropriate state for the operation. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * When trying to suspend or resume an object + * of class Thread when it is not in an appropriate state + * for the operation. + * + * @since JDK 1.0 + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class IllegalThreadStateException extends IllegalArgumentException { - public IllegalThreadStateException() - { - super(); - } + static final long serialVersionUID = -7626246362397460174L; - public IllegalThreadStateException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public IllegalThreadStateException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public IllegalThreadStateException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/IncompatibleClassChangeError.java b/libjava/java/lang/IncompatibleClassChangeError.java index 1477732d22c..5a06b9a14ab 100644 --- a/libjava/java/lang/IncompatibleClassChangeError.java +++ b/libjava/java/lang/IncompatibleClassChangeError.java @@ -1,34 +1,66 @@ -// IncompatibleClassChangeError.java +/* IncompatibleClassChangeError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * An IncompatibleClassChangeError is thrown when the + * definition of a class used by the currently executing method has + * changed in an incompatible way. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class IncompatibleClassChangeError extends LinkageError { - public IncompatibleClassChangeError () - { - super (); - } + static final long serialVersionUID = -4914975503642802119L; - public IncompatibleClassChangeError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public IncompatibleClassChangeError() + { + super(); + } + + /** + * Create an error with a message. + */ + public IncompatibleClassChangeError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/IndexOutOfBoundsException.java b/libjava/java/lang/IndexOutOfBoundsException.java index f1175253aef..8ad884403a0 100644 --- a/libjava/java/lang/IndexOutOfBoundsException.java +++ b/libjava/java/lang/IndexOutOfBoundsException.java @@ -1,32 +1,72 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* IndexOutOfBoundsException.java -- exception thrown when attempting to + access an index which is out of bounds on objects like String, Array, + or Vector. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * This exception can be thrown to indicate an attempt to access an + * index which is out of bounds on objects like String, Array, or Vector. + * Usually any negative integer less than or equal to -1 and positive + * integer greater than or equal to the size of the object is an index + * which would be out of bounds. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class IndexOutOfBoundsException extends RuntimeException { - public IndexOutOfBoundsException() - { - super(); - } + static final long serialVersionUID = 234122996006267687L; - public IndexOutOfBoundsException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public IndexOutOfBoundsException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public IndexOutOfBoundsException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/InstantiationError.java b/libjava/java/lang/InstantiationError.java index 595abaf6fd1..788fac51ff1 100644 --- a/libjava/java/lang/InstantiationError.java +++ b/libjava/java/lang/InstantiationError.java @@ -1,34 +1,69 @@ -// InstantiationError.java +/* InstantiationError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * An InstantiationError is thrown when an attempt is made to + * create an instance of an abstract class or an interface. Because this + * error is usually caught by a compiler, + * the error only occurs at runtime when the definition of a class has + * changed in a way that is incompatible with the previously compiled + * application. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class InstantiationError extends IncompatibleClassChangeError { - public InstantiationError () - { - super (); - } + static final long serialVersionUID = -4885810657349421204L; - public InstantiationError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public InstantiationError() + { + super(); + } + + /** + * Create an error with a message. + */ + public InstantiationError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/InstantiationException.java b/libjava/java/lang/InstantiationException.java index 1ea91ba9aee..19237d74d2f 100644 --- a/libjava/java/lang/InstantiationException.java +++ b/libjava/java/lang/InstantiationException.java @@ -1,32 +1,69 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* InstantiationException.java -- exception thrown when trying to instantiate + interfaces and abstract classes using the newInstance method of class Class. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Interfaces and abstract classes cannot be instantiated using the + * newInstance method of class Class. Trying + * to do so results in this exception being thrown. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class InstantiationException extends Exception { - public InstantiationException() - { - super(); - } + static final long serialVersionUID = -8441929162975509110L; - public InstantiationException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public InstantiationException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public InstantiationException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/InternalError.java b/libjava/java/lang/InternalError.java index e8e9755a762..379d465642f 100644 --- a/libjava/java/lang/InternalError.java +++ b/libjava/java/lang/InternalError.java @@ -1,34 +1,65 @@ -// InternalError.java +/* InternalError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * An InternalError is thrown when a mystical error has + * occurred in the Java Virtual Machine. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class InternalError extends VirtualMachineError { - public InternalError () - { - super (); - } + static final long serialVersionUID = -9062593416125562365L; - public InternalError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public InternalError() + { + super(); + } + + /** + * Create an error with a message. + */ + public InternalError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/InterruptedException.java b/libjava/java/lang/InterruptedException.java index adb73c2d79d..ca55fa662cc 100644 --- a/libjava/java/lang/InterruptedException.java +++ b/libjava/java/lang/InterruptedException.java @@ -1,32 +1,70 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* InterruptedException.java -- exception thrown when a thread interrupts + another thread which was previously sleeping, waiting, or paused in some + other way. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Thrown when a thread interrupts another thread which was previously + * sleeping, waiting, or paused in some other way. See the + * interrupt method of class Thread. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class InterruptedException extends Exception { - public InterruptedException() - { - super(); - } + static final long serialVersionUID = 6700697376100628473L; - public InterruptedException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public InterruptedException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public InterruptedException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/LinkageError.java b/libjava/java/lang/LinkageError.java index af380ca4708..8de9dd2c749 100644 --- a/libjava/java/lang/LinkageError.java +++ b/libjava/java/lang/LinkageError.java @@ -1,34 +1,66 @@ -// LinkageError.java +/* LinkageError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * Subclasses of LinkageError are thrown to indicate + * a class which is depended upon by another class has incompatibly + * changed after the compilation of the latter class. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class LinkageError extends Error { - public LinkageError () - { - super (); - } + static final long serialVersionUID = 3579600108157160122L; - public LinkageError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public LinkageError() + { + super(); + } + + /** + * Create an error with a message. + */ + public LinkageError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/NegativeArraySizeException.java b/libjava/java/lang/NegativeArraySizeException.java index 22f1423cbcd..8af136e6242 100644 --- a/libjava/java/lang/NegativeArraySizeException.java +++ b/libjava/java/lang/NegativeArraySizeException.java @@ -1,32 +1,68 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* NegativeArraySizeException.java -- exception thrown when an attempt is + made to create an array with a negative size. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Thrown when an attempt is made to create an array with a negative + * size. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class NegativeArraySizeException extends RuntimeException { - public NegativeArraySizeException() - { - super(); - } + static final long serialVersionUID = -8960118058596991861L; - public NegativeArraySizeException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public NegativeArraySizeException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public NegativeArraySizeException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/NoClassDefFoundError.java b/libjava/java/lang/NoClassDefFoundError.java index afb3abb86ee..9c123c0498e 100644 --- a/libjava/java/lang/NoClassDefFoundError.java +++ b/libjava/java/lang/NoClassDefFoundError.java @@ -1,34 +1,69 @@ -// NoClassDefFoundError.java +/* NoClassDefFoundError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * A NoClassDefFoundError is thrown when a classloader or the + * Java Virtual Machine tries to load a class and no definition of the class + * can be found. This could happen when using the new expression + * or during a normal method call. The reason this would occur at runtime is + * because the missing class definition existed when the currently executing + * class was compiled, but now that definition cannot be found. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class NoClassDefFoundError extends LinkageError { - public NoClassDefFoundError () - { - super (); - } + static final long serialVersionUID = 9095859863287012458L; - public NoClassDefFoundError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public NoClassDefFoundError() + { + super(); + } + + /** + * Create an error with a message. + */ + public NoClassDefFoundError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/NoSuchFieldError.java b/libjava/java/lang/NoSuchFieldError.java index 7835ebd26a0..22cac1f2e3c 100644 --- a/libjava/java/lang/NoSuchFieldError.java +++ b/libjava/java/lang/NoSuchFieldError.java @@ -1,34 +1,66 @@ -// NoSuchFieldError.java +/* NoSuchFieldError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * A NoSuchFieldError is thrown if an application attempts + * to access the field of an object and that object no longer has that + * field. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class NoSuchFieldError extends IncompatibleClassChangeError { - public NoSuchFieldError () - { - super (); - } + static final long serialVersionUID = -3456430195886129035L; - public NoSuchFieldError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public NoSuchFieldError() + { + super(); + } + + /** + * Create an error with a message. + */ + public NoSuchFieldError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/NoSuchFieldException.java b/libjava/java/lang/NoSuchFieldException.java index 1c959fad255..e01eff7b189 100644 --- a/libjava/java/lang/NoSuchFieldException.java +++ b/libjava/java/lang/NoSuchFieldException.java @@ -1,32 +1,67 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* NoSuchFieldException.java -- exception thrown to indicate the class does + not have the specified field. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Thrown to indicate the class does not have the specified field. + * + * @since JDK 1.1 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class NoSuchFieldException extends Exception { - public NoSuchFieldException() - { - super(); - } + static final long serialVersionUID = -6143714805279938260L; - public NoSuchFieldException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public NoSuchFieldException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public NoSuchFieldException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/NoSuchMethodError.java b/libjava/java/lang/NoSuchMethodError.java index c266e2ee527..d169b51cb19 100644 --- a/libjava/java/lang/NoSuchMethodError.java +++ b/libjava/java/lang/NoSuchMethodError.java @@ -1,34 +1,66 @@ -// NoSuchMethodError.java +/* NoSuchMethodError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * A NoSuchMethodError is thrown if an application attempts + * to access a method of a class, and that class no longer has that + * method. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class NoSuchMethodError extends IncompatibleClassChangeError { - public NoSuchMethodError () - { - super (); - } + static final long serialVersionUID = -3765521442372831335L; - public NoSuchMethodError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public NoSuchMethodError() + { + super(); + } + + /** + * Create an error with a message. + */ + public NoSuchMethodError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/NoSuchMethodException.java b/libjava/java/lang/NoSuchMethodException.java index 87e2132e790..b4b19fa5489 100644 --- a/libjava/java/lang/NoSuchMethodException.java +++ b/libjava/java/lang/NoSuchMethodException.java @@ -1,32 +1,67 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* NoSuchMethodException.java -- exception thrown to indicate the class + does not have the specified method. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Thrown to indicate the class does not have the specified method. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class NoSuchMethodException extends Exception { - public NoSuchMethodException() - { - super(); - } + static final long serialVersionUID = 5034388446362600923L; - public NoSuchMethodException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public NoSuchMethodException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public NoSuchMethodException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/NullPointerException.java b/libjava/java/lang/NullPointerException.java index f4b2757892d..6ba13f5918c 100644 --- a/libjava/java/lang/NullPointerException.java +++ b/libjava/java/lang/NullPointerException.java @@ -1,32 +1,68 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* NullPointerException.java -- exception thrown when attempting to use null + where an object is required. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Thrown when attempting to use null where an object + * is required, such as when accessing an instance method of a null object. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class NullPointerException extends RuntimeException { - public NullPointerException() - { - super(); - } + static final long serialVersionUID = 5162710183389028792L; - public NullPointerException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public NullPointerException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public NullPointerException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/NumberFormatException.java b/libjava/java/lang/NumberFormatException.java index 1b97c758c4d..5978f7e94e8 100644 --- a/libjava/java/lang/NumberFormatException.java +++ b/libjava/java/lang/NumberFormatException.java @@ -1,32 +1,69 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* NumberFormatException.java -- exception may be thrown when attempting to + convert a String to one of the numeric types, but the operation fails. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * Can be thrown when attempting to convert a String to + * one of the numeric types, but the operation fails because the string + * has the wrong format. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class NumberFormatException extends IllegalArgumentException { - public NumberFormatException() - { - super(); - } + static final long serialVersionUID = -2848938806368998894L; - public NumberFormatException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public NumberFormatException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public NumberFormatException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/OutOfMemoryError.java b/libjava/java/lang/OutOfMemoryError.java index 81ab753872d..69693e9d0da 100644 --- a/libjava/java/lang/OutOfMemoryError.java +++ b/libjava/java/lang/OutOfMemoryError.java @@ -1,34 +1,66 @@ -// OutOfMemoryError.java +/* OutOfMemoryError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * When the Java Virtual Machine is unable to allocate an object because it + * is out of memory and no more memory could be made available by the + * garbage collector an OutOfMemoryError is thrown. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class OutOfMemoryError extends VirtualMachineError { - public OutOfMemoryError () - { - super (); - } + static final long serialVersionUID = 8228564086184010517L; - public OutOfMemoryError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public OutOfMemoryError() + { + super(); + } + + /** + * Create an error with a message. + */ + public OutOfMemoryError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/RuntimeException.java b/libjava/java/lang/RuntimeException.java index 2d71ae63e11..c3960dc7acd 100644 --- a/libjava/java/lang/RuntimeException.java +++ b/libjava/java/lang/RuntimeException.java @@ -1,32 +1,70 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* RuntimeException.java -- all exceptions which are subclasses of this class + can be thrown at any time during the execution of a Java virtual machine. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * All exceptions which are subclasses of RuntimeException + * can be thrown at any time during the execution of a Java virtual machine. + * Methods which throw these exceptions are not required to declare them + * in their throws clause. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class RuntimeException extends Exception { - public RuntimeException() - { - super(); - } + static final long serialVersionUID = -7034897190745766939L; - public RuntimeException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public RuntimeException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public RuntimeException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/SecurityException.java b/libjava/java/lang/SecurityException.java index d481e2908c1..25db4248762 100644 --- a/libjava/java/lang/SecurityException.java +++ b/libjava/java/lang/SecurityException.java @@ -1,31 +1,68 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* SecurityException.java -- exception thrown to indicate a security + violation. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * The security manager will throw this exception to indicate a security + * violation. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class SecurityException extends RuntimeException { - public SecurityException() - { - super(); - } + static final long serialVersionUID = 6878364983674394167L; - public SecurityException(String msg) - { - super(msg); - } + /** + * Create an exception without a message. + */ + public SecurityException() + { + super(); + } + + /** + * Create an exception with a message. + */ + public SecurityException(String s) + { + super(s); + } } diff --git a/libjava/java/lang/SecurityManager.java b/libjava/java/lang/SecurityManager.java index 9c14552b9c9..345bb22628d 100644 --- a/libjava/java/lang/SecurityManager.java +++ b/libjava/java/lang/SecurityManager.java @@ -1,268 +1,765 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* java.lang.SecurityManager + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -// SecurityManager package java.lang; -/** - * @author Anthony Green - * @date October 5, 1998. - */ - -/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 - */ - -import java.io.*; import java.net.*; +import java.util.*; +import java.io.*; -public abstract class SecurityManager -{ - protected boolean inCheck = false; +/** + ** SecurityManager is a class you can extend to create + ** your own Java security policy. By default, there is + ** no SecurityManager installed in 1.1, which means that + ** all things are permitted to all people.

+ ** + ** The default methods in this class deny all + ** things to all people. + ** + ** @author John Keiser + ** @version 1.1.0, 31 May 1998 + ** @since JDK1.0 + **/ +public class SecurityManager { + /** Tells whether or not the SecurityManager is currently + ** performing a security check. + **/ + protected boolean inCheck; - public void checkAccept (String host, int port) - { - throw new SecurityException(); - } - - public void checkAccess (Thread thrd) - { - throw new SecurityException(); - } - - public void checkAccess (ThreadGroup thrdGroup) - { - throw new SecurityException(); - } - - public void checkAwtEventQueueAccess () - { - throw new SecurityException(); - } - - public void checkConnect (String host, int prt) - { - throw new SecurityException(); - } - - public void checkConnect (String host, int prt, Object ctx) - { - throw new SecurityException(); - } - - public void checkCreateClassLoader () - { - throw new SecurityException(); - } - - public void checkDelete (String fileName) - { - throw new SecurityException(); - } - - public void checkExec (String prog) - { - throw new SecurityException(); - } - - public void checkExit (int stat) - { - throw new SecurityException(); - } - - public void checkLink (String lib) - { - throw new SecurityException(); - } - - public void checkListen (int lport) - { - throw new SecurityException(); - } - - public void checkMemberAccess (Class cl, int mtype) - { - throw new SecurityException(); - } - - public void checkMulticast (InetAddress maddr) - { - throw new SecurityException(); - } - - public void checkMulticast (InetAddress maddr, byte ttl) - { - throw new SecurityException(); - } - - public void checkPackageAccess (String pkg) - { - throw new SecurityException(); - } - - public void checkPackageDefinition (String pkg) - { - throw new SecurityException(); - } - - public void checkPermission (java.security.Permission perm) - { - throw new SecurityException(); - } - - public void checkPrintJobAccess () - { - throw new SecurityException(); - } - - public void checkPropertiesAccess () - { - throw new SecurityException(); - } - - public void checkPropertyAccess (String prop) - { - throw new SecurityException(); - } - - public void checkPropertyAccess (String prop, String defval) - { - throw new SecurityException(); - } - - public void checkRead (FileDescriptor fd) - { - throw new SecurityException(); - } - - public void checkRead (String fileName) - { - throw new SecurityException(); - } - - public void checkRead (String fileName, Object ctx) - { - throw new SecurityException(); - } - - public void checkSecurityAccess (String action) - { - throw new SecurityException(); - } - - public void checkSetFactory () - { - throw new SecurityException(); - } - - public void checkSystemClipboardAccess () - { - throw new SecurityException(); - } - - public boolean checkTopLevelWindow (Object window) - { - throw new SecurityException(); - } - - public void checkWrite (FileDescriptor fd) - { - throw new SecurityException(); - } - - public void checkWrite (String fileName) - { - throw new SecurityException(); - } - - // Note: this method is deprecated in JDK 1.2 - protected /* native */ int classDepth (String className) - { - Class[] classStack = getClassContext (); - for (int i = 0; i < classStack.length; i++) - if (classStack[i].getName().compareTo(className) == 0) - return i; - - return -1; - } - - // Note: this method is deprecated in JDK 1.2 - protected /* native */ int classLoaderDepth () - { - Class[] classStack = getClassContext (); - for (int i = 0; i < classStack.length; i++) - if (classStack[i].getClassLoader() != null) - return i; - - return -1; - } - - protected /* native */ ClassLoader currentClassLoader () - { - Class[] classStack = getClassContext (); - for (int i = 0; i < classStack.length; i++) - { - ClassLoader loader = classStack[i].getClassLoader(); - if (loader != null) - return loader; + /** Tells whether or not the SecurityManager is currently + ** performing a security check. + ** + ** @return whether or not the SecurityManager is + ** currently performing a security check. + **/ + public boolean getInCheck() { + return inCheck; } - return null; - } - - protected /* native */ Class currentLoadedClass () - { - Class[] classStack = getClassContext (); - for (int i = 0; i < classStack.length; i++) - { - ClassLoader loader = classStack[i].getClassLoader(); - if (loader != null) - return classStack[i]; + /** Get a list of all the classes currently executing + ** methods on the Java stack. getClassContext()[0] is + ** the currently executing method + ** Spec Note: does not say whether + ** the stack will include the getClassContext() call or + ** the one just before it. + ** + ** @return an array containing all the methods on classes + ** on the Java execution stack. + **/ + protected Class[] getClassContext() { + return VMSecurityManager.getClassContext(); } - - return null; - } - protected /* native */ Class[] getClassContext () - { - return new Class[0]; - } + /** Find the ClassLoader for the most recent class on the + ** stack that was loaded by an explicit ClassLoader. If + ** everything on the stack was loaded by the system + ** classloader, null is returned. + ** + ** @return the most recent ClassLoader on the execution + ** stack. + **/ + protected ClassLoader currentClassLoader() { + return VMSecurityManager.currentClassLoader(); + } - // Note: this method is deprecated in JDK 1.2 - public boolean getInCheck () - { - return inCheck; - } + /** Find the most recent class on the stack that was + ** loaded by an explicit ClassLoader. If everything on + ** the stack was loaded by the system classloader, null + ** is returned. + ** + ** @return the most recent loaded Class on the execution + ** stack. + **/ + protected Class currentLoadedClass() { + Class[] c = getClassContext(); + for(int i=0;i + ** + ** Currently the only methods that use this are checkRead() + ** and checkConnect(). + ** + ** @see checkConnect(java.lang.String,int,java.lang.Object) + ** @see checkRead(java.lang.String,java.lang.Object) + **/ + public Object getSecurityContext() { + return new SecurityContext(getClassContext()); + } + + /** Check if the current thread is allowed to create a + ** ClassLoader.

+ ** + ** This method is called from ClassLoader.ClassLoader(), + ** in other words, whenever a ClassLoader is created.

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.ClassLoader#ClassLoader() + **/ + public void checkCreateClassLoader() { + throw new SecurityException("Cannot create new ClassLoaders."); + } + + /** Check if the current thread is allowed to modify this + ** other Thread.

+ ** + ** Called by Thread.stop(), suspend(), resume(), and + ** interrupt(), destroy(), setPriority(), setName() and + ** setDaemon().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param g the Thread to check against + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.Thread#stop() + ** @see java.lang.Thread#suspend() + ** @see java.lang.Thread#resume() + ** @see java.lang.Thread#interrupt() + ** @see java.lang.Thread#destroy() + ** @see java.lang.Thread#setPriority(int) + ** @see java.lang.Thread#setName(java.lang.String) + ** @see java.lang.Thread#setDaemon(boolean) + **/ + public void checkAccess(Thread t) { + throw new SecurityException("Cannot modify Threads."); + } + + /** Check if the current thread is allowed to modify this + ** ThreadGroup.

+ ** + ** Called by Thread.Thread() (to add a thread to the + ** ThreadGroup), ThreadGroup.ThreadGroup() (to add this + ** ThreadGroup to a parent), ThreadGroup.stop(), + ** suspend(), resume(), interrupt(), destroy(), + ** setDaemon(), and setMaxPriority().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param g the ThreadGroup to check against + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.Thread#Thread() + ** @see java.lang.ThreadGroup#ThreadGroup() + ** @see java.lang.ThreadGroup#stop() + ** @see java.lang.ThreadGroup#suspend() + ** @see java.lang.ThreadGroup#resume() + ** @see java.lang.ThreadGroup#interrupt() + ** @see java.lang.ThreadGroup#setDaemon(boolean) + ** @see java.lang.ThreadGroup#setMaxPriority(int) + **/ + public void checkAccess(ThreadGroup g) { + throw new SecurityException("Cannot modify ThreadGroups."); + } + + /** Check if the current thread is allowed to exit the + ** JVM with the given status.

+ ** + ** This method is called from Runtime.exit().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param status the status to exit with + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.Runtime#exit() + ** @see java.lang.Runtime#exit(int) + **/ + public void checkExit(int status) { + throw new SecurityException("Cannot exit JVM."); + } + + /** Check if the current thread is allowed to execute the + ** given program.

+ ** + ** This method is called from Runtime.exec().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param program the name of the program to exec + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.Runtime#exec(java.lang.String[],java.lang.String[]) + **/ + public void checkExec(String program) { + throw new SecurityException("Cannot execute programs."); + } + + /** Check if the current thread is allowed to link in the + ** given native library.

+ ** + ** This method is called from Runtime.load() (and hence, + ** by loadLibrary() as well).

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param filename the full name of the library to load + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.Runtime#load(java.lang.String) + **/ + public void checkLink(String filename) { + throw new SecurityException("Cannot link native libraries."); + } + + /** Check if the current thread is allowed to read the + ** given file using the FileDescriptor.

+ ** + ** This method is called from + ** FileInputStream.FileInputStream().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param desc the FileDescriptor representing the file + ** to access + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.io.FileInputStream#FileInputStream(java.io.FileDescriptor) + **/ + public void checkRead(FileDescriptor desc) { + throw new SecurityException("Cannot read files via file descriptors."); + } + + /** Check if the current thread is allowed to read the + ** given file.

+ ** + ** This method is called from + ** FileInputStream.FileInputStream(), + ** RandomAccessFile.RandomAccessFile(), File.exists(), + ** canRead(), isFile(), isDirectory(), lastModified(), + ** length() and list().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param filename the full name of the file to access + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.io.File + ** @see java.io.FileInputStream#FileInputStream(java.lang.String) + ** @see java.io.RandomAccessFile#RandomAccessFile(java.lang.String) + **/ + public void checkRead(String filename) { + throw new SecurityException("Cannot read files via file names."); + } + + /** Check if the current thread is allowed to read the + ** given file. using the given SecurityContext.

+ ** + ** I know of no core class that calls this method.

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param filename the full name of the file to access + ** @param securityContext the Security Context to + ** determine access for. + ** @exception SecurityException if the operation is not + ** permitted. + **/ + public void checkRead(String filename, Object securityContext) { + throw new SecurityException("Cannot read files via file names."); + } + + /** Check if the current thread is allowed to write to the + ** given file using the FileDescriptor.

+ ** + ** This method is called from + ** FileOutputStream.FileOutputStream().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param desc the FileDescriptor representing the file + ** to access + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.io.FileOutputStream#FileOutputStream(java.io.FileDescriptor) + **/ + public void checkWrite(FileDescriptor desc) { + throw new SecurityException("Cannot write files via file descriptors."); + } + + /** Check if the current thread is allowed to write to the + ** given file.

+ ** + ** This method is called from + ** FileOutputStream.FileOutputStream(), + ** RandomAccessFile.RandomAccessFile(), + ** File.canWrite(), mkdir(), and renameTo().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param filename the full name of the file to access + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.io.File#canWrite() + ** @see java.io.File#mkdir() + ** @see java.io.File#renameTo() + ** @see java.io.FileOutputStream#FileOutputStream(java.lang.String) + ** @see java.io.RandomAccessFile#RandomAccessFile(java.lang.String) + **/ + public void checkWrite(String filename) { + throw new SecurityException("Cannot write files via file names."); + } + + /** Check if the current thread is allowed to delete the + ** given file.

+ ** + ** This method is called from File.delete().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param filename the full name of the file to delete + ** @exception SecurityException if th operation is not + ** permitted. + ** @see java.io.File#delete() + **/ + public void checkDelete(String filename) { + throw new SecurityException("Cannot delete files."); + } + + /** Check if the current thread is allowed to connect to a + ** given host on a given port.

+ ** + ** This method is called from Socket.Socket(). + ** + ** SecurityManager's implementation always denies access. + ** + ** @param host the host to connect to + ** @param port the port to connect on + ** @exception SecurityException if the operation is not + ** permitted + ** @see java.net.Socket#Socket() + **/ + public void checkConnect(String host, int port) { + throw new SecurityException("Cannot make network connections."); + } + + /** Check if the current thread is allowed to connect to a + ** given host on a given port using a specific security + ** context to determine access.

+ ** + ** This method is not called in the 1.1 core classes.

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param host the host to connect to + ** @param port the port to connect on + ** @param securityContext the security context to + ** determine access with + ** @exception SecurityException if the operation is not + ** permitted + **/ + public void checkConnect(String host, int port, Object securityContext) { + throw new SecurityException("Cannot make network connections."); + } + + /** Check if the current thread is allowed to listen to a + ** specific port for data.

+ ** + ** This method is called by ServerSocket.ServerSocket().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param port the port to listen on + ** @exception SecurityException if the operation is not + ** permitted + ** @see java.net.ServerSocket#ServerSocket(int) + **/ + public void checkListen(int port) { + throw new SecurityException("Cannot listen for connections."); + } + + /** Check if the current thread is allowed to accept a + ** connection from a particular host on a particular + ** port.

+ ** + ** This method is called by ServerSocket.implAccept().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param host the host which wishes to connect + ** @param port the port the connection will be on + ** @exception SecurityException if the operation is not + ** permitted + ** @see java.net.ServerSocket#accept() + **/ + public void checkAccept(String host, int port) { + throw new SecurityException("Cannot accept connections."); + } + + /** Check if the current thread is allowed to read and + ** write multicast to a particular address.

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @XXX where is it called? + ** + ** @param addr the address to multicast to. + ** @exception SecurityException if the operation is not + ** permitted. + **/ + public void checkMulticast(InetAddress addr) { + throw new SecurityException("Cannot read or write multicast."); + } + + /** Check if the current thread is allowed to read and + ** write multicast to a particular address with a + ** particular ttl value.

+ ** + ** SecurityManager's implementation always denies access.

+ ** + ** @XXX where is it called? + ** + ** @XXX what the hell is ttl? Expand abbreviation. + ** + ** @param addr the address to multicast to. + ** @param ttl the ttl value to use + ** @exception SecurityException if the operation is not + ** permitted. + **/ + public void checkMulticast(InetAddress addr, byte ttl) { + throw new SecurityException("Cannot read or write multicast."); + } + + /** + ** Check if the current thread is allowed to perform an + ** operation that requires the specified Permission. + ** + ** @param perm The Permission required. + ** @exception SecurityException If the operation is not allowed. + **/ + public void checkPermission(java.security.Permission perm) { + throw new SecurityException("Operation not allowed"); + } + + /** + ** Check if the current thread is allowed to perform an + ** operation that requires the specified Permission. + ** + ** @param perm The Permission required. + ** @param context A security context + ** @exception SecurityException If the operation is not allowed. + ** @since 1.2 + **/ + public void checkPermission(java.security.Permission perm, + Object context) { + throw new SecurityException("Operation not allowed"); + } + + /** Check if the current thread is allowed to read or + ** write all the system properties at once.

+ ** + ** This method is called by System.getProperties() + ** and setProperties().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.System#getProperties() + ** @see java.lang.System#setProperties(java.util.Properties) + **/ + public void checkPropertiesAccess() { + throw new SecurityException("Cannot access all system properties at once."); + } + + /** Check if the current thread is allowed to read or + ** write a particular system property.

+ ** + ** This method is called by System.getProperty() and + ** setProperty().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @exception SecurityException is the operation is not + ** permitted. + ** @see java.lang.System#getProperty(java.lang.String) + ** @see java.lang.System#setProperty(java.lang.String,java.lang.String) + **/ + public void checkPropertyAccess(String name) { + throw new SecurityException("Cannot access individual system properties."); + } + + /** Check if the current thread is allowed to create a + ** top-level window. If it is not, the operation should + ** still go through, but some sort of nonremovable + ** warning should be placed on the window to show that it + ** is untrusted.

+ ** + ** This method is called by Window.Window().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param window the window to create + ** @see java.awt.Window#Window(java.awt.Frame) + **/ + public boolean checkTopLevelWindow(Object window) { + return false; + } + + /** Check if the current thread is allowed to create a + ** print job.

+ ** + ** This method is called by Toolkit.getPrintJob(). (I + ** assume so, at least, it just don't say nothing about + ** it in the spec.)

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.awt.Toolkit.getPrintJob(java.awt.Frame,java.lang.String,java.util.Properties) + **/ + public void checkPrintJobAccess() { + throw new SecurityException("Cannot create print jobs."); + } + + /** Check if the current thread is allowed to use the + ** system clipboard.

+ ** + ** This method is called by Toolkit.getSystemClipboard(). + ** (I assume.)

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.awt.Toolkit#getSystemClipboard() + **/ + public void checkSystemClipboardAccess() { + throw new SecurityException("Cannot access the system clipboard."); + } + + /** Check if the current thread is allowed to use the AWT + ** event queue.

+ ** + ** This method is called by Toolkit.getSystemEventQueue().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.awt.Toolkit#getSystemEventQueue() + **/ + public void checkAwtEventQueueAccess() { + throw new SecurityException("Cannot access the AWT event queue."); + } + + /** Check if the current thread is allowed to access the + ** specified package at all.

+ ** + ** This method is called by ClassLoader.loadClass() in + ** user-created ClassLoaders.

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param packageName the package name to check access to + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.ClassLoader#loadClass(java.lang.String,boolean) + **/ + public void checkPackageAccess(String packageName) { + throw new SecurityException("Cannot access packages via the ClassLoader."); + } + + /** Check if the current thread is allowed to define + ** classes the specified package. If the class already + ** created, though, ClassLoader.loadClass() can still + ** return the Class if checkPackageAccess() checks out.

+ ** + ** This method is called by ClassLoader.loadClass() in + ** user-created ClassLoaders.

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param packageName the package name to check access to + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.ClassLoader#loadClass(java.lang.String,boolean) + **/ + public void checkPackageDefinition(String packageName) { + throw new SecurityException("Cannot load classes into any packages via the ClassLoader."); + } + + /** Check if the current thread is allowed to set the + ** current socket factory.

+ ** + ** This method is called by Socket.setSocketImplFactory(), + ** ServerSocket.setSocketFactory(), and + ** URL.setURLStreamHandlerFactory().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory) + ** @see java.net.ServerSocket#setSocketFactory(java.net.SocketImplFactory) + ** @see java.net.URL#setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory) + **/ + public void checkSetFactory() { + throw new SecurityException("Cannot set the socket factory."); + } + + /** Check if the current thread is allowed to get certain + ** types of Methods, Fields and Constructors from a Class + ** object.

+ ** + ** This method is called by Class.getMethod[s](), + ** Class.getField[s](), Class.getConstructor[s], + ** Class.getDeclaredMethod[s](), + ** Class.getDeclaredField[s](), and + ** Class.getDeclaredConstructor[s]().

+ ** + ** SecurityManager's implementation always denies access. + ** + ** @param c the Class to check + ** @param memberType the type of members to check + ** against, either Member.DECLARED or + ** Member.PUBLIC. + ** @exception SecurityException if the operation is not + ** permitted. + ** @see java.lang.Class + ** @see java.lang.reflect.Member#DECLARED + ** @see java.lang.reflect.Member#PUBLIC + **/ + public void checkMemberAccess(Class c, int memberType) { + throw new SecurityException("Cannot access members of classes."); + } + + /** Test whether a particular security action may be + ** taken. + ** @param action the desired action to take + ** @exception SecurityException if the action is denied. + ** @XXX I have no idea what actions must be tested + ** or where. + **/ + public void checkSecurityAccess(String action) { + checkPermission (new java.security.SecurityPermission (action)); + } + + /** Get the ThreadGroup that a new Thread should belong + ** to by default.

+ ** + ** Called by Thread.Thread().

+ ** + ** SecurityManager's implementation just uses the + ** ThreadGroup of the current Thread.

+ ** + ** Spec Note: it is not clear whether + ** the new Thread is guaranteed to pass the + ** checkAccessThreadGroup() test when using this + ** ThreadGroup. I presume so. + ** + ** @return the ThreadGroup to put the new Thread into. + **/ + public ThreadGroup getThreadGroup() { + return Thread.currentThread().getThreadGroup(); + } + + protected SecurityManager () { + if (System.getSecurityManager () != null) + throw new SecurityException (); + } +} + +class SecurityContext { + Class[] classes; + SecurityContext(Class[] classes) { + this.classes = classes; + } } diff --git a/libjava/java/lang/StackOverflowError.java b/libjava/java/lang/StackOverflowError.java index f4987c18a20..9c155e8a7ff 100644 --- a/libjava/java/lang/StackOverflowError.java +++ b/libjava/java/lang/StackOverflowError.java @@ -1,34 +1,65 @@ -// StackOverflowError.java +/* StackOverflowError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * A StackOverflowError is thrown when a stack overflow occurs. + * This can occur because an application recurses too deeply. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class StackOverflowError extends VirtualMachineError { - public StackOverflowError () - { - super (); - } + static final long serialVersionUID = 8609175038441759607L; - public StackOverflowError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public StackOverflowError() + { + super(); + } + + /** + * Create an error with a message. + */ + public StackOverflowError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/StringIndexOutOfBoundsException.java b/libjava/java/lang/StringIndexOutOfBoundsException.java index 9c0c60ff758..ebfc03c37c4 100644 --- a/libjava/java/lang/StringIndexOutOfBoundsException.java +++ b/libjava/java/lang/StringIndexOutOfBoundsException.java @@ -1,37 +1,79 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* StringIndexOutOfBoundsException.java -- exception thrown to indicate + an attempt to access an index which is out of bounds. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * Exceptions may be thrown by one part of a Java program and caught + * by another in order to deal with exceptional conditions. + * This exception can be thrown to indicate an attempt to access an + * index which is out of bounds. + * Any negative integer less than or equal to -1 and positive + * integer greater than or equal to the size of the string is an index + * which would be out of bounds. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Warren Levy + * @date September 18, 1998. + */ public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException { + static final long serialVersionUID = -6762910422159637258L; + + /** + * Create an exception without a message. + */ public StringIndexOutOfBoundsException() - { - super(); - } + { + super(); + } + /** + * Create an exception with a message. + */ + public StringIndexOutOfBoundsException(String s) + { + super(s); + } + + /** + * Create an exception noting the illegal index. + */ public StringIndexOutOfBoundsException(int index) - { - this("String index out of range: " + index); - } - - public StringIndexOutOfBoundsException(String msg) - { - super(msg); - } + { + super("String index out of range: " + index); + } } diff --git a/libjava/java/lang/System.java b/libjava/java/lang/System.java index 0f7bd7ba8b7..9ac160a56f3 100644 --- a/libjava/java/lang/System.java +++ b/libjava/java/lang/System.java @@ -158,7 +158,7 @@ public final class System public static String getProperty (String property, String defval) { if (secman != null) - secman.checkPropertyAccess(property, defval); + secman.checkPropertyAccess(property); if (properties == null) init_properties (); return properties.getProperty(property, defval); diff --git a/libjava/java/lang/ThreadDeath.java b/libjava/java/lang/ThreadDeath.java index ae0e3fb40f6..fe4f9ba831c 100644 --- a/libjava/java/lang/ThreadDeath.java +++ b/libjava/java/lang/ThreadDeath.java @@ -1,30 +1,49 @@ -// ThreadDeath.java - Special exception registering Thread death. +/* java.lang.ThreadDeath - Special exception registering Thread death. + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.lang; -/** - * @author Tom Tromey - * @date August 26, 1998 - */ - /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Complete to version 1.1 */ -public class ThreadDeath extends Error -{ - public ThreadDeath () - { - super (); - } +/** + ** ThreadDeath is thrown in a thread when someone calls stop() on that thread. + ** + ** Important: Make sure you rethrow this exception if you catch it. If you don't, the thread will not die. + ** + ** @author John Keiser + ** @author Tom Tromey + ** @version 1.1.0, 5 Feb 1998, August 26 1998 + ** @since JDK1.0 + ** @see java.lang.Thread#stop() + **/ + +public class ThreadDeath extends Error { } diff --git a/libjava/java/lang/UnknownError.java b/libjava/java/lang/UnknownError.java index a7d1e20881a..58214ff1af6 100644 --- a/libjava/java/lang/UnknownError.java +++ b/libjava/java/lang/UnknownError.java @@ -1,34 +1,63 @@ -// UnknownError.java +/* UnknownError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * An UnknownError is thrown when a serious but unknown + * problem has occurred in the Java Virtual Machine. + * + * @since JDK 1.0 + * + * @author Brian Jones + */ public class UnknownError extends VirtualMachineError { - public UnknownError () - { - super (); - } + static final long serialVersionUID = 2524784860676771849L; - public UnknownError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public UnknownError() + { + super(); + } + + /** + * Create an error with a message. + */ + public UnknownError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/UnsatisfiedLinkError.java b/libjava/java/lang/UnsatisfiedLinkError.java index 07456422c3e..63c3a1e5dd6 100644 --- a/libjava/java/lang/UnsatisfiedLinkError.java +++ b/libjava/java/lang/UnsatisfiedLinkError.java @@ -1,34 +1,66 @@ -// UnsatisfiedLinkError.java +/* UnsatisfiedLinkError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Believed complete and correct. + * Status: Believed complete and correct. */ +/** + * A UnsatisfiedLinkError is thrown if an appropriate + * native language definition of a method declared native + * cannot be found by the Java Virtual Machine. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class UnsatisfiedLinkError extends LinkageError { - public UnsatisfiedLinkError () - { - super (); - } + static final long serialVersionUID = -4019343241616879428L; - public UnsatisfiedLinkError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public UnsatisfiedLinkError() + { + super(); + } + + /** + * Create an error with a message. + */ + public UnsatisfiedLinkError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/UnsupportedClassVersionError.java b/libjava/java/lang/UnsupportedClassVersionError.java new file mode 100644 index 00000000000..c0ce259f6cd --- /dev/null +++ b/libjava/java/lang/UnsupportedClassVersionError.java @@ -0,0 +1,58 @@ +/* UnsupportedClassVersionError.java + Copyright (C) 1998 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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + +package java.lang; + +/** + * An UnsupportedClassVersionError is thrown when the + * Java Virtual Machine determines it does not support the major and minor + * version numbers in the class file it is attempting to read. + * + * @since JDK 1.2 + * + * @author Brian Jones + */ +public class UnsupportedClassVersionError extends ClassFormatError +{ + static final long serialVersionUID = -7123279212883497373L; + + /** + * Create an error without a message. + */ + public UnsupportedClassVersionError() + { + super(); + } + + /** + * Create an error with a message. + */ + public UnsupportedClassVersionError(String s) + { + super(s); + } +} diff --git a/libjava/java/lang/UnsupportedOperationException.java b/libjava/java/lang/UnsupportedOperationException.java index f321fd08ef9..8cf1b1f35e5 100644 --- a/libjava/java/lang/UnsupportedOperationException.java +++ b/libjava/java/lang/UnsupportedOperationException.java @@ -1,32 +1,65 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* UnsupportedOperationException.java -- Exception thrown when an + unsupported operation is attempted on an object + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +This file is part of GNU Classpath. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Warren Levy - * @date September 18, 1998. - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ - + +/** + * This exception is thrown by an object when an operation is + * requested of it that it does not support. + * + * @since JDK 1.2 + * + * @author Warren Levy + * @date September 18, 1998. + */ public class UnsupportedOperationException extends RuntimeException { - public UnsupportedOperationException() + static final long serialVersionUID = -1242599979055084673L; + + /** + * Create an exception without a message. + */ + public UnsupportedOperationException() { super(); } - public UnsupportedOperationException(String msg) + /** + * Create an exception with a message. + */ + public UnsupportedOperationException( String s ) { - super(msg); + super(s); } } diff --git a/libjava/java/lang/VMSecurityManager.java b/libjava/java/lang/VMSecurityManager.java new file mode 100644 index 00000000000..fd16804b8f2 --- /dev/null +++ b/libjava/java/lang/VMSecurityManager.java @@ -0,0 +1,71 @@ +/* + * java.lang.SecurityManager: part of the Java Class Libraries project. + * Copyright (C) 1998, 2001 Free Software Foundation + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +package java.lang; + +import java.net.*; +import java.util.*; +import java.io.*; + +/** + ** VMSecurityManager is a helper class for SecurityManager the VM must + ** implement. + ** + ** @author John Keiser + ** @version 1.1.0, 31 May 1998 + **/ +class VMSecurityManager +{ + /** Get a list of all the classes currently executing + ** methods on the Java stack. getClassContext()[0] is + ** the currently executing method + ** Spec Note: does not say whether + ** the stack will include the getClassContext() call or + ** the one just before it. + ** + ** @return an array containing all the methods on classes + ** on the Java execution stack. + **/ + static Class[] getClassContext() + { + // FIXME: can't yet implement this for libgcj. + return new Class[0]; + } + + /** Get the current ClassLoader--the one nearest to the + ** top of the stack. + ** @return the current ClassLoader. + **/ + static ClassLoader currentClassLoader() + { + // The docs above are wrong. See the online docs. + // FIXME this implementation is a bit wrong too -- the docs say we + // must also consider ancestors of the system class loader. + Class[] classStack = getClassContext (); + for (int i = 0; i < classStack.length; i++) + { + ClassLoader loader = classStack[i].getClassLoader(); + if (loader != null) + return loader; + } + + return null; + } +} diff --git a/libjava/java/lang/VerifyError.java b/libjava/java/lang/VerifyError.java index 0e89e6028e5..801428da5d3 100644 --- a/libjava/java/lang/VerifyError.java +++ b/libjava/java/lang/VerifyError.java @@ -1,34 +1,65 @@ -// VerifyError.java +/* VerifyError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ +/** + * A VerifyError is thrown if there is a security problem or + * internal inconsistency in a class file as deteced by the "verifier." + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public class VerifyError extends LinkageError { - public VerifyError () - { - super (); - } + static final long serialVersionUID = 7001962396098498785L; - public VerifyError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public VerifyError() + { + super(); + } + + /** + * Create an error with a message. + */ + public VerifyError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/VirtualMachineError.java b/libjava/java/lang/VirtualMachineError.java index 916842c8562..a64ca43d10c 100644 --- a/libjava/java/lang/VirtualMachineError.java +++ b/libjava/java/lang/VirtualMachineError.java @@ -1,39 +1,66 @@ -// VirtualMachineError.java +/* VirtualMachineError.java + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang; - -/** - * @author Tom Tromey - * @date October 1, 1998 - */ + /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * plus online API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ -/* FIXME: We should consider adding some special error message when this - * exception is thrown, or maybe if it being caught at top-level. Such - * a message would direct the user to send a bug report to - * gcj-bugs@cygnus.com, or something like that. --KKT */ - +/** + * A VirtualMachineError or its subclasses are thrown to + * indicate there is something wrong with the Java Virtual Machine or that + * it does not have the resources needed for it to continue execution. + * + * @since JDK 1.0 + * + * @author Brian Jones + * @author Tom Tromey + * @date October 1, 1998 + */ public abstract class VirtualMachineError extends Error { - public VirtualMachineError () - { - super (); - } + static final long serialVersionUID = 4161983926571568670L; - public VirtualMachineError (String msg) - { - super (msg); - } + /** + * Create an error without a message. + */ + public VirtualMachineError() + { + super(); + } + + /** + * Create an error with a message. + */ + public VirtualMachineError(String s) + { + super(s); + } } diff --git a/libjava/java/lang/reflect/InvocationTargetException.java b/libjava/java/lang/reflect/InvocationTargetException.java index 0152a7bf2f5..4e04b42803e 100644 --- a/libjava/java/lang/reflect/InvocationTargetException.java +++ b/libjava/java/lang/reflect/InvocationTargetException.java @@ -1,75 +1,128 @@ -// InvocationTargetException.java - Wrapper exception for reflection. +/* InvocationTargetException.java - Wrapper exception for reflection + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999, 2000 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. - -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ + + package java.lang.reflect; + import java.io.PrintStream; import java.io.PrintWriter; -/** - * @author Tom Tromey - * @date December 12, 1998 - */ /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 * Status: Believed complete and correct. */ -public class InvocationTargetException extends Exception +/** + * InvocationTargetException is sort of a way to "wrap" whatever exception + * comes up when a method or constructor is called via Reflection. + * + * @author John Keiser + * @version 1.1.0, 31 May 1998 + * @author Tom Tromey + * @date December 12, 1998 + * + * @see Method#invoke(Object,Object[]) + * @see Constructor#newInstance(Object[]) + */ + +public class InvocationTargetException extends Exception { - public Throwable getTargetException () + static final long serialVersionUID = 4085088731926701167L; + + private Throwable target = null; + + protected InvocationTargetException() + { + super(); + } + + /** + * Create an InvocationTargetException using another + * exception. + * @param targetException the exception to wrap + */ + public InvocationTargetException(Throwable targetException) + { + super(targetException.toString()); + target = targetException; + } + + /** + * Create an InvocationTargetException using another + * exception and an error message. + * + * @param targetException the exception to wrap + * @param err an extra reason for the exception-throwing + */ + public InvocationTargetException(Throwable targetException, String err) + { + super(err); + target = targetException; + } + + /** + * Get the wrapped (targeted) exception. + * + * @return the targeted exception. + */ + public Throwable getTargetException() { return target; } - protected InvocationTargetException () + public void printStackTrace() { - super (); - target = null; - } - - public InvocationTargetException (Throwable exception) - { - super (); - target = exception; - } - - public InvocationTargetException (Throwable exception, String msg) - { - super (msg); - target = exception; - } - - // This is from JDK 1.2. - public void printStackTrace () - { - if (target != null) + if (target == null) + super.printStackTrace(); + else + { + System.err.print(this.getClass() + ": "); target.printStackTrace(); + } } - // This is from JDK 1.2. - public void printStackTrace (PrintStream s) + public void printStackTrace(PrintStream ps) { - if (target != null) - target.printStackTrace(s); + if (target == null) + super.printStackTrace(ps); + else + { + ps.print(this.getClass() + ": "); + target.printStackTrace(ps); + } } - // This is from JDK 1.2. - public void printStackTrace (PrintWriter wr) + public void printStackTrace(PrintWriter pw) { - if (target != null) - target.printStackTrace(wr); + if (target == null) + super.printStackTrace(pw); + else + { + pw.print(this.getClass() + ": "); + target.printStackTrace(pw); + } } - - // The wrapped exception. The name is specified by the - // serialization spec. - private Throwable target; - - private static final long serialVersionUID = 4085088731926701167L; } diff --git a/libjava/java/net/BindException.java b/libjava/java/net/BindException.java index 3e3255c7e1f..3aeedd3e6fb 100644 --- a/libjava/java/net/BindException.java +++ b/libjava/java/net/BindException.java @@ -1,35 +1,75 @@ -// BindException.java +/* BindException.java -- An exception occured while binding to a socket + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ package java.net; -/** - * @author Warren Levy - * @date March 5, 1999. - */ - /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ +/** + * This exception indicates that an error occured while attempting to bind + * socket to a particular port. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy + * @date March 5, 1999. + */ public class BindException extends SocketException { - public BindException() - { - super(); - } - public BindException(String msg) - { - super(msg); - } +/* + * Constructors + */ + +/** + * Initializes a new instance of BindException without + * a descriptive error message. + */ +public +BindException() +{ + super(); } + +/*************************************************************************/ + +/** + * Initializes a new instance of BindException with + * a descriptive error message, such as the text from strerror(3). + * + * @param message A message describing the error that occurred. + */ +public +BindException(String message) +{ + super(message); +} + +} // class BindException + diff --git a/libjava/java/net/ConnectException.java b/libjava/java/net/ConnectException.java index 449056fc791..0ac64c8888c 100644 --- a/libjava/java/net/ConnectException.java +++ b/libjava/java/net/ConnectException.java @@ -1,35 +1,77 @@ -// ConnectException.java +/* ConnectException.java -- An exception occured while connecting to a host + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.net; -/** - * @author Warren Levy - * @date March 5, 1999. - */ - /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ +/** + * This exception indicates that an error occured while attempting to + * connect to a remote host. Often this indicates that the remote host + * refused the connection (ie, is not listening on the target socket). + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy + * @date March 5, 1999. + */ public class ConnectException extends SocketException { - public ConnectException() - { - super(); - } - public ConnectException(String msg) - { - super(msg); - } +/* + * Constructors + */ + +/** + * Initializes a new instance of ConnectException without + * a descriptive error message. + */ +public +ConnectException() +{ + super(); } + +/*************************************************************************/ + +/** + * Initializes a new instance of ConnectException with + * a descriptive error message, such as the text from strerror(3). + * + * @param message A message describing the error that occurred. + */ +public +ConnectException(String message) +{ + super(message); +} + +} // class ConnectException + diff --git a/libjava/java/net/MalformedURLException.java b/libjava/java/net/MalformedURLException.java index 5ea6480b780..660f253dec3 100644 --- a/libjava/java/net/MalformedURLException.java +++ b/libjava/java/net/MalformedURLException.java @@ -1,35 +1,75 @@ -// MalformedURLException.java +/* MalformedURLException.java -- A URL was not in a valid format + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ package java.net; -/** - * @author Warren Levy - * @date March 5, 1999. - */ - /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ +/** + * This exception indicates that a URL passed to an object was not in a + * valid format. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy + * @date March 5, 1999. + */ public class MalformedURLException extends java.io.IOException { - public MalformedURLException() - { - super(); - } - public MalformedURLException(String msg) - { - super(msg); - } +/* + * Constructors + */ + +/** + * Initializes a new instance of MalformedURLException without + * a descriptive error message. + */ +public +MalformedURLException() +{ + super(); } + +/*************************************************************************/ + +/** + * Initializes a new instance of MalformedURLException without + * a descriptive error message. + * + * @param message A message describing the error that occurred. + */ +public +MalformedURLException(String message) +{ + super(message); +} + +} // class MalformedURLException + diff --git a/libjava/java/net/NoRouteToHostException.java b/libjava/java/net/NoRouteToHostException.java index cb1c5f8bad9..bae9fa9f077 100644 --- a/libjava/java/net/NoRouteToHostException.java +++ b/libjava/java/net/NoRouteToHostException.java @@ -1,35 +1,76 @@ -// NoRouteToHostException.java +/* NoRouteToHostException.java -- Cannot connect to a host + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.net; -/** - * @author Warren Levy - * @date March 5, 1999. - */ - /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ +/** + * This exception indicates that there is no TCP/IP route to the requested + * host. This is often due to a misconfigured routing table. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy + * @date March 5, 1999. + */ public class NoRouteToHostException extends SocketException { - public NoRouteToHostException() - { - super(); - } - public NoRouteToHostException(String msg) - { - super(msg); - } +/* + * Constructors + */ + +/** + * Initializes an instance of NoRouteToHostException + * without a descriptive error message. + */ +public +NoRouteToHostException() +{ + super(); } + +/*************************************************************************/ + +/** + * Initializes an instance of NoRouteToHostException + * witha descriptive error message, such as the text from strerror(3). + * + * @param message A message describing the error that occurred. + */ +public +NoRouteToHostException(String message) +{ + super(message); +} + +} // class NoRouteToHostException + diff --git a/libjava/java/net/ProtocolException.java b/libjava/java/net/ProtocolException.java index 2263457d805..5556f28abab 100644 --- a/libjava/java/net/ProtocolException.java +++ b/libjava/java/net/ProtocolException.java @@ -1,35 +1,76 @@ -// ProtocolException.java +/* ProtocolException.java -- A low level protocol error occured + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ package java.net; -/** - * @author Warren Levy - * @date March 5, 1999. - */ - /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ +/** + * This exception indicates that some sort of low level protocol + * exception occured. Look in the descriptive message (if any) for + * details on what went wrong + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy + * @date March 5, 1999. + */ public class ProtocolException extends java.io.IOException { - public ProtocolException() - { - super(); - } - public ProtocolException(String msg) - { - super(msg); - } +/* + * Constructors + */ + +/** + * Initializes a new instance of ProtocolException + * without a descriptive error message. + */ +public +ProtocolException() +{ + super(); } + +/*************************************************************************/ + +/** + * Initializes a new instance of ProtocolException + * with a descriptive error message. + * + * @param message A message describing the error that occurred. + */ +public +ProtocolException(String message) +{ + super(message); +} + +} // class ProtocolException + diff --git a/libjava/java/net/SocketException.java b/libjava/java/net/SocketException.java index 847cdc9048d..37135f3a5d7 100644 --- a/libjava/java/net/SocketException.java +++ b/libjava/java/net/SocketException.java @@ -1,33 +1,74 @@ -// SocketException.java - Base class for networking exceptions +/* SocketException.java -- An exception occured while performing a socket op + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ package java.net; -/** - * @author Per Bothner - * @date January 6, 1999. +/* Written using on-line Java Platform 1.2 API Specification. + * Believed complete and correct. */ -/** Written using on-line Java Platform 1.2 API Specification. - * Believed complete and correct. +/** + * This exception indicates that a generic error occured related to an + * operation on a socket. Check the descriptive message (if any) for + * details on the nature of this error + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Per Bothner + * @date January 6, 1999. */ - public class SocketException extends java.io.IOException { - public SocketException () - { - super(); - } - public SocketException (String s) - { - super(s); - } +/* + * Constructors + */ + +/** + * Initializes a new instance of SocketException without + * a descriptive error message. + */ +public +SocketException() +{ + super(); } + +/*************************************************************************/ + +/** + * Initializes a new instance of SocketException without + * a descriptive error message. + * + * @param message A message describing the error that occurred. + */ +public +SocketException(String message) +{ + super(message); +} + +} // class SocketException + diff --git a/libjava/java/net/UnknownHostException.java b/libjava/java/net/UnknownHostException.java index 12936e06761..ad7b25a94bc 100644 --- a/libjava/java/net/UnknownHostException.java +++ b/libjava/java/net/UnknownHostException.java @@ -1,34 +1,77 @@ -// UnknownHostException.java +/* UnknownHostException.java -- The hostname is not unknown + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1998, 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ package java.net; -/** - * @author Per Bothner - * @date January 6, 1999. - */ - /* * Written using on-line Java Platform 1.2 API Specification. * Status: Believed complete and correct. */ +/** + * This exception indicates that an attempt was made to reference a hostname + * or IP address that is not valid. This could possibly indicate that a + * DNS problem has occurred, but most often means that the host was not + * correctly specified. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Per Bothner + * @date January 6, 1999. + */ public class UnknownHostException extends java.io.IOException { - public UnknownHostException () - { - super(); - } - public UnknownHostException (String host) - { - super(host); - } +/* + * Constructors + */ + +/** + * Initializes a new instance of UnknownHostException + * without a descriptive error message. + */ +public +UnknownHostException() +{ + super(); } + +/*************************************************************************/ + +/** + * Initializes a new instance of UnknownHostException + * with a descriptive error message, such as the name of the host + * that could not be resolved. + * + * @param message A message describing the error that occurrred. + */ +public +UnknownHostException(String message) +{ + super(message); +} + +} // class UnknownHostException + diff --git a/libjava/java/net/UnknownServiceException.java b/libjava/java/net/UnknownServiceException.java index 20b00bd3676..f82607a502b 100644 --- a/libjava/java/net/UnknownServiceException.java +++ b/libjava/java/net/UnknownServiceException.java @@ -1,35 +1,77 @@ -// UnknownServiceException.java +/* UnknownServiceException.java -- A service error occured + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -/* Copyright (C) 1999 Free Software Foundation +This file is part of GNU Classpath. - This file is part of libgcj. +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. -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ package java.net; -/** - * @author Warren Levy - * @date March 5, 1999. - */ - /** * Written using on-line Java Platform 1.2 API Specification, as well * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). * Status: Believed complete and correct. */ +/** + * Contrary to what you might think, this does not indicate that the + * TCP/IP service name specified was invalid. Instead it indicates that + * the MIME type returned from a URL could not be determined or that an + * attempt was made to write to a read-only URL. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy + * @date March 5, 1999. + */ public class UnknownServiceException extends java.io.IOException { - public UnknownServiceException() - { - super(); - } - public UnknownServiceException(String msg) - { - super(msg); - } +/* + * Constructors + */ + +/** + * Initializes a new instance of UnknownServiceException + * without a descriptive error message. + */ +public +UnknownServiceException() +{ + super(); } + +/*************************************************************************/ + +/** + * Initializes a new instance of UnknownServiceException + * without a descriptive error message. + * + * @param message A message describing the error that occurred. + */ +public +UnknownServiceException(String message) +{ + super(message); +} + +} // class UnknownServiceException + diff --git a/libjava/java/text/ParseException.java b/libjava/java/text/ParseException.java index 7a654393aec..fd7971a7c23 100644 --- a/libjava/java/text/ParseException.java +++ b/libjava/java/text/ParseException.java @@ -1,34 +1,91 @@ -/* Copyright (C) 1998, 1999 Free Software Foundation +/* ParseException.java -- An error occurred while parsing. + Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. - This file is part of libgcj. +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. + +As a special exception, if you link this library with other files to +produce an executable, this library does not by itself cause the +resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why the +executable file might be covered by the GNU General Public License. */ -This software is copyrighted work licensed under the terms of the -Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -details. */ package java.text; -/** - * @author Per Bothner - * @date October 25, 1998. - */ /* Written using "Java Class Libraries", 2nd edition, plus online * API docs for JDK 1.2 beta from http://www.javasoft.com. * Status: Believed complete and correct. */ +/** + * This exception is thrown when an unexpected error occurs during parsing. + * + * @version 0.0 + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Per Bothner + * @date October 25, 1998. + */ public class ParseException extends Exception { - private int errorOffset; - public ParseException (String msg, int errorOffset) - { - super(msg); - this.errorOffset = errorOffset; - } +/* + * Instance Variables + */ - public int getErrorOffset () - { - return errorOffset; - } +/** + * This is the position where the error was encountered. + */ +private int errorOffset; + +/*************************************************************************/ + +/* + * Constructors + */ + +/** + * This method initializes a new instance of ParseException + * with a detailed error message and a error position. + * + * @param msg The descriptive message describing the error. + * @param offset The position where the error was encountered. + */ +public +ParseException(String s, int offset) +{ + super(s); + + errorOffset = offset; } + +/*************************************************************************/ + +/** + * This method returns the position where the error occurred. + * + * @return The position where the error occurred. + */ +public int +getErrorOffset() +{ + return(errorOffset); +} + +} // class ParseException +