diff options
author | Eric Blake <ebb9@byu.net> | 2002-02-24 04:25:15 +0000 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2002-02-24 04:25:15 +0000 |
commit | a3f60f71365174676e1302f0b201f5772849ffd3 (patch) | |
tree | 493dd1be8064241b1d269916046f7c1f1247b603 /java | |
parent | 70f6e1ec80b4ffc5370564b2710ee194054da42f (diff) | |
download | classpath-a3f60f71365174676e1302f0b201f5772849ffd3.tar.gz |
2002-02-23 Eric Blake <ebb9@email.byu.edu>
* java/awt/AWTError.java: Update to 1.4.
* java/awt/AWTException.java: Ditto.
* java/awt/IllegalComponentStateException.java: Ditto.
* java/awt/datatransfer/MimeTypeParseException.java: Ditto.
* java/awt/datatransfer/UnsupportedFlavorException.java: Ditto.
* java/awt/geom/IllegalPathStateException.java: Ditto.
* java/awt/geom/NoninvertibleTransformException.java: Ditto.
* java/awt/print/PrinterAbortException.java: Ditto.
* java/awt/print/PrinterException.java: Ditto.
* java/awt/print/PrinterIOException.java: Ditto.
* java/beans/IntrospectionException.java: Ditto.
* java/beans/PropertyVetoException.java: Ditto.
* java/io/CharConversionException.java: Ditto.
* java/io/EOFException.java: Ditto.
* java/io/FileNotFoundException.java: Ditto.
* java/io/InterruptedIOException.java: Ditto.
* java/io/InvalidClassException.java: Ditto.
* java/io/InvalidObjectException.java: Ditto.
* java/io/IOException.java: Ditto.
* java/io/NotActiveException.java: Ditto.
* java/io/NotSerializableException.java: Ditto.
* java/io/ObjectStreamException.java: Ditto.
* java/io/OptionalDataException.java: Ditto.
* java/io/StreamCorruptedException.java: Ditto.
* java/io/SyncFailedException.java: Ditto.
* java/io/UnsupportedEncodingException.java: Ditto.
* java/io/UTFDataFormatException.java: Ditto.
* java/io/WriteAbortedException.java: Ditto.
* java/lang/AbstractMethodError.java: Ditto.
* java/lang/ArithmeticException.java: Ditto.
* java/lang/ArrayIndexOutOfBoundsException.java: Ditto.
* java/lang/ArrayStoreException.java: Ditto.
* java/lang/AssertionError.java: Ditto.
* java/lang/ClassCastException.java: Ditto.
* java/lang/ClassCircularityError.java: Ditto.
* java/lang/ClassFormatError.java: Ditto.
* java/lang/ClassNotFoundException.java: Ditto.
* java/lang/CloneNotSupportedException.java: Ditto.
* java/lang/Exception.java: Ditto.
* java/lang/ExceptionInInitializerError.java: Ditto.
* java/lang/IllegalAccessError.java: Ditto.
* java/lang/IllegalAccessException.java: Ditto.
* java/lang/IllegalArgumentException.java: Ditto.
* java/lang/IllegalMonitorStateException.java: Ditto.
* java/lang/IllegalStateException.java: Ditto.
* java/lang/IllegalThreadStateException.java: Ditto.
* java/lang/IncompatibleClassChangeError.java: Ditto.
* java/lang/IndexOutOfBoundsException.java: Ditto.
* java/lang/InstantiationError.java: Ditto.
* java/lang/InstantiationException.java: Ditto.
* java/lang/InternalError.java: Ditto.
* java/lang/InterruptedException.java: Ditto.
* java/lang/LinkageError.java: Ditto.
* java/lang/NegativeArraySizeException.java: Ditto.
* java/lang/NoClassDefFoundError.java: Ditto.
* java/lang/NoSuchFieldError.java: Ditto.
* java/lang/NoSuchFieldException.java: Ditto.
* java/lang/NoSuchMethodError.java: Ditto.
* java/lang/NoSuchMethodException.java: Ditto.
* java/lang/NullPointerException.java: Ditto.
* java/lang/NumberFormatException.java: Ditto.
* java/lang/OutOfMemoryError.java: Ditto.
* java/lang/RuntimeException.java: Ditto.
* java/lang/SecurityException.java: Ditto.
* java/lang/StackOverflowError.java: Ditto.
* java/lang/StringIndexOutOfBoundsException.java: Ditto.
* java/lang/ThreadDeath.java: Ditto.
* java/lang/UnknownError.java: Ditto.
* java/lang/UnsatisfiedLinkError.java: Ditto.
* java/lang/UnsupportedClassVersionError.java: Ditto.
* java/lang/UnsupportedOperationException.java: Ditto.
* java/lang/VerifyError.java: Ditto.
* java/lang/VirtualMachineError.java: Ditto.
* java/lang/Void.java: Ditto.
* java/lang/reflect/InvocationTargetException.java: Ditto.
* java/lang/reflect/UndeclaredThrowableException.java: Ditto.
* java/net/BindException.java: Ditto.
* java/net/ConnectException.java: Ditto.
* java/net/MalformedURLException.java: Ditto.
* java/net/NoRouteToHostException.java: Ditto.
* java/net/ProtocolException.java: Ditto.
* java/net/SocketException.java: Ditto.
* java/net/UnknownHostException.java: Ditto.
* java/net/UnknownServiceException.java: Ditto.
* java/rmi/AccessException.java: Ditto.
* java/rmi/AlreadyBoundException.java: Ditto.
* java/rmi/ConnectException.java: Ditto.
* java/rmi/ConnectIOException.java: Ditto.
* java/rmi/MarshalException.java: Ditto.
* java/rmi/NoSuchObjectException.java: Ditto.
* java/rmi/NotBoundException.java: Ditto.
* java/rmi/RemoteException.java: Ditto.
* java/rmi/RMISecurityException.java: Ditto.
* java/rmi/ServerException.java: Ditto.
* java/rmi/ServerRuntimeException.java: Ditto.
* java/rmi/StubNotFoundException.java: Ditto.
* java/rmi/UnexpectedException.java: Ditto.
* java/rmi/UnknownHostException.java: Ditto.
* java/rmi/UnmarshalException.java: Ditto.
* java/rmi/activation/ActivateFailedException.java: Ditto.
* java/rmi/activation/ActivationException.java: Ditto.
* java/rmi/activation/UnknownGroupException.java: Ditto.
* java/rmi/activation/UnknownObjectException.java: Ditto.
* java/rmi/server/ExportException.java: Ditto.
* java/rmi/server/ServerCloneException.java: Ditto.
* java/rmi/server/ServerNotActiveException.java: Ditto.
* java/rmi/server/SkeletonMismatchException.java: Ditto.
* java/rmi/server/SkeletonNotFoundException.java: Ditto.
* java/rmi/server/SocketSecurityException.java: Ditto.
* java/security/AccessControlException.java: Ditto.
* java/security/DigestException.java: Ditto.
* java/security/GeneralSecurityException.java: Ditto.
* java/security/InvalidAlgorithmParameterException.java: Ditto.
* java/security/InvalidKeyException.java: Ditto.
* java/security/InvalidParameterException.java: Ditto.
* java/security/KeyException.java: Ditto.
* java/security/KeyManagementException.java: Ditto.
* java/security/KeyStoreException.java: Ditto.
* java/security/NoSuchAlgorithmException.java: Ditto.
* java/security/NoSuchProviderException.java: Ditto.
* java/security/PrivilegedActionException.java: Ditto.
* java/security/ProviderException.java: Ditto.
* java/security/SignatureException.java: Ditto.
* java/security/UnrecoverableKeyException.java: Ditto.
* java/security/acl/AclNotFoundException.java: Ditto.
* java/security/acl/LastOwnerException.java: Ditto.
* java/security/acl/NotOwnerException.java: Ditto.
* java/security/cert/CertificateEncodingException.java: Ditto.
* java/security/cert/CertificateException.java: Ditto.
* java/security/cert/CertificateExpiredException.java: Ditto.
* java/security/cert/CertificateNotYetValidException.java: Ditto.
* java/security/cert/CertificateParsingException.java: Ditto.
* java/security/cert/CRLException.java: Ditto.
* java/security/spec/InvalidKeySpecException.java: Ditto.
* java/security/spec/InvalidParameterSpecException.java: Ditto.
* java/sql/BatchUpdateException.java: Ditto.
* java/sql/DataTruncation.java: Ditto.
* java/sql/SQLException.java: Ditto.
* java/sql/SQLWarning.java: Ditto.
* java/text/ParseException.java: Ditto.
* java/util/MissingResourceException.java: Ditto.
* java/util/jar/JarException.java: Ditto.
* java/util/prefs/BackingStoreException.java: Ditto.
* java/util/prefs/InvalidPreferencesFormatException.java: Ditto.
* java/util/zip/DataFormatException.java: Ditto.
* java/util/zip/ZipException.java: Ditto.
* java/awt/Makefile.am (EXTRA_DIST): Add FontFormatException.java
and HeadlessException.java.
* java/awt/FontFormatException.java: New file.
* java/awt/HeadlessException.java: New file.
* java/awt/color/Makefile.am (EXTRA_DIST): Add CMMException.java
and ProfileDataException.java.
* java/awt/color/CMMException.java: New file.
* java/awt/color/ProfileDataException.java: New file.
* java/awt/image/Makefile.am (EXTRA_DIST): Add
ImagingOpException.java and RasterFormatException.java.
* java/awt/image/ImagingOpException.java: New file.
* java/awt/image/RasterFormatException.java: New file.
* java/net/Makefile.am (EXTRA_DIST): Add
PortUnreachableException.java, SocketTimeoutException.java and
URISyntaxException.java.
* java/net/PortUnreachableException.java: New file.
* java/net/SocketTimeoutException.java: New file.
* java/net/URISyntaxException.java: New file.
* java/security/cert/Makefile.am (EXTRA_DIST): Add
CertPathBuilderException.java, CertPathValidatorException.java,
and CertStoreException.java.
* java/security/cert/CertPathBuilderException.java: New file.
* java/security/cert/CertPathValidatorException.java: New file.
* java/security/cert/CertStoreException.java: New file.
* vm/reference/java/lang/Throwable.java (toString): Use
getLocalizedMessage().
* ChangeLog: Fix spelling error.
Diffstat (limited to 'java')
164 files changed, 5599 insertions, 4098 deletions
diff --git a/java/awt/AWTError.java b/java/awt/AWTError.java index 6d3ad61d2..1c253cb41 100644 --- a/java/awt/AWTError.java +++ b/java/awt/AWTError.java @@ -1,5 +1,5 @@ /* AWTError.java -- A serious AWT error occurred. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,24 +39,26 @@ exception statement from your version. */ package java.awt; /** - * This error is thrown when a critical AWT error occurs. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This error is thrown when a critical Abstract Window Toolkit (AWT) error + * occurs. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 + */ public class AWTError extends Error { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -1819846354050686206L; -/** - * Initializes a new instance of <code>AWTError</code> with the specified - * descriptive error message. - * - * @param message The descriptive error message. - */ -public -AWTError(String message) -{ - super(message); -} - -} // class AWTError - + /** + * Create a new instance with the specified descriptive error message. + * + * @param message the descriptive error message + */ + public AWTError(String message) + { + super(message); + } +} // class AWTError diff --git a/java/awt/AWTException.java b/java/awt/AWTException.java index 039269148..e4ab6c996 100644 --- a/java/awt/AWTException.java +++ b/java/awt/AWTException.java @@ -1,5 +1,5 @@ /* AWTException.java -- Generic AWT exception - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,25 +39,26 @@ exception statement from your version. */ package java.awt; /** - * This is a generic exception that indicates an error occurred in the - * AWT system. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This is a generic exception that indicates an exception occurred in the + * Abstract Window Toolkit (AWT) system. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 + */ public class AWTException extends Exception { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -1900414231151323879L; -/** - * Initializes a new instance of <code>AWTException</code> with the - * specified detailed error message. - * - * @param message The detailed error message. - */ -public -AWTException(String message) -{ - super(message); -} - -} // class AWTException - + /** + * Create a new instance with the specified detailed error message. + * + * @param message the detailed error message + */ + public AWTException(String message) + { + super(message); + } +} // class AWTException diff --git a/java/awt/FontFormatException.java b/java/awt/FontFormatException.java new file mode 100644 index 000000000..4ab53bbe8 --- /dev/null +++ b/java/awt/FontFormatException.java @@ -0,0 +1,65 @@ +/* FontFormatException.java -- the specified font is bad + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.awt; + +/** + * Thrown when a specified font is bad. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @see Font + * @since 1.3 + * @status updated to 1.4 + */ +public class FontFormatException extends Exception +{ + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = -4481290147811361272L; + + /** + * Create a new instance with the specified detailed error message. + * + * @param message the detailed error message + */ + public FontFormatException(String message) + { + super(message); + } +} // class FontFormatException diff --git a/java/awt/HeadlessException.java b/java/awt/HeadlessException.java new file mode 100644 index 000000000..4e7ef337f --- /dev/null +++ b/java/awt/HeadlessException.java @@ -0,0 +1,72 @@ +/* HeadlessException.java -- operation not possible in headless environment + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.awt; + +/** + * This exception is thrown when code dependent on a keyboard, mouse, or + * display is executed in a headless environment. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @since 1.4 + * @status updated to 1.4 + */ +public class HeadlessException extends UnsupportedOperationException +{ + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 167183644944358563L; + + /** + * Create a new instance with no detailed error message. + */ + public HeadlessException() + { + } + + /** + * Create a new instance with the specified detailed error message. + * + * @param message the detailed error message + */ + public HeadlessException(String message) + { + super(message); + } +} // class HeadlessException diff --git a/java/awt/IllegalComponentStateException.java b/java/awt/IllegalComponentStateException.java index d10d107ac..413ed33a4 100644 --- a/java/awt/IllegalComponentStateException.java +++ b/java/awt/IllegalComponentStateException.java @@ -1,5 +1,5 @@ -/* IllegalComponentStateException.java -- Bad component state - Copyright (C) 1999 Free Software Foundation, Inc. +/* IllegalComponentStateException.java -- bad component state + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,37 +39,33 @@ exception statement from your version. */ package java.awt; /** - * This exception is thrown when the requested operation failed because - * a component was not in the proper state. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This exception is thrown when the requested operation failed because + * a component was not in the proper state. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 + */ public class IllegalComponentStateException extends IllegalStateException { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -1889339587208144238L; -/** - * Initializes a new instance of <code>IllegalComponentStateException</code> - * with the specified detailed error message. - * - * @param message The detailed error message. - */ -public -IllegalComponentStateException(String message) -{ - super(message); -} - -/*************************************************************************/ - -/** - * Initializes a new instance of <code>IllegalComponentStateException</code> - * with no detailed error message. - */ -public -IllegalComponentStateException() -{ - super(); -} + /** + * Create a new instance with no detailed error message. + */ + public IllegalComponentStateException() + { + } + /** + * Create a new instance with the specified detailed error message. + * + * @param message the detailed error message + */ + public IllegalComponentStateException(String message) + { + super(message); + } } // class IllegalComponentStateException - diff --git a/java/awt/Makefile.am b/java/awt/Makefile.am index bfb453f87..b43ef6501 100644 --- a/java/awt/Makefile.am +++ b/java/awt/Makefile.am @@ -31,6 +31,7 @@ EventQueue.java \ FileDialog.java \ FlowLayout.java \ Font.java \ +FontFormatException.java \ FontMetrics.java \ Frame.java \ Graphics2D.java \ @@ -38,6 +39,7 @@ GraphicsConfiguration.java \ Graphics.java \ GridBagConstraints.java \ GridLayout.java \ +HeadlessException.java \ IllegalComponentStateException.java \ Image.java \ ImageMediaEntry.java \ diff --git a/java/awt/color/CMMException.java b/java/awt/color/CMMException.java new file mode 100644 index 000000000..0d146e6c6 --- /dev/null +++ b/java/awt/color/CMMException.java @@ -0,0 +1,63 @@ +/* CMMException.java -- error in the native CMM + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.awt.color; + +/** + * Thrown when there is an error in the native CMM. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @status updated to 1.4 + */ +public class CMMException extends Exception +{ + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 5775558044142994965L; + + /** + * Create a new instance with a specified detailed error message. + * + * @param message the message + */ + public CMMException(String message) + { + super(message); + } +} // class CMMException diff --git a/java/awt/color/Makefile.am b/java/awt/color/Makefile.am index 8bc35a4c5..deed11c9e 100644 --- a/java/awt/color/Makefile.am +++ b/java/awt/color/Makefile.am @@ -1,6 +1,8 @@ ## Input file for automake EXTRA_DIST = \ +CMMException.java \ ColorSpace.java \ ICC_ColorSpace.java \ -ICC_Profile.java +ICC_Profile.java \ +ProfileDataException.java diff --git a/java/awt/color/ProfileDataException.java b/java/awt/color/ProfileDataException.java new file mode 100644 index 000000000..130781faf --- /dev/null +++ b/java/awt/color/ProfileDataException.java @@ -0,0 +1,64 @@ +/* ProfileDataException.java -- error in processing an ICC_Profile + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.awt.color; + +/** + * Thrown when there is an error accessing or processing an + * <code>ICC_Profile</code>. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @status updated to 1.4 + */ +public class ProfileDataException extends Exception +{ + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 7286140888240322498L; + + /** + * Create a new instance with a specified detailed error message. + * + * @param message the message + */ + public ProfileDataException(String message) + { + super(message); + } +} // class ProfileDataException diff --git a/java/awt/datatransfer/MimeTypeParseException.java b/java/awt/datatransfer/MimeTypeParseException.java index 32bc8850b..42aecac05 100644 --- a/java/awt/datatransfer/MimeTypeParseException.java +++ b/java/awt/datatransfer/MimeTypeParseException.java @@ -1,5 +1,5 @@ -/* MimeTypeParseException.java -- Thrown when MIME string couldn't be parsed. - Copyright (C) 2001 Free Software Foundation, Inc. +/* MimeTypeParseException.java -- thrown when MIME string couldn't be parsed + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,30 +41,30 @@ package java.awt.datatransfer; /** * MIME string couldn't be parsed correctly. * - * @author Mark Wielaard (mark@klomp.org) + * @author Mark Wielaard <mark@klomp.org> + * @status updated to 1.4 */ -public class MimeTypeParseException extends Exception +public class MimeTypeParseException extends Exception { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -5604407764691570741L; -/** - * Initializes a new instance of <code>MimeTypeParseException</code> - * without any message. - */ -public -MimeTypeParseException() -{ - super(); -} - -/** - * Initializes a new instance of <code>MimeTypeParseException</code> - * with a specified detailed error message. - */ -public -MimeTypeParseException(String message) -{ - super(message); -} + /** + * Create a new instance without any message. + */ + public MimeTypeParseException() + { + } + /** + * Create a new instance with a specified detailed error message. + * + * @param message the message + */ + public MimeTypeParseException(String message) + { + super(message); + } } // class MimeTypeParseException - diff --git a/java/awt/datatransfer/UnsupportedFlavorException.java b/java/awt/datatransfer/UnsupportedFlavorException.java index a31059ef2..620452be6 100644 --- a/java/awt/datatransfer/UnsupportedFlavorException.java +++ b/java/awt/datatransfer/UnsupportedFlavorException.java @@ -1,5 +1,5 @@ -/* UnsupportedFlavorException.java -- Data flavor is not valid. - Copyright (C) 1999 Free Software Foundation, Inc. +/* UnsupportedFlavorException.java -- ata flavor is not valid + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,24 +39,27 @@ exception statement from your version. */ package java.awt.datatransfer; /** - * The data flavor requested is not supported for the transfer data. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class UnsupportedFlavorException extends Exception + * The data flavor requested is not supported for the transfer data. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @see Transferable#getTransferData(DataFlavor) + * @status updated to 1.4 + */ +public class UnsupportedFlavorException extends Exception { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 5383814944251665601L; -/** - * Initializes a new instance of <code>UnsupportedDataFlavor</code> - * for the specified data flavor. - * - * @param flavor The data flavor that is not supported. - */ -public -UnsupportedFlavorException(DataFlavor flavor) -{ - super(flavor.getHumanPresentableName()); -} - + /** + * Initializes a new instance of <code>UnsupportedDataFlavor</code> + * for the specified data flavor. + * + * @param flavor the data flavor that is not supported + */ + public UnsupportedFlavorException(DataFlavor flavor) + { + super(flavor == null ? null : flavor.getHumanPresentableName()); + } } // class UnsupportedFlavorException - diff --git a/java/awt/geom/IllegalPathStateException.java b/java/awt/geom/IllegalPathStateException.java index 3e36b0817..f0e388aac 100644 --- a/java/awt/geom/IllegalPathStateException.java +++ b/java/awt/geom/IllegalPathStateException.java @@ -1,4 +1,5 @@ -/* Copyright (C) 2000, 2002 Free Software Foundation +/* IllegalPathStateException.java -- an operation was in an illegal path state + Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. @@ -37,19 +38,34 @@ exception statement from your version. */ package java.awt.geom; /** + * Thrown when an operation on a path is in an illegal state, such as appending + * a segment to a <code>GeneralPath</code> without an initial moveto. + * * @author Tom Tromey <tromey@cygnus.com> - * @date July 17, 2000 + * @see GeneralPath + * @status updated to 1.4 */ - public class IllegalPathStateException extends RuntimeException { - public IllegalPathStateException () + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -5158084205220481094L; + + /** + * Create an exception with no message. + */ + public IllegalPathStateException() { - super (); } - public IllegalPathStateException (String msg) + /** + * Create an exception with a message. + * + * @param msg the message + */ + public IllegalPathStateException(String msg) { - super (msg); + super(msg); } } diff --git a/java/awt/geom/NoninvertibleTransformException.java b/java/awt/geom/NoninvertibleTransformException.java index cd561cfff..40b2c1802 100644 --- a/java/awt/geom/NoninvertibleTransformException.java +++ b/java/awt/geom/NoninvertibleTransformException.java @@ -1,4 +1,5 @@ -/* Copyright (C) 2000, 2002 Free Software Foundation +/* NoninvertibleTransformException.java -- a transform can't be inverted + Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. @@ -37,14 +38,28 @@ exception statement from your version. */ package java.awt.geom; /** + * Thrown if an operation requires an inverse of an + * <code>AffineTransform</code>, but the transform is in a non-invertible + * state. + * * @author Tom Tromey <tromey@cygnus.com> - * @date July 15, 2000 + * @see AffineTransform + * @status updated to 1.4 */ - public class NoninvertibleTransformException extends Exception { - public NoninvertibleTransformException (String s) + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 6137225240503990466L; + + /** + * Create an exception with a message. + * + * @param s the message + */ + public NoninvertibleTransformException(String s) { - super (s); + super(s); } } diff --git a/java/awt/image/ImagingOpException.java b/java/awt/image/ImagingOpException.java new file mode 100644 index 000000000..28c3df132 --- /dev/null +++ b/java/awt/image/ImagingOpException.java @@ -0,0 +1,66 @@ +/* ImagingOpException.java -- indicates an imaging filter failure + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.awt.image; + +/** + * This exception is thrown when <code>BufferedImageOp</code> or + * <code>RasterOp</code> filters cannot process an image. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @see BufferedImageOp + * @see RasterOp + * @status updated to 1.4 + */ +public class ImagingOpException extends RuntimeException +{ + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 96598996116164315L; + + /** + * Create a new instance with a descriptive error message. + * + * @param message the descriptive error message + */ + public ImagingOpException(String message) + { + super(message); + } +} // class ImagingOpException diff --git a/java/awt/image/Makefile.am b/java/awt/image/Makefile.am index 1c5169716..efdc980e7 100644 --- a/java/awt/image/Makefile.am +++ b/java/awt/image/Makefile.am @@ -15,12 +15,14 @@ ImageConsumer.java \ ImageFilter.java \ ImageObserver.java \ ImageProducer.java \ +ImagingOpException.java \ IndexColorModel.java \ MemoryImageSource.java \ PackedColorModel.java \ PixelGrabber.java \ RGBImageFilter.java \ Raster.java \ +RasterFormatException.java \ RasterOp.java \ ReplicateScaleFilter.java \ SampleModel.java \ diff --git a/java/awt/image/RasterFormatException.java b/java/awt/image/RasterFormatException.java new file mode 100644 index 000000000..3a2987747 --- /dev/null +++ b/java/awt/image/RasterFormatException.java @@ -0,0 +1,65 @@ +/* RasterFormatException.java -- indicates invalid layout in Raster + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.awt.image; + +/** + * This exception is thrown when there is invalid layout information in + * <code>Raster</code> + * + * @author Eric Blake <ebb9@email.byu.edu> + * @see Raster + * @status updated to 1.4 + */ +public class RasterFormatException extends RuntimeException +{ + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 96598996116164315L; + + /** + * Create a new instance with a descriptive error message. + * + * @param message the descriptive error message + */ + public RasterFormatException(String message) + { + super(message); + } +} // class RasterFormatException diff --git a/java/awt/print/PrinterAbortException.java b/java/awt/print/PrinterAbortException.java index 15d3f1b39..133fdfe11 100644 --- a/java/awt/print/PrinterAbortException.java +++ b/java/awt/print/PrinterAbortException.java @@ -1,5 +1,5 @@ /* PrinterAbortException.java -- Indicates the print job was aborted - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,41 +38,34 @@ exception statement from your version. */ package java.awt.print; -import java.io.Serializable; - -/** - * This exception is thrown when the print job is aborted, either by the - * user or by the application. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class PrinterAbortException extends PrinterException - implements Serializable -{ - /** - * Initializes a new instance of <code>PrinterAbortException</code> with no - * detailed error message. - */ -public -PrinterAbortException() + * This exception is thrown when the print job is aborted, either by the + * user or by the application. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 + */ +public class PrinterAbortException extends PrinterException { - super(); -} + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 4725169026278854136L; -/*************************************************************************/ - -/** - * Initializes a new instance of <code>PrinterAbortException</code> with a - * descriptive error message. - * - * @param message The descriptive error message. - */ -public -PrinterAbortException(String message) -{ - super(message); -} + /** + * Create a new instance with no detailed error message. + */ + public PrinterAbortException() + { + } + /** + * Create a new instance with a descriptive error message. + * + * @param message the descriptive error message + */ + public PrinterAbortException(String message) + { + super(message); + } } // class PrinterAbortException - diff --git a/java/awt/print/PrinterException.java b/java/awt/print/PrinterException.java index edaad9905..9476d9356 100644 --- a/java/awt/print/PrinterException.java +++ b/java/awt/print/PrinterException.java @@ -1,5 +1,5 @@ -/* PrinterException.java -- Generic problem in the printing subsystem. - Copyright (C) 1999 Free Software Foundation, Inc. +/* PrinterException.java -- generic problem in the printing subsystem + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,44 +38,34 @@ exception statement from your version. */ package java.awt.print; -import java.io.Serializable; - /** - * This is the generic toplevel exception for printing errors. Subclasses - * provide more detailed descriptions of the problem. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class PrinterException extends Exception implements Serializable -{ - -/* - * Constructors + * This is the generic toplevel exception for printing errors. Subclasses + * provide more detailed descriptions of the problem. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 */ - -/** - * Initializes a new instance of <code>PrinterException</code> with no - * detailed error message. - */ -public -PrinterException() +public class PrinterException extends Exception { - super(); -} - -/*************************************************************************/ - -/** - * Initializes a new instance of <code>PrinterException</code> with a - * descriptive error message. - * - * @param message The descriptive error message. - */ -public -PrinterException(String message) -{ - super(message); -} - + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -3757589981158265819L; + + /** + * Create a new instance with no detailed error message. + */ + public PrinterException() + { + } + + /** + * Create a new instance with a descriptive error message. + * + * @param message the descriptive error message + */ + public PrinterException(String message) + { + super(message); + } } // class PrinterException - diff --git a/java/awt/print/PrinterIOException.java b/java/awt/print/PrinterIOException.java index a5f569a44..31f6381dc 100644 --- a/java/awt/print/PrinterIOException.java +++ b/java/awt/print/PrinterIOException.java @@ -1,5 +1,5 @@ /* PrinterIOException.java -- The print job encountered an I/O error - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,80 +38,61 @@ exception statement from your version. */ package java.awt.print; -import java.io.Serializable; import java.io.IOException; /** - * This exception is thrown when the print job encounters an I/O problem - * of some kind. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class PrinterIOException extends PrinterException - implements Serializable -{ - -/* - * Instance Variables - */ - -/** - * @serial The <code>IOException</code> that lead to this - * exception being thrown. - */ -private IOException mException; - -/*************************************************************************/ - -/* - * Constructors + * This exception is thrown when the print job encounters an I/O problem + * of some kind. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @author Eric Blake <ebb9@email.byu.edu> + * @status updated to 1.4 */ - -/** - * Initializes a new instance of <code>PrinterIOException</code> with the - * text description of the specified <code>IOException</code>. - * - * @param mException The <code>IOException</code> that caused this - * exception to be thrown. - */ -public -PrinterIOException(IOException mException) +public class PrinterIOException extends PrinterException { - this(mException.toString()); - this.mException = mException; -} - -/*************************************************************************/ - -/** - * Initializes a new instance of <code>PrinterIOException</code> with a - * descriptive error message. Note that this constructor is private. - * - * @param message The descriptive error message. + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 5850870712125932846L; + + /** + * The exception that caused this (duplicates Throwable). + * + * @serial the I/O exception that terminated the job */ -private -PrinterIOException(String message) -{ - super(message); -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method returns the underlying <code>IOException</code> that - * caused this exception. - * - * @return The <code>IOException</code> that caused this exception. + private final IOException mException; + + /** + * Initializes a new instance with the given cause. + * + * @param mException the cause + */ + public PrinterIOException(IOException mException) + { + super(mException == null ? null : mException.toString()); + initCause(mException); + this.mException = mException; + } + + /** + * Gets the underlying <code>IOException</code> that caused this exception. + * This legacy method has been replaced by {@link #getCause()}. + * + * @return the cause */ -public IOException -getIOException() -{ - return(mException); -} - + public IOException getIOException() + { + return mException; + } + + /** + * Gets the cause. + * + * @return the cause + */ + public Throwable getCause() + { + return mException; + } } // class PrinterIOException diff --git a/java/beans/IntrospectionException.java b/java/beans/IntrospectionException.java index 6b9aab690..9883c9ab4 100644 --- a/java/beans/IntrospectionException.java +++ b/java/beans/IntrospectionException.java @@ -1,5 +1,5 @@ -/* java.beans.IntrospectionException - Copyright (C) 1998 Free Software Foundation, Inc. +/* IntrospectionException -- thrown when an exception occurs in introspection + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,19 +39,29 @@ exception statement from your version. */ package java.beans; /** - ** IntrospectionException is thrown when the Introspector fails. Surprise, surprise. - ** - ** @author John Keiser - ** @since JDK1.1 - ** @version 1.1.0, 31 May 1998 - ** @see java.beans.Introspector - **/ - -public class IntrospectionException extends Exception { - /** Instantiate this exception with the given message. - ** @param msg the message for the exception. - **/ - public IntrospectionException(String msg) { - super(msg); - } + * IntrospectionException is thrown when the Introspector fails. Typical + * causes are the inability to map a name to its Class, or specifying a + * wrong type signature. + * + * @author John Keiser + * @see Introspector + * @since 1.1 + * @status updated to 1.4 + */ +public class IntrospectionException extends Exception +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -3728150539969542619L; + + /** + * Instantiate this exception with the given message. + * + * @param msg the message for the exception + */ + public IntrospectionException(String msg) + { + super(msg); + } } diff --git a/java/beans/PropertyVetoException.java b/java/beans/PropertyVetoException.java index 9c82c3636..31f01d8b1 100644 --- a/java/beans/PropertyVetoException.java +++ b/java/beans/PropertyVetoException.java @@ -1,5 +1,5 @@ -/* java.beans.PropertyVetoException - Copyright (C) 1998, 2000 Free Software Foundation, Inc. +/* PropertyVetoException.java -- thrown to veto a proposed property change + Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,30 +39,47 @@ exception statement from your version. */ package java.beans; /** - ** PropertyVetoException is thrown when a VetoableChangeListener doesn't like the proposed change. - ** - ** @author John Keiser - ** @since JDK1.1 - ** @version 1.1.0, 31 May 1998 - ** @see java.beans.VetoableChangeListener - **/ - -public class PropertyVetoException extends Exception { - PropertyChangeEvent evt; + * PropertyVetoException is thrown when a VetoableChangeListener doesn't + * like the proposed change. + * + * @author John Keiser + * @see VetoableChangeListener + * @since 1.1 + * @status updated to 1.4 + */ +public class PropertyVetoException extends Exception +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 129596057694162164L; - private static final long serialVersionUID = 129596057694162164L; + /** + * The vetoed change. + * + * @serial the event that was vetoed + */ + private final PropertyChangeEvent evt; - /** Instantiate this exception with the given message and property change. - ** @param msg the reason for the veto. - ** @param changeEvent the PropertyChangeEvent that was thrown. - **/ - public PropertyVetoException(String msg, PropertyChangeEvent changeEvent) { - super(msg); - evt = changeEvent; - } + /** + * Instantiate this exception with the given message and property change. + * + * @param msg the reason for the veto + * @param changeEvent the PropertyChangeEvent that was thrown + */ + public PropertyVetoException(String msg, PropertyChangeEvent changeEvent) + { + super(msg); + evt = changeEvent; + } - /** Get the PropertyChange event that was vetoed. **/ - public PropertyChangeEvent getPropertyChangeEvent() { - return evt; - } + /** + * Get the PropertyChange event that was vetoed. + * + * @return the vetoed change + */ + public PropertyChangeEvent getPropertyChangeEvent() + { + return evt; + } } diff --git a/java/io/CharConversionException.java b/java/io/CharConversionException.java index 4aa0626ca..0cb83d2d0 100644 --- a/java/io/CharConversionException.java +++ b/java/io/CharConversionException.java @@ -1,5 +1,5 @@ /* CharConversionException.java -- Character conversion exceptions - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,49 +38,36 @@ exception statement from your version. */ package java.io; -/* 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 occurred with - * an attempted character conversion. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - * @author Tom Tromey <tromey@cygnus.com> - * @date September 25, 1998 - */ -public class CharConversionException extends IOException -{ - -/* - * Constructors + * This exception is thrown to indicate that a problem occurred with + * an attempted character conversion. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey <tromey@cygnus.com> + * @since 1.1 + * @status updated to 1.4 */ - -/** - * Create a new CharConversionException without a descriptive error message - */ -public -CharConversionException() +public class CharConversionException extends IOException { - super(); -} - -/*************************************************************************/ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -8680016352018427031L; -/** - * Create a new CharConversionException with a descriptive error message String - * - * @param message The descriptive error message - */ -public -CharConversionException(String message) -{ - super(message); -} + /** + * Create an exception without a descriptive error message. + */ + public CharConversionException() + { + } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public CharConversionException(String message) + { + super(message); + } } // class CharConversionException - diff --git a/java/io/EOFException.java b/java/io/EOFException.java index 444df7f0c..d129cd692 100644 --- a/java/io/EOFException.java +++ b/java/io/EOFException.java @@ -1,5 +1,5 @@ -/* EOFException.java -- Unexpected end of file exception - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* EOFException.java -- unexpected end of file exception + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,53 +38,39 @@ exception statement from your version. */ package java.io; -/* 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 <tromey@cygnus.com> - * @date September 24, 1998 - */ -public class EOFException extends IOException -{ - -/* - * Constructors + * This exception is thrown when the end of the file or stream was + * encountered unexpectedly. This is not the normal way that an EOF + * condition is reported; such as a special value like -1 being 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. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey <tromey@cygnus.com> + * @status updated to 1.4 */ - -/** - * Create a new EOFException without a descriptive error message - */ -public -EOFException() +public class EOFException extends IOException { - super(); -} - -/*************************************************************************/ + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 6433858223774886977L; -/** - * Create a new EOFException with a descriptive error message String - * - * @param message The descriptive error message - */ -public -EOFException(String message) -{ - super(message); -} + /** + * Create an exception without a descriptive error message. + */ + public EOFException() + { + } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public EOFException(String message) + { + super(message); + } } // class EOFException - diff --git a/java/io/FileNotFoundException.java b/java/io/FileNotFoundException.java index 9d04d6a26..7877aba15 100644 --- a/java/io/FileNotFoundException.java +++ b/java/io/FileNotFoundException.java @@ -1,5 +1,5 @@ -/* FileNotFoundException.java -- The requested file could not be found - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* FileNotFoundException.java -- the requested file could not be found + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,49 +38,36 @@ exception statement from your version. */ package java.io; -/* 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 <tromey@cygnus.com> - * @date September 24, 1998 - */ -public class FileNotFoundException extends IOException -{ - -/* - * Constructors + * This exception is thrown when an attempt is made to access a file that + * does not exist, or is inaccessible for some other reason (such as writing + * a read-only file). + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @author Tom Tromey <tromey@cygnus.com> + * @status updated to 1.4 */ - -/** - * Create a new FileNotFoundException without a descriptive error message - */ -public -FileNotFoundException() +public class FileNotFoundException extends IOException { - super(); -} - -/*************************************************************************/ + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -897856973823710492L; -/** - * Create a new FileNotFoundException with a descriptive error message String - * - * @param message The descriptive error message - */ -public -FileNotFoundException(String message) -{ - super(message); -} + /** + * Create an exception without a descriptive error message. + */ + public FileNotFoundException() + { + } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public FileNotFoundException(String message) + { + super(message); + } } // class FileNotFoundException - diff --git a/java/io/IOException.java b/java/io/IOException.java index 1c7f25495..8baf593c9 100644 --- a/java/io/IOException.java +++ b/java/io/IOException.java @@ -1,5 +1,5 @@ /* IOException.java -- Generic input/output exception - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,51 +38,37 @@ exception statement from your version. */ package java.io; -/* 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 <tromey@cygnus.com> - * @date September 24, 1998 + * @status updated to 1.4 */ public class IOException extends Exception { + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 7818375828146090155L; -/* - * 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); -} + /** + * Create an exception without a descriptive error message. + */ + public IOException() + { + } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public IOException(String message) + { + super(message); + } } // class IOException - diff --git a/java/io/InterruptedIOException.java b/java/io/InterruptedIOException.java index 52ed65332..321c2697b 100644 --- a/java/io/InterruptedIOException.java +++ b/java/io/InterruptedIOException.java @@ -1,5 +1,5 @@ -/* InterruptedIOException.java -- An I/O operation was interrupted. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* InterruptedIOException.java -- an I/O operation was interrupted + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,78 +38,57 @@ exception statement from your version. */ package java.io; -/* 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. + * 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 Aaron M. Renn <arenn@urbanophile.com> * @author Tom Tromey <tromey@cygnus.com> - * @date September 24, 1998 + * @see Thread#interrupt() + * @status updated to 1.4 */ public class InterruptedIOException extends IOException { - -private static final long serialVersionUID = 4020568460727500567L; - -/* - * 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; -} - + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 4020568460727500567L; + + /** + * The number of bytes read/written prior to the interruption. + * + * @serial count of bytes successfully transferred + */ + public int bytesTransferred; + + /** + * Create an extends without a descriptive error message. + */ + public InterruptedIOException() + { + } + + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public InterruptedIOException(String message) + { + super(message); + } + + /** + * Create an exception with a descriptive error message and count of + * bytes transferred. + * + * @param message the descriptive error message + * @param bytesTransferred number of bytes tranferred before interruption + */ + InterruptedIOException(String message, int bytesTransferred) + { + super(message); + this.bytesTransferred = bytesTransferred; + } } // class InterruptedIOException - diff --git a/java/io/InvalidClassException.java b/java/io/InvalidClassException.java index 57ae399a9..a98a22b91 100644 --- a/java/io/InvalidClassException.java +++ b/java/io/InvalidClassException.java @@ -1,5 +1,5 @@ -/* InvalidClassException.java -- An I/O operation was interrupted. - Copyright (C) 1998 Free Software Foundation, Inc. +/* InvalidClassException.java -- deserializing a class failed + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,44 +39,54 @@ exception statement from your version. */ package java.io; /** - * This exception is thrown when there is some sort of problem with a - * class during a serialization operation. This could be that the - * versions don't match, that there are unknown datatypes in the class - * or that the class doesn't have a default no-arg constructor. - * <p> - * The field <code>classname</code> will contain the name of the - * class that caused the problem if known. The getMessage() method - * for this exception will always include the name of that class - * if known. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ + * This exception is thrown when there is some sort of problem with a + * class during a serialization operation. This could be:<br><ul> + * <li>the serial version of the class doesn't match</li> + * <li>the class contains unknown datatypes</li> + * <li>the class does not have an accessible no-arg constructor</li> + * </ul>. + * + * <p>The field <code>classname</code> will contain the name of the + * class that caused the problem if known. The getMessage() method + * for this exception will always include the name of that class + * if known. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.1 + * @status updated to 1.4 + */ public class InvalidClassException extends ObjectStreamException { /** - * The name of the class which encountered the error. - */ + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -4333316296251054416L; + + /** + * The name of the class which encountered the error. + * + * @serial the classname causing the error + */ public String classname; /** - * Create a new InvalidClassException with a descriptive error message String - * - * @param message The descriptive error message - */ + * Create an exception with a descriptive error message, but a null + * classname. + * + * @param message the descriptive error message + */ public InvalidClassException(String message) { super(message); } /** - * Create a new InvalidClassException with a descriptive error message - * String, and the name of the class that caused the problem. - * - * @param classname The number of bytes tranferred before the interruption - * @param message The descriptive error message - */ + * Create an exception with a descriptive error message, and the name of + * the class that caused the problem. + * + * @param classname the name of the faulty class + * @param message the descriptive error message + */ public InvalidClassException(String classname, String message) { super(message); @@ -84,15 +94,18 @@ public class InvalidClassException extends ObjectStreamException } /** - * Returns the descriptive error message for this exception. It will - * include the class name that caused the problem if known. This method - * overrides Throwable.getMessage() - * - * @return A descriptive error message - */ + * Returns the descriptive error message for this exception. It will + * include the class name that caused the problem if known, in the format: + * <code>[classname][; ][super.getMessage()]</code>. + * + * @return A descriptive error message, may be null + */ public String getMessage() { - return super.getMessage() + (classname == null ? "" : ": " + classname); + String msg = super.getMessage(); + if (msg == null) + return classname; + return (classname == null ? "" : classname + "; ") + msg; } } diff --git a/java/io/InvalidObjectException.java b/java/io/InvalidObjectException.java index 4a848780d..c7846a539 100644 --- a/java/io/InvalidObjectException.java +++ b/java/io/InvalidObjectException.java @@ -1,5 +1,5 @@ -/* InvalidObjectException.java -- An I/O operation was interrupted. - Copyright (C) 1998 Free Software Foundation, Inc. +/* InvalidObjectException.java -- deserialization failed verification + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,30 +39,28 @@ exception statement from your version. */ package java.io; /** - * This exception is thrown when an object fails a validation test - * during serialization. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class InvalidObjectException extends ObjectStreamException -{ - -/* - * Constructors + * This exception is thrown when an object fails a validation test + * during serialization. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.1 + * @status updated to 1.4 */ - -/** - * Create a new InvalidObjectException with a descriptive error message String - * - * @param message The descriptive error message - */ -public -InvalidObjectException(String message) +public class InvalidObjectException extends ObjectStreamException { - super(message); -} + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 3233174318281839583L; + /** + * Create an exception with a descriptive error message String. This should + * be the cause of the verification failure. + * + * @param message the descriptive error message + */ + public InvalidObjectException(String message) + { + super(message); + } } // class InvalidObjectException - diff --git a/java/io/NotActiveException.java b/java/io/NotActiveException.java index 3f205f164..22c7e63d8 100644 --- a/java/io/NotActiveException.java +++ b/java/io/NotActiveException.java @@ -1,5 +1,5 @@ -/* NotActiveException.java -- Unexpected end of file exception - Copyright (C) 1998 Free Software Foundation, Inc. +/* NotActiveException.java -- thrown when serialization is not active + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,41 +39,34 @@ exception statement from your version. */ package java.io; /** - * This exception is thrown when a problem occurs due to the fact that - * serialization is not active. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class NotActiveException extends ObjectStreamException -{ - -/* - * Constructors + * This exception is thrown when a problem occurs due to the fact that + * serialization is not active. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.1 + * @status updated to 1.4 */ - -/** - * Create a new NotActiveException without a descriptive error message - */ -public -NotActiveException() +public class NotActiveException extends ObjectStreamException { - super(); -} + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -3893467273049808895L; -/*************************************************************************/ - -/** - * Create a new NotActiveException with a descriptive error message String - * - * @param message The descriptive error message - */ -public -NotActiveException(String message) -{ - super(message); -} + /** + * Create an exception without a descriptive error message. + */ + public NotActiveException() + { + } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public NotActiveException(String message) + { + super(message); + } } // class NotActiveException - diff --git a/java/io/NotSerializableException.java b/java/io/NotSerializableException.java index 55da2606c..fbafd3dd5 100644 --- a/java/io/NotSerializableException.java +++ b/java/io/NotSerializableException.java @@ -1,5 +1,5 @@ -/* NotSerializableException.java -- Unexpected end of file exception - Copyright (C) 1998 Free Software Foundation, Inc. +/* NotSerializableException.java -- a Serializable class that isn't + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,42 +39,36 @@ exception statement from your version. */ package java.io; /** - * This exception is thrown when a class may not be serialized. The - * descriptive message will consist of the name of the class in question. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class NotSerializableException extends ObjectStreamException -{ - -/* - * Constructors + * This exception is thrown when a class implements Serializable because + * of a superclass, but should not be serialized. The descriptive message + * will consist of the name of the class in question. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.1 + * @status updated to 1.4 */ - -/** - * Create a new NotSerializableException without a descriptive error message - */ -public -NotSerializableException() +public class NotSerializableException extends ObjectStreamException { - super(); -} + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 2906642554793891381L; -/*************************************************************************/ - -/** - * Create a new NotSerializableException with a descriptive error message String - * This should be the name of the class that cannot be serialized. - * - * @param message The descriptive error message - */ -public -NotSerializableException(String message) -{ - super(message); -} + /** + * Create an exception without a descriptive error message. + */ + public NotSerializableException() + { + } + /** + * Create an exception with a descriptive error message, which should + * be the name of the class. + * + * @param message the descriptive error message + */ + public NotSerializableException(String message) + { + super(message); + } } // class NotSerializableException - diff --git a/java/io/ObjectStreamException.java b/java/io/ObjectStreamException.java index 91b76cfde..ee4a34167 100644 --- a/java/io/ObjectStreamException.java +++ b/java/io/ObjectStreamException.java @@ -1,5 +1,5 @@ -/* ObjectStreamException.java -- Superclass of all serialisation exceptions - Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. +/* ObjectStreamException.java -- Superclass of all serialization exceptions + Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,49 +38,37 @@ exception statement from your version. */ package java.io; -/* Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. - */ - /** - * 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 <warrenl@cygnus.com> - * @date February 7, 2000. - */ -public abstract class ObjectStreamException extends IOException -{ - -/* - * Constructors + * 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. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy <warrenl@cygnus.com> + * @since 1.1 + * @status updated to 1.4 */ - -/** - * Create a new ObjectStreamException without a descriptive error message - */ -protected -ObjectStreamException() +public abstract class ObjectStreamException extends IOException { - super(); -} + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 7260898174833392607L; -/*************************************************************************/ - -/** - * Create a new ObjectStreamException with a descriptive error message String - * - * @param message The descriptive error message - */ -protected -ObjectStreamException(String message) -{ - super(message); -} + /** + * Create an exception without a descriptive error message. + */ + protected ObjectStreamException() + { + } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + protected ObjectStreamException(String message) + { + super(message); + } } // class ObjectStreamException - diff --git a/java/io/OptionalDataException.java b/java/io/OptionalDataException.java index b369d837f..919c2bf0f 100644 --- a/java/io/OptionalDataException.java +++ b/java/io/OptionalDataException.java @@ -1,5 +1,5 @@ -/* OptionalDataException.java -- indicates unexpected data in serialised stream - Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. +/* OptionalDataException.java -- indicates unexpected data in serialized stream + Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,61 +38,54 @@ exception statement from your version. */ package java.io; -/* Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. - */ - /** - * This exception is thrown when unexpected data appears in the input - * stream from which a serialized object is being read. The field - * <code>eof</code> will always be set to true (***Why even have it?***) and - * the <code>count</code> field will contain the number of valid bytes - * available to be read. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) - * @author Warren Levy <warrenl@cygnus.com> - * @date February 7, 2000. - */ -public class OptionalDataException extends ObjectStreamException -{ - -private static final long serialVersionUID = -8011121865681257820L; - -/* - * Instance Variables + * This exception is thrown when unexpected data appears in the input + * stream from which a serialized object is being read. There are two + * cases:<br><ul> + * <li>The next stream element is primitive data. <code>eof</code> will + * be false, and <code>count</code> is the number of bytes of primitive + * data available.</li> + * <li>The data consumable by readObject or readExternal has been exhausted. + * <code>eof</code> is true, and <code>count</code> is 0.</li> + * </ul> + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy <warrenl@cygnus.com> + * @since 1.1 + * @status updated to 1.4 */ - -/** - * Whether or not the end of the stream has been reached - */ -public boolean eof; - -/** - * The number of valid bytes that can be read - */ -public int length; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * Create a new OptionalDataException with an eof parameter indicating - * whether or not the end of stream is reached and the number of valid - * bytes that may be read. - * - * @param eof 'true' if end of stream reached, 'false' otherwise - * @param count The number of valid bytes to be read. - */ -OptionalDataException(boolean eof, int count) +public class OptionalDataException extends ObjectStreamException { - this.eof = eof; - this.length = count; -} - + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -8011121865681257820L; + + /** + * Whether or not the end of the stream has been reached. + * + * @serial the end of the buffer was reached + */ + public boolean eof; + + /** + * The number of valid bytes that can be read. + * + * @serial the bytes of the buffer remaining + */ + public int length; + + /** + * Create a new OptionalDataException with an eof parameter indicating + * whether or not the end of stream is reached and the number of valid + * bytes that may be read. + * + * @param eof 'true' if end of stream reached, 'false' otherwise + * @param count The number of valid bytes to be read + */ + OptionalDataException(boolean eof, int count) + { + this.eof = eof; + this.length = count; + } } // class OptionalDataException - diff --git a/java/io/StreamCorruptedException.java b/java/io/StreamCorruptedException.java index 3461c577b..004047fb6 100644 --- a/java/io/StreamCorruptedException.java +++ b/java/io/StreamCorruptedException.java @@ -1,5 +1,5 @@ /* StreamCorruptedException.java -- Error in stream during serialization - Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,48 +38,36 @@ exception statement from your version. */ package java.io; -/* Written using on-line Java Platform 1.2 API Specification. - * 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 <warrenl@cygnus.com> - * @date February 7, 2000. - */ -public class StreamCorruptedException extends ObjectStreamException -{ - -/* - * Constructors + * This exception is thrown when there is an error in the data that is + * read from a stream during de-serialization. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Warren Levy <warrenl@cygnus.com> + * @since 1.1 + * @status updated to 1.4 */ - -/** - * Create a new StreamCorruptedException without a descriptive error message - */ -public -StreamCorruptedException() +public class StreamCorruptedException extends ObjectStreamException { - super(); -} - -/*************************************************************************/ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 8983558202217591746L; -/** - * Create a new StreamCorruptedException with a descriptive error message String - * - * @param message The descriptive error message - */ -public -StreamCorruptedException(String message) -{ - super(message); -} + /** + * Create an exception without a descriptive error message. + */ + public StreamCorruptedException() + { + } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public StreamCorruptedException(String message) + { + super(message); + } } // class StreamCorruptedException - diff --git a/java/io/SyncFailedException.java b/java/io/SyncFailedException.java index e06d86f94..a896ffb5e 100644 --- a/java/io/SyncFailedException.java +++ b/java/io/SyncFailedException.java @@ -1,5 +1,5 @@ -/* SyncFailedException.java -- The sync failed (?) - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* SyncFailedException.java -- a file sync failed + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,49 +38,29 @@ exception statement from your version. */ package java.io; -/* 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 <tromey@cygnus.com> - * @date September 24, 1998 - */ -public class SyncFailedException extends IOException -{ - -private static final long serialVersionUID = -2353342684412443330L; - -/* - * Constructors + * Thrown when a file synchronization fails. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey <tromey@cygnus.com> + * @see FileDescriptor#sync() + * @since 1.1 + * @status updated to 1.4 */ - -/** - * 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) +public class SyncFailedException extends IOException { - super(message); -} - + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -2353342684412443330L; + + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public SyncFailedException(String message) + { + super(message); + } } // class SyncFailedException - diff --git a/java/io/UTFDataFormatException.java b/java/io/UTFDataFormatException.java index 8fcf278d7..a38e25179 100644 --- a/java/io/UTFDataFormatException.java +++ b/java/io/UTFDataFormatException.java @@ -1,5 +1,5 @@ -/* UTFDataFormatException.java -- Bad format in UTF data - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* UTFDataFormatException.java -- thrown on bad format in UTF data + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,49 +38,37 @@ exception statement from your version. */ package java.io; -/* 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 <tromey@cygnus.com> - * @date September 24, 1998 - */ -public class UTFDataFormatException extends IOException -{ - -/* - * Constructors + * When reading a UTF string from an input stream, this exception is thrown + * to indicate that the data read is invalid. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Tom Tromey <tromey@cygnus.com> + * @see DataInput + * @see DataInputStream#readUTF(DataInput) + * @status updated to 1.4 */ - -/** - * Create a new UTFDataFormatException without a descriptive error message - */ -public -UTFDataFormatException() +public class UTFDataFormatException extends IOException { - super(); -} - -/*************************************************************************/ + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 420743449228280612L; -/** - * Create a new UTFDataFormatException with a descriptive error message String - * - * @param message The descriptive error message - */ -public -UTFDataFormatException(String message) -{ - super(message); -} + /** + * Create a new UTFDataFormatException without a descriptive error message. + */ + public UTFDataFormatException() + { + } + /** + * Create a new UTFDataFormatException with a descriptive error message. + * + * @param message the descriptive error message + */ + public UTFDataFormatException(String message) + { + super(message); + } } // class UTFDataFormatException - diff --git a/java/io/UnsupportedEncodingException.java b/java/io/UnsupportedEncodingException.java index 23147960a..8ee686bde 100644 --- a/java/io/UnsupportedEncodingException.java +++ b/java/io/UnsupportedEncodingException.java @@ -1,5 +1,5 @@ -/* UnsupportedEncodingException.java -- The requested encoding isn't supported - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* UnsupportedEncodingException.java -- the requested encoding isn't supported + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,49 +38,36 @@ exception statement from your version. */ 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 <bothner@cygnus.com> - * @date April 17, 1998. - */ -public class UnsupportedEncodingException extends IOException -{ - -/* - * Constructors + * This exception is thrown when the requested character encoding is + * not supported. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Per Bothner <bothner@cygnus.com> + * @since 1.1 + * @status updated to 1.4 */ - -/** - * Create a new UnsupportedEncodingException without a descriptive error message - */ -public -UnsupportedEncodingException() +public class UnsupportedEncodingException extends IOException { - super(); -} - -/*************************************************************************/ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -4274276298326136670L; -/** - * Create a new UnsupportedEncodingException with a descriptive error message String - * - * @param message The descriptive error message - */ -public -UnsupportedEncodingException(String message) -{ - super(message); -} + /** + * Create an exception without a descriptive error message. + */ + public UnsupportedEncodingException() + { + } + /** + * Create an exception with a descriptive error message. + * + * @param message the descriptive error message + */ + public UnsupportedEncodingException(String message) + { + super(message); + } } // class UnsupportedEncodingException - diff --git a/java/io/WriteAbortedException.java b/java/io/WriteAbortedException.java index ce824a94c..0204862ef 100644 --- a/java/io/WriteAbortedException.java +++ b/java/io/WriteAbortedException.java @@ -1,6 +1,5 @@ -/* WriteAbortedException.java -- An exception occurred while writing a - serialization stream - Copyright (C) 1998, 2000 Free Software Foundation, Inc. +/* WriteAbortedException.java -- wraps an exception thrown while writing + Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +7,7 @@ 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 @@ -40,61 +39,71 @@ exception statement from your version. */ package java.io; /** - * This exception is thrown when one of the other ObjectStreamException - * subclasses was thrown during a serialization write. - * - * @version 0.0 + * This exception is thrown when another ObjectStreamException occurs during + * a serialization read or write. The stream is reset, and deserialized + * objects are discarded. * * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Eric Blake <ebb9@email.byu.edu> + * @since 1.1 + * @status updated to 1.4 */ public class WriteAbortedException extends ObjectStreamException { - -/* - * Instance Variables - */ - -/** - * The detailed exception that caused this exception to be thrown - */ -public Exception detail; -private transient String message; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * Create a new WriteAbortedException with an eof parameter indicating - * the detailed Exception that caused this exception to be thrown. - * - * @param detail The exception that caused this exception to be thrown - */ -public -WriteAbortedException(String msg, Exception detail) -{ - this.message = msg; - this.detail = detail; -} - -/*************************************************************************/ - -/* - * Instance Variables - */ - -/** - * This method returns a message indicating what went wrong, including - * the message text from the initial exception that caused this one to - * be thrown - */ -public String -getMessage() -{ - return(message + ": " + detail.getMessage()); -} - + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -3326426625597282442L; + + /** + * The cause of this exception. This pre-dates the exception chaining + * of Throwable; and although you can change this field, you are wiser + * to leave it alone. + * + * @serial the exception cause + */ + public Exception detail; + + /** + * Create a new WriteAbortedException with a specified message and + * cause. + * + * @param msg the message + * @param detail the cause + */ + public WriteAbortedException(String msg, Exception detail) + { + super(msg); + initCause(detail); + this.detail = detail; + } + + /** + * This method returns a message indicating what went wrong, in this + * format: + * <code>super.getMessage() + (detail == null ? "" : "; " + detail)<code>. + * + * @return the chained message + */ + public String getMessage() + { + if (detail == this || detail == null) + return super.getMessage(); + return super.getMessage() + "; " + detail; + } + + /** + * Returns the cause of this exception. Note that this may not be the + * original cause, thanks to the <code>detail</code> field being public + * and non-final (yuck). However, to avoid violating the contract of + * Throwable.getCause(), this returns null if <code>detail == this</code>, + * as no exception can be its own cause. + * + * @return the cause + * @since 1.4 + */ + public Throwable getCause() + { + return detail == this ? null : detail; + } } // class WriteAbortedException - diff --git a/java/lang/AbstractMethodError.java b/java/lang/AbstractMethodError.java index eb96b2391..df961864a 100644 --- a/java/lang/AbstractMethodError.java +++ b/java/lang/AbstractMethodError.java @@ -1,5 +1,5 @@ -/* AbstractMethodError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* AbstractMethodError.java -- thrown if an abstract method is invoked + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,41 +38,38 @@ exception statement from your version. */ package java.lang; -/* 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 <code>AbstractMethodError</code> 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. + * An <code>AbstractMethodError</code> 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. This can also occur when + * reflecting on methods. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class AbstractMethodError extends IncompatibleClassChangeError { - static final long serialVersionUID = -1654391082989018462L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -1654391082989018462L; /** * Create an error without a message. */ public AbstractMethodError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public AbstractMethodError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/ArithmeticException.java b/java/lang/ArithmeticException.java index 43f019ce0..de79b096a 100644 --- a/java/lang/ArithmeticException.java +++ b/java/lang/ArithmeticException.java @@ -1,6 +1,6 @@ /* ArithmeticException.java -- exception thrown to indicate conditions like divide by zero. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,41 +39,39 @@ exception statement from your version. */ package java.lang; -/* 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 + * Thrown when a math error has occured, such as trying to divide an + * integer by zero. For example:<br> + * <pre> + * int i = 0; + * int j = 2 / i; + * </pre> * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class ArithmeticException extends RuntimeException { - static final long serialVersionUID = 2256477558314496007L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 2256477558314496007L; /** * Create an exception without a message. */ public ArithmeticException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public ArithmeticException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/ArrayIndexOutOfBoundsException.java b/java/lang/ArrayIndexOutOfBoundsException.java index bdb362844..1a6db8daf 100644 --- a/java/lang/ArrayIndexOutOfBoundsException.java +++ b/java/lang/ArrayIndexOutOfBoundsException.java @@ -1,6 +1,6 @@ /* ArrayIndexOutOfBoundsException.java -- exception thrown when accessing an illegal index. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,49 +39,49 @@ exception statement from your version. */ package java.lang; -/* 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 + * Thrown when attempting to access a position outside the valid range of + * an array. For example:<br> + * <pre> + * int[] i = { 1 }; + * i[1] = 2; + * </pre> * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException { - static final long serialVersionUID = -5116101128118950844L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -5116101128118950844L; /** * Create an exception without a message. */ - public ArrayIndexOutOfBoundsException() { - super(); + public ArrayIndexOutOfBoundsException() + { } /** * Create an exception with a message. + * + * @param s the message */ - public ArrayIndexOutOfBoundsException(String s) { + public ArrayIndexOutOfBoundsException(String s) + { super(s); } /** * Create an exception indicating the illegal index. + * + * @param index the invalid index */ - public ArrayIndexOutOfBoundsException(int index) { + public ArrayIndexOutOfBoundsException(int index) + { super("Array index out of range: " + index); } - } diff --git a/java/lang/ArrayStoreException.java b/java/lang/ArrayStoreException.java index b3e12fda8..3fa714d2e 100644 --- a/java/lang/ArrayStoreException.java +++ b/java/lang/ArrayStoreException.java @@ -1,6 +1,6 @@ /* 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. + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,40 +39,39 @@ exception statement from your version. */ package java.lang; -/* 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 + * Thrown when trying to store an object of the wrong runtime type in an + * array. For example:<br> + * <pre> + * Object[] o = new Integer[1]; + * o[0] = "oops"; + * </pre> * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class ArrayStoreException extends RuntimeException { - static final long serialVersionUID = -4522193890499838241L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -4522193890499838241L; /** * Create an exception without a message. */ public ArrayStoreException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public ArrayStoreException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/AssertionError.java b/java/lang/AssertionError.java index e51df4622..1ce00aee7 100644 --- a/java/lang/AssertionError.java +++ b/java/lang/AssertionError.java @@ -1,4 +1,4 @@ -/* AssertionError.java -- fIndication of a failed assertion +/* AssertionError.java -- indication of a failed assertion Copyright (C) 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. diff --git a/java/lang/ClassCastException.java b/java/lang/ClassCastException.java index b13073310..b552b23fb 100644 --- a/java/lang/ClassCastException.java +++ b/java/lang/ClassCastException.java @@ -1,6 +1,5 @@ -/* 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. +/* ClassCastException.java -- exception thrown on bad cast + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +7,7 @@ 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 @@ -39,45 +38,39 @@ exception statement from your version. */ package java.lang; -/* 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 <code>ClassCastException</code>. + * Thrown when an attempt is made to cast an object which is not of the + * appropriate runtime type. For example:<br> * <pre> * Object o = new Vector(); - * String s = (String)o; + * String s = (String) o; * </pre> * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class ClassCastException extends RuntimeException { - static final long serialVersionUID = -9223365651070458532L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -9223365651070458532L; /** * Create an exception without a message. */ public ClassCastException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public ClassCastException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/ClassCircularityError.java b/java/lang/ClassCircularityError.java index 95e292d75..8016eadb8 100644 --- a/java/lang/ClassCircularityError.java +++ b/java/lang/ClassCircularityError.java @@ -1,5 +1,5 @@ -/* ClassCircularityError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* ClassCircularityError.java -- thrown when linking circular classes + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,39 +38,36 @@ exception statement from your version. */ package java.lang; -/* 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 <code>ClassCircularityError</code> is thrown when a circular dependency - * has been detected while initializing a class. + * has been detected while initializing a class. This signals binary + * incompatible versions of class files, as the compiler normally catches this. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class ClassCircularityError extends LinkageError { - static final long serialVersionUID = 1054362542914539689L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 1054362542914539689L; /** * Create an error without a message. */ public ClassCircularityError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public ClassCircularityError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/ClassFormatError.java b/java/lang/ClassFormatError.java index 0621c85e6..d28cacdf7 100644 --- a/java/lang/ClassFormatError.java +++ b/java/lang/ClassFormatError.java @@ -1,5 +1,5 @@ -/* ClassFormatError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* ClassFormatError.java -- thrown if a class file is invalid + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,38 +38,35 @@ exception statement from your version. */ package java.lang; -/* 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 <code>ClassFormatError</code> is thrown when a Java Virtual Machine + * A <code>ClassFormatError</code> 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 + * @status updated to 1.4 */ public class ClassFormatError extends LinkageError { - static final long serialVersionUID = -8420114879011949195L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -8420114879011949195L; /** * Create an error without a message. */ public ClassFormatError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public ClassFormatError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/ClassNotFoundException.java b/java/lang/ClassNotFoundException.java index 11b792b18..cb546602e 100644 --- a/java/lang/ClassNotFoundException.java +++ b/java/lang/ClassNotFoundException.java @@ -1,6 +1,5 @@ -/* ClassNotFoundException.java -- exception thrown when attempting to load - a class when no definition for the class can be found. - Copyright (C) 1998 Free Software Foundation, Inc. +/* ClassNotFoundException.java -- thrown when class definition cannot be found + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +7,7 @@ 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 @@ -39,137 +38,88 @@ exception statement from your version. */ package java.lang; -import java.io.ObjectOutputStream; -import java.io.ObjectInputStream; -import java.io.IOException; -import java.io.PrintStream; -import java.io.PrintWriter; - /** - * 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 by thrown by specific methods of <code>ClassLoader</code> - * and <code>Class</code> when attempting to load a class when no definition - * for the specified class can be found. + * Thrown when a class is requested by reflection, but the class definition + * cannot be found. This exception is often chained from another Throwable. * - * @since JDK 1.0 - * * @author Brian Jones + * @author Eric Blake <ebb9@email.byu.edu> + * @see Class#forName(String) + * @see ClassLoader#findSystemClass(String) + * @see ClassLoader#loadClass(String, boolean) + * @status updated to 1.4 */ public class ClassNotFoundException extends Exception { - static final long serialVersionUID = 9176873029745254542L; - - private Throwable ex = null; - /** - * Create an exception without a message. + * Compatible with JDK 1.0+. */ - public ClassNotFoundException() - { - super(); - } + private static final long serialVersionUID = 9176873029745254542L; /** - * Create an exception with a message. - */ - public ClassNotFoundException(String s) - { - super(s); - } - - /** - * Create an exception with a message and include the exception - * which occurred while loading the class. - * - * @param ex the exception which occurred while loading the class + * The cause of this exception (duplicates the one stored in Throwable). * - * @since JDK 1.2 + * @serial the exception cause + * @since 1.2 */ - public ClassNotFoundException(String s, Throwable ex) - { - super(s); - this.ex = ex; - } + private final Throwable ex; /** - * Returns the exception which occurred while loading the class, - * otherwise returns null. - * - * @since JDK 1.2 + * Create an exception without a message. Note that this initializes the + * cause to null. */ - public Throwable getException() - { - return ex; - } + public ClassNotFoundException() + { + this(null, null); + } /** - * Print a stack trace of the exception that occurred. + * Create an exception with a message. Note that this initializes the + * cause to null. + * + * @param s the message */ - public void printStackTrace() - { - if (ex == null) - { - super.printStackTrace(); - } - else - { - ex.printStackTrace(); - } - } + public ClassNotFoundException(String s) + { + this(s, null); + } /** - * Print a stack trace of the exception that occurred to - * the specified <code>PrintStream</code>. + * Create an exception with a message and chain it to the exception + * which occurred while loading the class. + * + * @param s the message + * @param ex the chained exception + * @since 1.2 */ - public void printStackTrace(PrintStream ps) - { - if (ex == null) - { - super.printStackTrace(ps); - } - else - { - ex.printStackTrace(ps); - } - } + public ClassNotFoundException(String s, Throwable ex) + { + super(s, ex); + this.ex = ex; + } /** - * Print a stack trace of the exception that occurred to - * the specified <code>PrintWriter</code>. + * Returns the exception which occurred while loading the class, + * otherwise returns null. This is a legacy method; the preferred choice + * now is {@link Throwable#getCause()}. + * + * @return the cause of this exception + * @since 1.2 */ - public void printStackTrace(PrintWriter pw) - { - if (ex == null) - { - super.printStackTrace(pw); - } - else - { - ex.printStackTrace(pw); - } - } + public Throwable getException() + { + return ex; + } /** - * Serialize the object in a manner binary compatible with the JDK 1.2 + * Returns the exception which occurred while loading the class, + * otherwise returns null. + * + * @return the cause of this exception + * @since 1.4 */ - private void writeObject(java.io.ObjectOutputStream s) - throws IOException - { - ObjectOutputStream.PutField oFields; - oFields = s.putFields(); - oFields.put("ex", this.ex); - s.writeFields(); - } - - /** - * Deserialize the object in a manner binary compatible with the JDK 1.2 - */ - private void readObject(java.io.ObjectInputStream s) - throws IOException, ClassNotFoundException - { - ObjectInputStream.GetField oFields; - oFields = s.readFields(); - ex = (Throwable)oFields.get("ex", (Throwable)null); - } + public Throwable getCause() + { + return ex; + } } diff --git a/java/lang/CloneNotSupportedException.java b/java/lang/CloneNotSupportedException.java index 128bd5bb3..e13112ac3 100644 --- a/java/lang/CloneNotSupportedException.java +++ b/java/lang/CloneNotSupportedException.java @@ -1,7 +1,5 @@ -/* 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. +/* CloneNotSupportedException.java -- thrown when an object cannot be cloned + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -9,7 +7,7 @@ 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 @@ -40,33 +38,38 @@ exception statement from your version. */ package java.lang; -/* 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. - */ - /** * Thrown to indicate an object should not or could not be cloned. This * includes the case when {@link Object#clone()} is called on an object - * which does not implement the {@link Cloneable} interface. - * <p> + * which does not implement the {@link Cloneable} interface. For example:<br> + * <pre> + * void m() throws CloneNotSupportedException + * { + * clone(); + * } + * </pre> * - * Notice that calling <code>clone()</code> on an array will never produce + * <p>Notice that calling <code>clone()</code> on an array will never produce * this exception, as the VM will always succeed in copying the array, or - * cause an OutOfMemoryError first. + * cause an OutOfMemoryError first. For example:<br> + * <pre> + * void m(int[] array) + * { + * int[] copy = (int[]) array.clone(); + * } + * </pre> * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> * @author Eric Blake <ebb9@email.byu.edu> - * @since 1.0 * @see Cloneable * @see Object#clone() + * @status updated to 1.4 */ public class CloneNotSupportedException extends Exception { /** - * compatible with JDK 1.0+ + * Compatible with JDK 1.0+. */ private static final long serialVersionUID = 5195511250079656443L; @@ -79,6 +82,7 @@ public class CloneNotSupportedException extends Exception /** * Create an exception with a message. + * * @param s the error message */ public CloneNotSupportedException(String s) diff --git a/java/lang/Exception.java b/java/lang/Exception.java index a1c79ac5f..edf5de228 100644 --- a/java/lang/Exception.java +++ b/java/lang/Exception.java @@ -1,6 +1,6 @@ /* Exception.java -- generic exception thrown to indicate an exceptional condition has occurred. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,40 +39,66 @@ exception statement from your version. */ package java.lang; -/* 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 + * The root class of all exceptions worth catching in a program. This + * includes the special category of <code>RuntimeException</code>, which + * does not need to be declared in a throws clause. Exceptions can be used + * to represent almost any exceptional behavior, such as programming errors, * mouse movements, keyboard clicking, etc. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @author Eric Blake <ebb9@email.byu.edu> + * @status updated to 1.4 */ public class Exception extends Throwable { - static final long serialVersionUID = -3387516993124229948L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -3387516993124229948L; /** - * Create an exception without a message. + * Create an exception without a message. The cause remains uninitialized. + * + * @see #initCause(Throwable) */ public Exception() - { - super(); - } + { + } /** - * Create an exception with a message. + * Create an exception with a message. The cause remains uninitialized. + * + * @param s the message + * @see #initCause(Throwable) */ public Exception(String s) - { - super(s); - } + { + super(s); + } + + /** + * Create an exception with a message and a cause. + * + * @param s the message string + * @param cause the cause of this error + * @since 1.4 + */ + public Exception(String s, Throwable cause) + { + super(s, cause); + } + + /** + * Create an exception with a given cause, and a message of + * <code>cause == null ? null : cause.toString()</code>. + * + * @param cause the cause of this exception + * @since 1.4 + */ + public Exception(Throwable cause) + { + super(cause); + } } diff --git a/java/lang/ExceptionInInitializerError.java b/java/lang/ExceptionInInitializerError.java index f05a8ca4e..d04bdc010 100644 --- a/java/lang/ExceptionInInitializerError.java +++ b/java/lang/ExceptionInInitializerError.java @@ -1,5 +1,6 @@ -/* ExceptionInInitializerError.java - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* ExceptionInInitializerError.java -- thrown when class initialization fails + with an uncaught exception + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +8,7 @@ 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 @@ -38,118 +39,85 @@ exception statement from your version. */ package java.lang; -import java.io.PrintStream; -import java.io.PrintWriter; - -/* 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 <code>ExceptionInInitializerError</code> is thrown when an - * unexpected exception has occurred in a static initializer or the - * initializer for a static variable. + * An <code>ExceptionInInitializerError</code> is thrown when an uncaught + * exception has occurred in a static initializer or the initializer for a + * static variable. In general, this wraps only RuntimeExceptions, since the + * compiler does not allow a checked exception to be uncaught in an + * initializer. This exception only occurs during reflection, when a class + * is initialized as part of another action. * - * @since JDK 1.1 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @author Eric Blake <ebb9@email.byu.edu> + * @since 1.1 + * @status updated to 1.4 */ public class ExceptionInInitializerError extends LinkageError { + /** + * Compatible with JDK 1.1+. + */ static final long serialVersionUID = 1521711792217232256L; - private Throwable exception = null; + /** + * The cause of this exception (duplicates the one stored in Throwable). + * + * @serial the exception cause + */ + private final Throwable exception; /** - * Create an error without a message. + * Create an error without a message. The cause is initialized as null. */ public ExceptionInInitializerError() - { - super(); - } + { + this((String) null); + } /** - * Create an error with a message. + * Create an error with a message. The cause is initialized as null. + * + * @param s the message */ public ExceptionInInitializerError(String s) - { - super(s); - } + { + super(s); + exception = null; + } /** * Creates an error an saves a reference to the <code>Throwable</code> - * object. + * object. The message string is null. * * @param t the exception thrown */ public ExceptionInInitializerError(Throwable t) - { - super(t.toString()); - exception = t; - } - - /** - * Return the exception that caused this error to be created. - * @return the stored <code>Throwable</code> object or <code>null</code> - * if this <code>ExceptionInInitializerError</code> has no stored - * <code>Throwable</code> object. - */ - public Throwable getException() - { - return exception; - } + { + super(null); + initCause(t); + exception = t; + } /** - * 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(); - } - } - - /** - * Print a stack trace of the exception that occurred to - * the specified <code>PrintStream</code>. + * Return the exception that caused this error to be created. This is a + * legacy method; the preferred choice now is {@link Throwable#getCause()}. + * + * @return the cause, or null if unknown */ - public void printStackTrace(PrintStream ps) - { - if (exception == null) - { - super.printStackTrace(ps); - } - else - { - ps.print(this.getClass() + ": "); - exception.printStackTrace(ps); - } - } + public Throwable getException() + { + return exception; + } /** - * Print a stack trace of the exception that occurred to - * the specified <code>PrintWriter</code>. + * Return the exception that cause this error to be created. + * + * @return the cause, or null if unknown + * @since 1.4 */ - public void printStackTrace(PrintWriter pw) - { - if (exception == null) - { - super.printStackTrace(pw); - } - else - { - pw.print(this.getClass() + ": "); - exception.printStackTrace(pw); - } - } + public Throwable getCause() + { + return exception; + } } diff --git a/java/lang/IllegalAccessError.java b/java/lang/IllegalAccessError.java index b672478f9..a5c384e77 100644 --- a/java/lang/IllegalAccessError.java +++ b/java/lang/IllegalAccessError.java @@ -1,5 +1,5 @@ -/* IllegalAccessError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* IllegalAccessError.java -- thrown when linking to an inaccessible member + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,43 +38,39 @@ exception statement from your version. */ package java.lang; -/* 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 <code>IllegalAccessError</code> is thrown when an attempt is made to + * An <code>IllegalAccessError</code> 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, + * 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 + * changed in a way that is incompatible with the previously compiled * application. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class IllegalAccessError extends IncompatibleClassChangeError { - static final long serialVersionUID = -8988904074992417891L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -8988904074992417891L; /** * Create an error without a message. */ public IllegalAccessError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public IllegalAccessError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/IllegalAccessException.java b/java/lang/IllegalAccessException.java index 1bef5e83c..f6fc8f67e 100644 --- a/java/lang/IllegalAccessException.java +++ b/java/lang/IllegalAccessException.java @@ -1,6 +1,6 @@ -/* 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. +/* IllegalAccessException.java -- thrown on attempt to reflect on + inaccessible data + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,45 +39,57 @@ exception statement from your version. */ package java.lang; -/* 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 - * <code>ClassLoader</code> and <code>Class</code>. 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 - * <code>newsInstance</code> method of class <code>Class</code>. + * Thrown whenever a reflective method tries to do something that the + * compiler would not allow. For example, using reflection to set a private + * variable that belongs to a class in another package is bad. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @see Class#newInstance() + * @see Field#set(Object, Object) + * @see Field#setBoolean(Object, boolean) + * @see Field#setByte(Object, byte) + * @see Field#setShort(Object, short) + * @see Field#setChar(Object, char) + * @see Field#setInt(Object, int) + * @see Field#setLong(Object, long) + * @see Field#setFloat(Object, float) + * @see Field#setDouble(Object, double) + * @see Field#get(Object) + * @see Field#getBoolean(Object) + * @see Field#getByte(Object) + * @see Field#getShort(Object) + * @see Field#getChar(Object) + * @see Field#getInt(Object) + * @see Field#getLong(Object) + * @see Field#getFloat(Object) + * @see Field#getDouble(Object) + * @see Method#invoke(Object, Object[]) + * @see Constructor#newInstance(Object[]) + * @status updated to 1.4 */ public class IllegalAccessException extends Exception { - static final long serialVersionUID = 6616958222490762034L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 6616958222490762034L; /** * Create an exception without a message. */ public IllegalAccessException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public IllegalAccessException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/IllegalArgumentException.java b/java/lang/IllegalArgumentException.java index 6d5e31233..deb6735c8 100644 --- a/java/lang/IllegalArgumentException.java +++ b/java/lang/IllegalArgumentException.java @@ -1,6 +1,6 @@ -/* 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. +/* IllegalArgumentException.java -- thrown when a method is passed an + illegal or inappropriate argument + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -38,41 +38,38 @@ exception statement from your version. */ package java.lang; -/* 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. + * Thrown when a method is passed an illegal or inappropriate argument. For + * example:<br> + * <pre> + * wait(-1); + * </pre> * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class IllegalArgumentException extends RuntimeException { - static final long serialVersionUID = -5365630128856068164L; - + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -5365630128856068164L; + /** * Create an exception without a message. */ public IllegalArgumentException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public IllegalArgumentException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/IllegalMonitorStateException.java b/java/lang/IllegalMonitorStateException.java index c556be758..08e1ba7a1 100644 --- a/java/lang/IllegalMonitorStateException.java +++ b/java/lang/IllegalMonitorStateException.java @@ -1,6 +1,6 @@ -/* IllegalMonitorStateException.java -- exception thrown when a thread - attempts to wait on an object's monitor. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* IllegalMonitorStateException.java -- thrown when trying to wait or + notify a monitor that is not owned + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,43 +39,40 @@ exception statement from your version. */ package java.lang; -/* 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 - * <code>IllegalMonitorStateException</code> 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. + * Thrown when a thread attempts to wait or notify on a monitor that it + * does not own (ie. it has not synchronized on the object). For example:<br> + * <pre> + * void m() { + * notify(); + * } + * </pre> * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class IllegalMonitorStateException extends RuntimeException { - static final long serialVersionUID = 3713306369498869069L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 3713306369498869069L; /** * Create an exception without a message. */ public IllegalMonitorStateException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public IllegalMonitorStateException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/IllegalStateException.java b/java/lang/IllegalStateException.java index df759f157..16dcf1a80 100644 --- a/java/lang/IllegalStateException.java +++ b/java/lang/IllegalStateException.java @@ -1,6 +1,6 @@ -/* IllegalStateException.java -- exception thrown when invoking a method at - an illegal or inappropriate time. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* IllegalStateException.java -- thrown when invoking a method at + an illegal or inappropriate time + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,41 +39,42 @@ exception statement from your version. */ package java.lang; -/* 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 <code>IllegalStateException</code>. + * Thrown when a method is invoked at an illegal or inappropriate time. For + * example:<br> + * <pre> + * void m(Collecion c) + * { + * c.iterator().remove(); + * } + * </pre> * - * @since JDK 1.1 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @since 1.1 + * @status updated to 1.4 */ public class IllegalStateException extends RuntimeException { - static final long serialVersionUID = -1848914673093119416L; + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -1848914673093119416L; /** * Create an exception without a message. */ public IllegalStateException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public IllegalStateException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/IllegalThreadStateException.java b/java/lang/IllegalThreadStateException.java index 37d91edd3..bcc188e1a 100644 --- a/java/lang/IllegalThreadStateException.java +++ b/java/lang/IllegalThreadStateException.java @@ -1,7 +1,6 @@ -/* IllegalThreadStateException.java -- exception thrown when trying to - suspend or resume a Thread when it is not in an appropriate state - for the operation. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* IllegalThreadStateException.java -- thrown when trying to manipulate a + Thread when it is not in an appropriate state + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -9,7 +8,7 @@ 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 @@ -40,41 +39,37 @@ exception statement from your version. */ package java.lang; -/* 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 <code>suspend</code> or <code>resume</code> an object - * of class <code>Thread</code> when it is not in an appropriate state - * for the operation. + * Thrown When trying to manipulate a Thread which is in an inappropriate + * state. Since the documentation suggests that this can happen with + * <code>Thread.suspend</code> or <code>Thread.resume</code>, but these + * two methods are deprecated, this exception is likely very rare. * - * @since JDK 1.0 * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class IllegalThreadStateException extends IllegalArgumentException { - static final long serialVersionUID = -7626246362397460174L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -7626246362397460174L; /** * Create an exception without a message. */ public IllegalThreadStateException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public IllegalThreadStateException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/IncompatibleClassChangeError.java b/java/lang/IncompatibleClassChangeError.java index 48781b71d..7f569fdc3 100644 --- a/java/lang/IncompatibleClassChangeError.java +++ b/java/lang/IncompatibleClassChangeError.java @@ -1,5 +1,5 @@ -/* IncompatibleClassChangeError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* IncompatibleClassChangeError.java -- thrown for binary incompatible classes + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,40 +38,36 @@ exception statement from your version. */ package java.lang; -/* 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 <code>IncompatibleClassChangeError</code> is thrown when the - * definition of a class used by the currently executing method has - * changed in an incompatible way. + * An <code>IncompatibleClassChangeError</code> 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 <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class IncompatibleClassChangeError extends LinkageError { - static final long serialVersionUID = -4914975503642802119L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -4914975503642802119L; /** * Create an error without a message. */ public IncompatibleClassChangeError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public IncompatibleClassChangeError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/IndexOutOfBoundsException.java b/java/lang/IndexOutOfBoundsException.java index f93814a8a..336f87219 100644 --- a/java/lang/IndexOutOfBoundsException.java +++ b/java/lang/IndexOutOfBoundsException.java @@ -1,7 +1,5 @@ -/* 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. +/* IndexOutOfBoundsException.java -- thrown for an invalid index + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -9,7 +7,7 @@ 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 @@ -40,44 +38,38 @@ exception statement from your version. */ package java.lang; -/* 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 <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class IndexOutOfBoundsException extends RuntimeException { - static final long serialVersionUID = 234122996006267687L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 234122996006267687L; /** * Create an exception without a message. */ public IndexOutOfBoundsException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public IndexOutOfBoundsException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/InstantiationError.java b/java/lang/InstantiationError.java index 9b9f07b4e..54aa7b366 100644 --- a/java/lang/InstantiationError.java +++ b/java/lang/InstantiationError.java @@ -1,5 +1,5 @@ -/* InstantiationError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* InstantiationError.java -- thrown when the linker cannot create an instance + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,43 +38,38 @@ exception statement from your version. */ package java.lang; -/* 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 <code>InstantiationError</code> 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. + * An <code>InstantiationError</code> 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 <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class InstantiationError extends IncompatibleClassChangeError { - static final long serialVersionUID = -4885810657349421204L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -4885810657349421204L; /** * Create an error without a message. */ public InstantiationError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public InstantiationError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/InstantiationException.java b/java/lang/InstantiationException.java index d6d4adfae..511481418 100644 --- a/java/lang/InstantiationException.java +++ b/java/lang/InstantiationException.java @@ -1,6 +1,6 @@ -/* InstantiationException.java -- exception thrown when trying to instantiate - interfaces and abstract classes using Class.newInstance. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* InstantiationException.java -- thrown when reflection cannot create an + instance + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,42 +39,36 @@ exception statement from your version. */ package java.lang; -/* 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 - * <code>newInstance</code> method of class <code>Class</code>. Trying - * to do so results in this exception being thrown. + * Thrown when an attempt is made to use reflection to build a + * non-instantiable class (an interface or abstract class). * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @see Class#newInstance() + * @status updated to 1.4 */ public class InstantiationException extends Exception { - static final long serialVersionUID = -8441929162975509110L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -8441929162975509110L; /** * Create an exception without a message. */ public InstantiationException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public InstantiationException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/InternalError.java b/java/lang/InternalError.java index 92361ed1b..d85aed118 100644 --- a/java/lang/InternalError.java +++ b/java/lang/InternalError.java @@ -1,5 +1,5 @@ -/* InternalError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* InternalError.java -- thrown when the VM encounters an internal error + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,39 +38,35 @@ exception statement from your version. */ package java.lang; -/* 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 <code>InternalError</code> is thrown when a mystical error has * occurred in the Java Virtual Machine. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class InternalError extends VirtualMachineError { - static final long serialVersionUID = -9062593416125562365L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -9062593416125562365L; /** * Create an error without a message. */ public InternalError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public InternalError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/InterruptedException.java b/java/lang/InterruptedException.java index 6af9d7583..2ee7867f6 100644 --- a/java/lang/InterruptedException.java +++ b/java/lang/InterruptedException.java @@ -1,7 +1,5 @@ -/* 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. +/* InterruptedException.java -- thrown when a thread is interrupted + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -9,7 +7,7 @@ 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 @@ -40,42 +38,43 @@ exception statement from your version. */ package java.lang; -/* 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 + * Thrown when a thread interrupts another thread which was previously + * sleeping, waiting, or paused in some other way. See the * <code>interrupt</code> method of class <code>Thread</code>. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @see Object#wait() + * @see Object#wait(long) + * @see Object#wait(long, int) + * @see Thread#sleep(long) + * @see Thread#interrupt() + * @see Thread#interrupted() + * @status updated to 1.4 */ public class InterruptedException extends Exception { - static final long serialVersionUID = 6700697376100628473L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 6700697376100628473L; /** * Create an exception without a message. */ public InterruptedException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * + * @param s the message */ public InterruptedException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/LinkageError.java b/java/lang/LinkageError.java index a5c91ca4c..020fe0a9a 100644 --- a/java/lang/LinkageError.java +++ b/java/lang/LinkageError.java @@ -1,5 +1,6 @@ -/* LinkageError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* LinkageError.java -- thrown when classes valid at separate compile times + cannot be linked to each other + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +8,7 @@ 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 @@ -38,40 +39,36 @@ exception statement from your version. */ package java.lang; -/* 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. - */ - /** - * Subclasses of <code>LinkageError</code> are thrown to indicate - * a class which is depended upon by another class has incompatibly - * changed after the compilation of the latter class. + * Subclasses of <code>LinkageError</code> are thrown to indicate that two + * classes which were compatible at separate compilation times cannot be + * linked to one another. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class LinkageError extends Error { - static final long serialVersionUID = 3579600108157160122L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 3579600108157160122L; /** * Create an error without a message. */ public LinkageError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public LinkageError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/NegativeArraySizeException.java b/java/lang/NegativeArraySizeException.java index f56423325..ee73a97d5 100644 --- a/java/lang/NegativeArraySizeException.java +++ b/java/lang/NegativeArraySizeException.java @@ -1,6 +1,6 @@ -/* 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. +/* NegativeArraySizeException.java -- thrown on attempt to create array + with a negative size + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,41 +39,39 @@ exception statement from your version. */ package java.lang; -/* 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. + * size. For example:<br> + * <pre> + * int i = -1; + * int[] array = new int[i]; + * </pre> * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class NegativeArraySizeException extends RuntimeException { - static final long serialVersionUID = -8960118058596991861L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -8960118058596991861L; /** * Create an exception without a message. */ public NegativeArraySizeException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public NegativeArraySizeException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/NoClassDefFoundError.java b/java/lang/NoClassDefFoundError.java index 2e75b65c3..5ca69bcaa 100644 --- a/java/lang/NoClassDefFoundError.java +++ b/java/lang/NoClassDefFoundError.java @@ -1,5 +1,5 @@ -/* NoClassDefFoundError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* NoClassDefFoundError.java -- thrown when a ClassLoader cannot find a class + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,43 +38,39 @@ exception statement from your version. */ package java.lang; -/* 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 <code>NoClassDefFoundError</code> 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 <code>new</code> expression - * or during a normal method call. The reason this would occur at runtime is + * 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 <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class NoClassDefFoundError extends LinkageError { - static final long serialVersionUID = 9095859863287012458L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 9095859863287012458L; /** * Create an error without a message. */ public NoClassDefFoundError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public NoClassDefFoundError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/NoSuchFieldError.java b/java/lang/NoSuchFieldError.java index 66eb66abe..0a197b0c4 100644 --- a/java/lang/NoSuchFieldError.java +++ b/java/lang/NoSuchFieldError.java @@ -1,5 +1,5 @@ -/* NoSuchFieldError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* NoSuchFieldError.java -- thrown when the linker does not find a field + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,40 +38,37 @@ exception statement from your version. */ package java.lang; -/* 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 <code>NoSuchFieldError</code> is thrown if an application attempts - * to access the field of an object and that object no longer has that - * field. + * to access a field of a class, and that class no longer has that field. + * This is normally detected by the compiler, so it signals that you are + * using binary incompatible class versions. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class NoSuchFieldError extends IncompatibleClassChangeError { - static final long serialVersionUID = -3456430195886129035L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -3456430195886129035L; /** * Create an error without a message. */ public NoSuchFieldError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public NoSuchFieldError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/NoSuchFieldException.java b/java/lang/NoSuchFieldException.java index 596371c3b..ee721ebef 100644 --- a/java/lang/NoSuchFieldException.java +++ b/java/lang/NoSuchFieldException.java @@ -1,6 +1,5 @@ -/* NoSuchFieldException.java -- exception thrown to indicate the class does - not have the specified field. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* NoSuchFieldException.java -- thrown when reflecting a non-existant field + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +7,7 @@ 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 @@ -39,40 +38,36 @@ exception statement from your version. */ package java.lang; -/* 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. + * Thrown to indicate the class does not have the specified field. This is + * caused by a variety of reflection methods, when looking up a field by name. * - * @since JDK 1.1 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @since 1.1 + * @status updated to 1.4 */ public class NoSuchFieldException extends Exception { - static final long serialVersionUID = -6143714805279938260L; + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -6143714805279938260L; /** * Create an exception without a message. */ public NoSuchFieldException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public NoSuchFieldException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/NoSuchMethodError.java b/java/lang/NoSuchMethodError.java index 1a219ef58..dced018cf 100644 --- a/java/lang/NoSuchMethodError.java +++ b/java/lang/NoSuchMethodError.java @@ -1,5 +1,5 @@ -/* NoSuchMethodError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* NoSuchMethodError.java -- thrown when the linker does not find a method + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,40 +38,37 @@ exception statement from your version. */ package java.lang; -/* 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 <code>NoSuchMethodError</code> is thrown if an application attempts - * to access a method of a class, and that class no longer has that - * method. + * to access a method of a class, and that class no longer has that method. + * This is normally detected by the compiler, so it signals that you are + * using binary incompatible class versions. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class NoSuchMethodError extends IncompatibleClassChangeError { + /** + * Compatible with JDK 1.0+. + */ static final long serialVersionUID = -3765521442372831335L; /** * Create an error without a message. */ public NoSuchMethodError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public NoSuchMethodError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/NoSuchMethodException.java b/java/lang/NoSuchMethodException.java index eb4a7c1ea..cba69203f 100644 --- a/java/lang/NoSuchMethodException.java +++ b/java/lang/NoSuchMethodException.java @@ -1,6 +1,5 @@ -/* NoSuchMethodException.java -- exception thrown to indicate the class - does not have the specified method. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* NoSuchMethodException.java -- thrown when reflecting a non-existant method + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +7,7 @@ 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 @@ -39,40 +38,35 @@ exception statement from your version. */ package java.lang; -/* 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. + * Thrown to indicate the class does not have the specified method. This is + * caused by a variety of reflection methods, when looking up a method by name. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class NoSuchMethodException extends Exception { - static final long serialVersionUID = 5034388446362600923L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 5034388446362600923L; /** * Create an exception without a message. */ public NoSuchMethodException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public NoSuchMethodException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/NullPointerException.java b/java/lang/NullPointerException.java index 32ae6efaa..bab207193 100644 --- a/java/lang/NullPointerException.java +++ b/java/lang/NullPointerException.java @@ -1,6 +1,5 @@ -/* NullPointerException.java -- exception thrown when attempting to use null - where an object is required. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* NullPointerException.java -- thrown when using null instead of an object + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +7,7 @@ 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 @@ -39,41 +38,45 @@ exception statement from your version. */ package java.lang; -/* 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 <code>null</code> where an object - * is required, such as when accessing an instance method of a null object. + * is required. The Virtual Machine automatically throws this exception + * for the following:<br><ul> + * <li>Calling an instance method on a null object</li> + * <li>Accessing or modifying a field of a null object</li> + * <li>Taking the array length of a null array</li> + * <li>Accessing or modifying the slots of a null array</li> + * <li>Throwing a null Throwable</li> + * <li>Synchronizing on a null object</li> + * </ul> + * <p>Applications should also throw NullPointerExceptions whenever + * <code>null</code> is an inappropriate parameter to a method. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class NullPointerException extends RuntimeException { - static final long serialVersionUID = 5162710183389028792L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 5162710183389028792L; /** * Create an exception without a message. */ public NullPointerException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public NullPointerException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/NumberFormatException.java b/java/lang/NumberFormatException.java index be637adc7..d076cc83d 100644 --- a/java/lang/NumberFormatException.java +++ b/java/lang/NumberFormatException.java @@ -1,6 +1,5 @@ -/* 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. +/* NumberFormatException.java -- thrown when parsing a bad string as a number + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +7,7 @@ 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 @@ -39,42 +38,36 @@ exception statement from your version. */ package java.lang; -/* 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 <code>String</code> to + * Can be thrown when attempting to convert a <code>String</code> 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 <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class NumberFormatException extends IllegalArgumentException { - static final long serialVersionUID = -2848938806368998894L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -2848938806368998894L; /** * Create an exception without a message. */ public NumberFormatException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public NumberFormatException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/OutOfMemoryError.java b/java/lang/OutOfMemoryError.java index b6a52acdb..b56b8f424 100644 --- a/java/lang/OutOfMemoryError.java +++ b/java/lang/OutOfMemoryError.java @@ -1,5 +1,5 @@ -/* OutOfMemoryError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* OutOfMemoryError.java -- thrown when a memory allocation fails + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,40 +38,36 @@ exception statement from your version. */ package java.lang; -/* 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. - */ - /** - * 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 <code>OutOfMemoryError</code> is thrown. + * Thrown 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. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class OutOfMemoryError extends VirtualMachineError { - static final long serialVersionUID = 8228564086184010517L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 8228564086184010517L; /** * Create an error without a message. */ public OutOfMemoryError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public OutOfMemoryError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/RuntimeException.java b/java/lang/RuntimeException.java index 616a05e3d..8fc9fb10a 100644 --- a/java/lang/RuntimeException.java +++ b/java/lang/RuntimeException.java @@ -1,6 +1,5 @@ -/* 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. +/* RuntimeException.java -- root of all unchecked exceptions + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +7,7 @@ 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 @@ -39,43 +38,65 @@ exception statement from your version. */ package java.lang; -/* 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 <code>RuntimeException</code> * 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 <warrenl@cygnus.com> - * @date September 18, 1998. + * @author Eric Blake <ebb9@email.byu.edu> + * @status updated to 1.4 */ public class RuntimeException extends Exception { - static final long serialVersionUID = -7034897190745766939L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -7034897190745766939L; /** - * Create an exception without a message. + * Create an exception without a message. The cause remains uninitialized. + * + * @see #initCause(Throwable) */ public RuntimeException() - { - super(); - } + { + } /** - * Create an exception with a message. + * Create an exception with a message. The cause remains uninitialized. + * + * @param s the message string + * @see #initCause(Throwable) */ public RuntimeException(String s) - { - super(s); - } + { + super(s); + } + + /** + * Create an exception with a message and a cause. + * + * @param s the message string + * @param cause the cause of this exception + * @since 1.4 + */ + public RuntimeException(String s, Throwable cause) + { + super(s, cause); + } + + /** + * Create an exception with the given cause, and a message of + * <code>cause == null ? null : cause.toString()</code>. + * + * @param cause the cause of this exception + * @since 1.4 + */ + public RuntimeException(Throwable cause) + { + super(cause); + } } diff --git a/java/lang/SecurityException.java b/java/lang/SecurityException.java index b2bb1aaac..5fbdb4ae2 100644 --- a/java/lang/SecurityException.java +++ b/java/lang/SecurityException.java @@ -1,6 +1,5 @@ -/* SecurityException.java -- exception thrown to indicate a security - violation. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* SecurityException.java -- thrown to indicate a security violation + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +7,7 @@ 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 @@ -39,41 +38,37 @@ exception statement from your version. */ package java.lang; -/* 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. + * violation. This can occur any time an operation is attempted which is + * deemed unsafe by the current security policies. * - * @since JDK 1.0 - * * @author Brian Jones * @author Warren Levy <warrenl@cygnus.com> - * @date September 18, 1998. + * @see SecurityManager + * @status updated to 1.4 */ public class SecurityException extends RuntimeException { - static final long serialVersionUID = 6878364983674394167L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 6878364983674394167L; /** * Create an exception without a message. */ public SecurityException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public SecurityException(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/StackOverflowError.java b/java/lang/StackOverflowError.java index 6a95310ca..8e8ed8d92 100644 --- a/java/lang/StackOverflowError.java +++ b/java/lang/StackOverflowError.java @@ -1,5 +1,5 @@ -/* StackOverflowError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* StackOverflowError.java -- thrown when the stack depth is exceeded + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,39 +38,35 @@ exception statement from your version. */ package java.lang; -/* 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 <code>StackOverflowError</code> is thrown when a stack overflow occurs. - * This can occur because an application recurses too deeply. + * A <code>StackOverflowError</code> is thrown when the execution stack + * overflow occurs. This often occurs when a method enters infinit recursion. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class StackOverflowError extends VirtualMachineError { - static final long serialVersionUID = 8609175038441759607L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 8609175038441759607L; /** * Create an error without a message. */ public StackOverflowError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public StackOverflowError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/StringIndexOutOfBoundsException.java b/java/lang/StringIndexOutOfBoundsException.java index 6a2c96f24..9a935ee8c 100644 --- a/java/lang/StringIndexOutOfBoundsException.java +++ b/java/lang/StringIndexOutOfBoundsException.java @@ -1,6 +1,6 @@ -/* 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. +/* StringIndexOutOfBoundsException.java -- thrown to indicate attempt to + exceed string bounds + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,52 +39,47 @@ exception statement from your version. */ package java.lang; -/* 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 + * This exception can be thrown to indicate an attempt to access an index + * which is out of bounds of a String. Any negative integer, and a 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 <warrenl@cygnus.com> - * @date September 18, 1998. + * @status updated to 1.4 */ public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException { - static final long serialVersionUID = -6762910422159637258L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -6762910422159637258L; /** * Create an exception without a message. */ public StringIndexOutOfBoundsException() - { - super(); - } + { + } /** * Create an exception with a message. + * + * @param s the message */ public StringIndexOutOfBoundsException(String s) - { - super(s); - } + { + super(s); + } /** * Create an exception noting the illegal index. + * + * @param index the invalid index */ public StringIndexOutOfBoundsException(int index) - { - super("String index out of range: " + index); - } + { + super("String index out of range: " + index); + } } diff --git a/java/lang/ThreadDeath.java b/java/lang/ThreadDeath.java index 8110f9667..3ba4cf899 100644 --- a/java/lang/ThreadDeath.java +++ b/java/lang/ThreadDeath.java @@ -1,5 +1,5 @@ -/* java.lang.ThreadDeath - Special exception registering Thread death. - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* ThreadDeath.java - special exception registering Thread death + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,23 +38,31 @@ exception statement from your version. */ package java.lang; -/* 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 +/** + * ThreadDeath is thrown in a thread when someone calls <code>stop()</code> + * on that thread. <b>Important:</b> Make sure you rethrow this exception + * if you catch it. If you don't, the thread will not die. + * + * <p>This is an Error rather than an exception, so that normal code will + * not catch it. It is intended for asynchronous cleanup when using the + * deprecated Thread.stop() method. + * + * @author John Keiser + * @author Tom Tromey <tromey@cygnus.com> + * @see Thread#stop() + * @status updated to 1.4 */ +public class ThreadDeath extends Error +{ + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -4417128565033088268L; -/** - ** ThreadDeath is thrown in a thread when someone calls <CODE>stop()</CODE> on that thread. - ** - ** <B>Important:</B> 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 <tromey@cygnus.com> - ** @version 1.1.0, 5 Feb 1998, August 26 1998 - ** @since JDK1.0 - ** @see java.lang.Thread#stop() - **/ - -public class ThreadDeath extends Error { + /** + * Create an error without a message. + */ + public ThreadDeath() + { + } } diff --git a/java/lang/UnknownError.java b/java/lang/UnknownError.java index 2325b4030..c200689c9 100644 --- a/java/lang/UnknownError.java +++ b/java/lang/UnknownError.java @@ -1,5 +1,6 @@ -/* UnknownError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* UnknownError.java -- thrown when the VM cannot provide more information + about a catastrophic error + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +8,7 @@ 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 @@ -38,37 +39,34 @@ exception statement from your version. */ package java.lang; -/* 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 <code>UnknownError</code> is thrown when a serious but unknown + * An <code>UnknownError</code> is thrown when a serious but unknown * problem has occurred in the Java Virtual Machine. * - * @since JDK 1.0 - * * @author Brian Jones + * @status updated to 1.4 */ public class UnknownError extends VirtualMachineError { - static final long serialVersionUID = 2524784860676771849L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 2524784860676771849L; /** * Create an error without a message. */ public UnknownError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public UnknownError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/UnsatisfiedLinkError.java b/java/lang/UnsatisfiedLinkError.java index f56bd98f9..95c0b5333 100644 --- a/java/lang/UnsatisfiedLinkError.java +++ b/java/lang/UnsatisfiedLinkError.java @@ -1,5 +1,5 @@ -/* UnsatisfiedLinkError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* UnsatisfiedLinkError.java -- thrown when a native method cannot be loaded + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,40 +38,37 @@ exception statement from your version. */ package java.lang; -/* 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 <code>UnsatisfiedLinkError</code> is thrown if an appropriate * native language definition of a method declared <code>native</code> * cannot be found by the Java Virtual Machine. * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @see Runtime + * @status updated to 1.4 */ public class UnsatisfiedLinkError extends LinkageError { - static final long serialVersionUID = -4019343241616879428L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -4019343241616879428L; /** * Create an error without a message. */ public UnsatisfiedLinkError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public UnsatisfiedLinkError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/UnsupportedClassVersionError.java b/java/lang/UnsupportedClassVersionError.java index b90329df8..7250949c9 100644 --- a/java/lang/UnsupportedClassVersionError.java +++ b/java/lang/UnsupportedClassVersionError.java @@ -1,5 +1,6 @@ -/* UnsupportedClassVersionError.java - Copyright (C) 1998 Free Software Foundation, Inc. +/* UnsupportedClassVersionError.java -- thrown when a class file version + exceeds the capability of the virtual machine + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +8,7 @@ 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 @@ -43,27 +44,31 @@ package java.lang; * 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 + * @since 1.2 + * @status updated to 1.4 */ public class UnsupportedClassVersionError extends ClassFormatError { - static final long serialVersionUID = -7123279212883497373L; + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -7123279212883497373L; /** * Create an error without a message. */ public UnsupportedClassVersionError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public UnsupportedClassVersionError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/UnsupportedOperationException.java b/java/lang/UnsupportedOperationException.java index cda8b2b5b..6c00bef43 100644 --- a/java/lang/UnsupportedOperationException.java +++ b/java/lang/UnsupportedOperationException.java @@ -1,6 +1,6 @@ -/* UnsupportedOperationException.java -- Exception thrown when an - unsupported operation is attempted on an object - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* UnsupportedOperationException.java -- thrown when an operation is not + supported + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -8,7 +8,7 @@ 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 @@ -39,37 +39,34 @@ exception statement from your version. */ package java.lang; -/* 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 <warrenl@cygnus.com> - * @date September 18, 1998. + * @since 1.2 + * @status updated to 1.4 */ public class UnsupportedOperationException extends RuntimeException { - static final long serialVersionUID = -1242599979055084673L; + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -1242599979055084673L; /** * Create an exception without a message. */ - public UnsupportedOperationException() + public UnsupportedOperationException() { - super(); } /** * Create an exception with a message. + * + * @param s the message */ - public UnsupportedOperationException( String s ) + public UnsupportedOperationException(String s) { super(s); } diff --git a/java/lang/VerifyError.java b/java/lang/VerifyError.java index ae291febd..3926530f9 100644 --- a/java/lang/VerifyError.java +++ b/java/lang/VerifyError.java @@ -1,5 +1,5 @@ -/* VerifyError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* VerifyError.java -- thrown when a class fails verification + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,39 +38,35 @@ exception statement from your version. */ package java.lang; -/* 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 <code>VerifyError</code> is thrown if there is a security problem or - * internal inconsistency in a class file as deteced by the "verifier." + * internal inconsistency in a class file as detected by the "verifier." * - * @since JDK 1.0 - * * @author Brian Jones * @author Tom Tromey <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public class VerifyError extends LinkageError { - static final long serialVersionUID = 7001962396098498785L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 7001962396098498785L; /** * Create an error without a message. */ public VerifyError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public VerifyError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/VirtualMachineError.java b/java/lang/VirtualMachineError.java index dec999ad6..b6f0758e8 100644 --- a/java/lang/VirtualMachineError.java +++ b/java/lang/VirtualMachineError.java @@ -1,5 +1,5 @@ -/* VirtualMachineError.java - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* VirtualMachineError.java -- thrown when the Virtual Machine has a problem + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,40 +38,36 @@ exception statement from your version. */ package java.lang; -/* 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 <code>VirtualMachineError</code> or its subclasses are thrown to + * A <code>VirtualMachineError</code> 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 <tromey@cygnus.com> - * @date October 1, 1998 + * @status updated to 1.4 */ public abstract class VirtualMachineError extends Error { - static final long serialVersionUID = 4161983926571568670L; + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 4161983926571568670L; /** * Create an error without a message. */ public VirtualMachineError() - { - super(); - } + { + } /** * Create an error with a message. + * + * @param s the message */ public VirtualMachineError(String s) - { - super(s); - } + { + super(s); + } } diff --git a/java/lang/Void.java b/java/lang/Void.java index 2ac72f26a..b2d64dd5b 100644 --- a/java/lang/Void.java +++ b/java/lang/Void.java @@ -1,5 +1,5 @@ -/* java.lang.Void - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* Void.class - defines void.class + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,30 +38,29 @@ exception statement from your version. */ package java.lang; -/* Written using "Java Class Libraries", 2nd edition, plus online - * API docs for JDK 1.2 beta from http://www.javasoft.com. - * Status: Complete. - */ - /** - * Void is a placeholder class so that the variable Void.TYPE can be - * supported for reflection return types. + * Void is a placeholder class so that the variable <code>Void.TYPE</code> + * (also available as <code>void.class</code>) can be supported for + * reflection return types. + * + * <p>This class could be Serializable, but that is up to Sun. * * @author Paul Fisher * @author John Keiser - * @author Per Bothner <bothner@cygnus.com> - * @since JDK1.1 + * @author Eric Blake <ebb9@email.byu.edu> + * @since 1.1 + * @status updated to 1.4 */ public final class Void { /** - * The return type <code>void</code> is represented by this + * The return type <code>void</code> is represented by this * <code>Class</code> object. */ public static final Class TYPE = VMClassLoader.getPrimitiveClass('V'); /** - * Don't allow Void objects to be made. + * Void is non-instantiable. */ private Void() { } } diff --git a/java/lang/reflect/InvocationTargetException.java b/java/lang/reflect/InvocationTargetException.java index dbaddfd8a..904cc6313 100644 --- a/java/lang/reflect/InvocationTargetException.java +++ b/java/lang/reflect/InvocationTargetException.java @@ -1,5 +1,5 @@ -/* InvocationTargetException.java - Wrapper exception for reflection - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* InvocationTargetException.java -- Wrapper exception for reflection + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,11 +38,8 @@ exception statement from your version. */ package java.lang.reflect; -import java.io.PrintStream; -import java.io.PrintWriter; - /** - * InvocationTargetException is sort of a way to "wrap" whatever exception + * InvocationTargetException is sort of a way to "wrap" whatever exception * comes up when a method or constructor is called via Reflection. As of * JDK 1.4, it was retrofitted to match the exception chaining of all other * exceptions, but <code>getTargetException()</code> still works. @@ -53,75 +50,62 @@ import java.io.PrintWriter; * @see Method#invoke(Object,Object[]) * @see Constructor#newInstance(Object[]) * @since 1.1 - * @status stuck at 1.3; awaiting exception chaining in Throwable + * @status updated to 1.4 */ - -public class InvocationTargetException - extends Exception +public class InvocationTargetException extends Exception { /** - * Compatible with JDK 1.1. + * Compatible with JDK 1.1+. */ private static final long serialVersionUID = 4085088731926701167L; /** * The chained exception. This field is only around for serial compatibility. + * * @serial the chained exception */ private final Throwable target; /** - * Construct an exception with null as the cause. + * Construct an exception with null as the cause. The cause is initialized + * to null. */ - protected InvocationTargetException() + protected InvocationTargetException() { - // XXX Use this implementation when Throwable is ready. - // this(null); - - super(); - target = null; + this(null, null); } - + /** - * Create an <code>InvocationTargetException</code> using another + * Create an <code>InvocationTargetException</code> using another * exception. * * @param targetException the exception to wrap */ - public InvocationTargetException(Throwable targetException) + public InvocationTargetException(Throwable targetException) { - // XXX Use this implementation when Throwable is ready. - // super(targetException); - // target = targetException; - - super(targetException.toString()); - target = targetException; + this(targetException, null); } - - /** - * Create an <code>InvocationTargetException</code> using another + + /** + * Create an <code>InvocationTargetException</code> 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) + public InvocationTargetException(Throwable targetException, String err) { - // XXX Use this implementation when Throwable is ready. - // super(err, targetException); - // target = targetException; - - super(err); + super(err, targetException); target = targetException; } /** * Get the wrapped (targeted) exception. * - * @return the targeted exception. + * @return the targeted exception * @see #getCause() */ - public Throwable getTargetException() + public Throwable getTargetException() { return target; } @@ -129,7 +113,7 @@ public class InvocationTargetException /** * Returns the cause of this exception (which may be null). * - * @return the cause. + * @return the cause * @since 1.4 */ public Throwable getCause() diff --git a/java/lang/reflect/UndeclaredThrowableException.java b/java/lang/reflect/UndeclaredThrowableException.java index d15ec1c3c..d9596922b 100644 --- a/java/lang/reflect/UndeclaredThrowableException.java +++ b/java/lang/reflect/UndeclaredThrowableException.java @@ -1,5 +1,6 @@ -/* java.lang.reflect.UndeclaredThrowableException - Copyright (C) 2001 Free Software Foundation, Inc. +/* UndeclaredThrowableException.java -- wraps an undeclared checked exception + thrown by a Proxy invocation handler + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -43,30 +44,29 @@ package java.lang.reflect; * the {@link InvocationHandler#invoke(Object, Method, Object[]) invoke} * method of that instance's InvocationHandler attempts to throw an * exception that not declared by the throws clauses of all of the - * interface methods that the proxy instance is implementing.<p> + * interface methods that the proxy instance is implementing. * - * When thrown by Proxy, this class will always wrap a checked + * <p>When thrown by Proxy, this class will always wrap a checked * exception, never {@link Error} or {@link RuntimeException}, * which are unchecked. * + * @author Eric Blake <ebb9@email.byu.edu> * @see Proxy * @see InvocationHandler - * @author Eric Blake <ebb9@email.byu.edu> * @since 1.3 - * @status stuck at 1.3; awaiting exception chaining in Throwable + * @status updated to 1.4 */ -public class UndeclaredThrowableException - extends RuntimeException +public class UndeclaredThrowableException extends RuntimeException { /** - * Compliant with JDK 1.3+ + * Compatible with JDK 1.3+. */ private static final long serialVersionUID = 330127114055056639L; /** - * The immutable exception that this wraps. - * This field is redundant with {@link Throwable#cause}, but - * is necessary for serial compatibility. + * The immutable exception that this wraps. This field is redundant + * with {@link Throwable#cause}, but is necessary for serial compatibility. + * * @serial the chained exception */ private final Throwable undeclaredThrowable; @@ -95,11 +95,7 @@ public class UndeclaredThrowableException */ public UndeclaredThrowableException(Throwable cause, String message) { - // XXX Use this implementation when Throwable is ready. - // super(message, cause); - // undeclaredThrowable = cause; - - super(message); + super(message, cause); undeclaredThrowable = cause; } diff --git a/java/net/BindException.java b/java/net/BindException.java index 5b1e4e7c4..3d11c4a4b 100644 --- a/java/net/BindException.java +++ b/java/net/BindException.java @@ -1,5 +1,5 @@ /* BindException.java -- An exception occurred while binding to a socket - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,49 +38,35 @@ exception statement from your version. */ package java.net; /** - * 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 occurred while attempting to bind + * socket to a particular port. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @author Warren Levy <warrenl@cygnus.com> + * @status updated to 1.4 */ - -/** - * This exception indicates that an error occurred while attempting to bind - * socket to a particular port. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - * @author Warren Levy <warrenl@cygnus.com> - * @date March 5, 1999. - */ public class BindException extends SocketException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -5945005768251722951L; -/* - * Constructors - */ - -/** - * Initializes a new instance of <code>BindException</code> without - * a descriptive error message. - */ -public -BindException() -{ - super(); -} - -/*************************************************************************/ - -/** - * Initializes a new instance of <code>BindException</code> 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); -} + /** + * Create a new instance without a descriptive error message. + */ + public BindException() + { + } + /** + * Create a new instance 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/java/net/ConnectException.java b/java/net/ConnectException.java index 673561a5b..e731858ca 100644 --- a/java/net/ConnectException.java +++ b/java/net/ConnectException.java @@ -1,5 +1,5 @@ /* ConnectException.java -- An exception occurred while connecting to a host - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,50 +39,37 @@ exception statement from your version. */ package java.net; /** - * 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 occurred 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 <warrenl@cygnus.com> + * @since 1.1 + * @status updated to 1.4 */ - -/** - * This exception indicates that an error occurred 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 <warrenl@cygnus.com> - * @date March 5, 1999. - */ public class ConnectException extends SocketException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 3831404271622369215L; -/* - * Constructors - */ - -/** - * Initializes a new instance of <code>ConnectException</code> without - * a descriptive error message. - */ -public -ConnectException() -{ - super(); -} - -/*************************************************************************/ - -/** - * Initializes a new instance of <code>ConnectException</code> 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); -} + /** + * Create a new instance without a descriptive error message. + */ + public ConnectException() + { + } + /** + * Create a new instance 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/java/net/Makefile.am b/java/net/Makefile.am index c37884b0a..686bbc3ce 100644 --- a/java/net/Makefile.am +++ b/java/net/Makefile.am @@ -23,18 +23,21 @@ NoRouteToHostException.java \ PasswordAuthentication.java \ PlainDatagramSocketImpl.java \ PlainSocketImpl.java \ +PortUnreachableException.java \ ProtocolException.java \ ServerSocket.java \ +Socket.java \ SocketException.java \ SocketImplFactory.java \ SocketImpl.java \ SocketInputStream.java \ -Socket.java \ SocketOptions.java \ SocketOutputStream.java \ SocketPermission.java \ +SocketTimeoutException.java \ UnknownHostException.java \ UnknownServiceException.java \ +URISyntaxException.java \ URLClassLoader.java \ URLConnection.java \ URLDecoder.java \ diff --git a/java/net/MalformedURLException.java b/java/net/MalformedURLException.java index a74992b09..9cfae9aa5 100644 --- a/java/net/MalformedURLException.java +++ b/java/net/MalformedURLException.java @@ -1,5 +1,5 @@ /* MalformedURLException.java -- A URL was not in a valid format - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,50 +37,37 @@ exception statement from your version. */ package java.net; -/** - * 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. - */ +import java.io.IOException; /** - * 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 <warrenl@cygnus.com> - * @date March 5, 1999. - */ -public class MalformedURLException extends java.io.IOException -{ - -/* - * Constructors + * 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 <warrenl@cygnus.com> + * @status updated to 1.4 */ - -/** - * Initializes a new instance of <code>MalformedURLException</code> without - * a descriptive error message. - */ -public -MalformedURLException() +public class MalformedURLException extends IOException { - super(); -} + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -182787522200415866L; -/*************************************************************************/ - -/** - * Initializes a new instance of <code>MalformedURLException</code> without - * a descriptive error message. - * - * @param message A message describing the error that occurred. - */ -public -MalformedURLException(String message) -{ - super(message); -} + /** + * Create a new instance without a descriptive error message. + */ + public MalformedURLException() + { + } + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public MalformedURLException(String message) + { + super(message); + } } // class MalformedURLException - diff --git a/java/net/NoRouteToHostException.java b/java/net/NoRouteToHostException.java index 58ecfbaa6..2f7fb7276 100644 --- a/java/net/NoRouteToHostException.java +++ b/java/net/NoRouteToHostException.java @@ -1,5 +1,5 @@ /* NoRouteToHostException.java -- Cannot connect to a host - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,49 +39,36 @@ exception statement from your version. */ package java.net; /** - * 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 Aaron M. Renn <arenn@urbanophile.com> * @author Warren Levy <warrenl@cygnus.com> - * @date March 5, 1999. + * @since 1.1 + * @status updated to 1.4 */ public class NoRouteToHostException extends SocketException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -1897550894873493790L; -/* - * Constructors - */ - -/** - * Initializes an instance of <code>NoRouteToHostException</code> - * without a descriptive error message. - */ -public -NoRouteToHostException() -{ - super(); -} - -/*************************************************************************/ - -/** - * Initializes an instance of <code>NoRouteToHostException</code> - * 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); -} + /** + * Create an instance without a descriptive error message. + */ + public NoRouteToHostException() + { + } + /** + * Create an instance with a 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/java/net/PortUnreachableException.java b/java/net/PortUnreachableException.java new file mode 100644 index 000000000..b6abfe95a --- /dev/null +++ b/java/net/PortUnreachableException.java @@ -0,0 +1,72 @@ +/* PortUnreachableException.java -- received an ICMP port unreachable datagram + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.net; + +/** + * This exception signals that an ICMP port unreachable datagram has been + * received. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @since 1.4 + * @status updated to 1.4 + */ +public class PortUnreachableException extends SocketException +{ + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 8462541992376507323L; + + /** + * Create a new instance without a descriptive error message. + */ + public PortUnreachableException() + { + } + + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public PortUnreachableException(String message) + { + super(message); + } +} // class PortUnreachableException + diff --git a/java/net/ProtocolException.java b/java/net/ProtocolException.java index dbdefb758..c50bbcf6e 100644 --- a/java/net/ProtocolException.java +++ b/java/net/ProtocolException.java @@ -1,5 +1,5 @@ -/* ProtocolException.java -- A low level protocol error occurred - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* ProtocolException.java -- a low level protocol error occurred + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,51 +37,38 @@ exception statement from your version. */ package java.net; -/** - * 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. - */ +import java.io.IOException; /** - * This exception indicates that some sort of low level protocol - * exception occurred. Look in the descriptive message (if any) for - * details on what went wrong - * - * @author Aaron M. Renn (arenn@urbanophile.com) - * @author Warren Levy <warrenl@cygnus.com> - * @date March 5, 1999. - */ -public class ProtocolException extends java.io.IOException -{ - -/* - * Constructors + * This exception indicates that some sort of low level protocol + * exception occurred. Look in the descriptive message (if any) for + * details on what went wrong. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @author Warren Levy <warrenl@cygnus.com> + * @status updated to 1.4 */ - -/** - * Initializes a new instance of <code>ProtocolException</code> - * without a descriptive error message. - */ -public -ProtocolException() +public class ProtocolException extends IOException { - super(); -} + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -6098449442062388080L; -/*************************************************************************/ - -/** - * Initializes a new instance of <code>ProtocolException</code> - * with a descriptive error message. - * - * @param message A message describing the error that occurred. - */ -public -ProtocolException(String message) -{ - super(message); -} + /** + * Create a new instance without a descriptive error message. + */ + public ProtocolException() + { + } + /** + * Create a new instance 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/java/net/SocketException.java b/java/net/SocketException.java index 6451b7d5b..6494cae9d 100644 --- a/java/net/SocketException.java +++ b/java/net/SocketException.java @@ -1,5 +1,5 @@ /* SocketException.java -- An exception occurred while performing a socket op - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,49 +37,38 @@ exception statement from your version. */ package java.net; -/* Written using on-line Java Platform 1.2 API Specification. - * Believed complete and correct. - */ +import java.io.IOException; /** - * This exception indicates that a generic error occurred 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 -{ - -/* - * Constructors + * This exception indicates that a generic error occurred 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 + * @status updated to 1.4 */ - -/** - * Initializes a new instance of <code>SocketException</code> without - * a descriptive error message. - */ -public -SocketException() +public class SocketException extends IOException { - super(); -} + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -5935874303556886934L; -/*************************************************************************/ - -/** - * Initializes a new instance of <code>SocketException</code> without - * a descriptive error message. - * - * @param message A message describing the error that occurred. - */ -public -SocketException(String message) -{ - super(message); -} + /** + * Create a new instance without a descriptive error message. + */ + public SocketException() + { + } + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public SocketException(String message) + { + super(message); + } } // class SocketException - diff --git a/java/net/SocketTimeoutException.java b/java/net/SocketTimeoutException.java new file mode 100644 index 000000000..e3895518d --- /dev/null +++ b/java/net/SocketTimeoutException.java @@ -0,0 +1,72 @@ +/* SocketTimeoutException.java -- the socket timed out + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.net; + +import java.io.InterruptedIOException; + +/** + * This exception signals that a socket read or accept timed out. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @since 1.4 + * @status updated to 1.4 + */ +public class SocketTimeoutException extends InterruptedIOException +{ + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = -8846654841826352300L; + + /** + * Create a new instance without a descriptive error message. + */ + public SocketTimeoutException() + { + } + + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public SocketTimeoutException(String message) + { + super(message); + } +} // class SocketTimeoutException diff --git a/java/net/URISyntaxException.java b/java/net/URISyntaxException.java new file mode 100644 index 000000000..cf725665e --- /dev/null +++ b/java/net/URISyntaxException.java @@ -0,0 +1,143 @@ +/* URISyntaxException.java -- a string could not be parsed as a URI + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.net; + +/** + * This exception is thrown when a String cannot be parsed as a URI. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @see URI + * @since 1.4 + * @status updated to 1.4 + */ +public class URISyntaxException extends Exception +{ + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 2137979680897488891L; + + /** + * The failed input. + * + * @serial the bad URI + */ + private final String input; + + /** + * The index of failure. + * + * @serial the location of the problem + */ + private final int index; + + /** + * Create an exception from the invalid string, with the index set to -1. + * + * @param input the bad URI + * @param msg the descriptive error message + * @throws NullPointerException if input or msg are null + */ + public URISyntaxException(String input, String msg) + { + this(input, msg, -1); + } + + /** + * Create an exception from the invalid string, with the index of the + * point of failure. + * + * @param input the bad URI + * @param msg the descriptive error message + * @param index the index of the parse error, or -1 + * @throws NullPointerException if input or msg are null + * @throws IllegalArgumentException if index < -1 + */ + public URISyntaxException(String input, String msg, int index) + { + // The toString() hack checks for null. + super(msg.toString()); + this.input = input.toString(); + this.index = index; + if (index < -1) + throw new IllegalArgumentException(); + } + + /** + * Returns the bad input string. + * + * @return the bad URI, guaranteed non-null + */ + public String getInput() + { + return input; + } + + /** + * Returns the reason for the failure. + * + * @return the message, guaranteed non-null + */ + public String getReason() + { + return super.getMessage(); + } + + /** + * Returns the index of the failure, or -1. + * + * @return the index of failure + */ + public int getIndex() + { + return index; + } + + /** + * Returns a message describing the parse error, as if by + * <code>getReason() + (getIndex() >= 0 ? " at index " + getIndex() : "") + * + ": " + getInput()</code>. + * + * @return the message string + */ + public String getMessage() + { + return super.getMessage() + (index >= 0 ? " at index " + index : "") + + ": " + input; + } +} diff --git a/java/net/UnknownHostException.java b/java/net/UnknownHostException.java index 7a56f2623..46b70401f 100644 --- a/java/net/UnknownHostException.java +++ b/java/net/UnknownHostException.java @@ -1,5 +1,5 @@ -/* UnknownHostException.java -- The hostname is not unknown - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* UnknownHostException.java -- The hostname is unknown + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,52 +37,40 @@ exception statement from your version. */ package java.net; -/* - * Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. - */ +import java.io.IOException; /** - * 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 -{ - -/* - * Constructors + * 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 + * @status updated to 1.4 */ - -/** - * Initializes a new instance of <code>UnknownHostException</code> - * without a descriptive error message. - */ -public -UnknownHostException() +public class UnknownHostException extends IOException { - super(); -} + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -4639126076052875403L; -/*************************************************************************/ - -/** - * Initializes a new instance of <code>UnknownHostException</code> - * 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); -} + /** + * Create a new instance without a descriptive error message. + */ + public UnknownHostException() + { + } + /** + * Create a new instance 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 occurred + */ + public UnknownHostException(String message) + { + super(message); + } } // class UnknownHostException - diff --git a/java/net/UnknownServiceException.java b/java/net/UnknownServiceException.java index 1ccf21d0e..dfb7a44aa 100644 --- a/java/net/UnknownServiceException.java +++ b/java/net/UnknownServiceException.java @@ -1,5 +1,5 @@ /* UnknownServiceException.java -- A service error occurred - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,52 +37,39 @@ exception statement from your version. */ package java.net; -/** - * 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. - */ +import java.io.IOException; /** - * 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 <warrenl@cygnus.com> - * @date March 5, 1999. - */ -public class UnknownServiceException extends java.io.IOException -{ - -/* - * Constructors + * 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 <warrenl@cygnus.com> + * @status updated to 1.4 */ - -/** - * Initializes a new instance of <code>UnknownServiceException</code> - * without a descriptive error message. - */ -public -UnknownServiceException() +public class UnknownServiceException extends IOException { - super(); -} + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = -4169033248853639508L; -/*************************************************************************/ - -/** - * Initializes a new instance of <code>UnknownServiceException</code> - * without a descriptive error message. - * - * @param message A message describing the error that occurred. - */ -public -UnknownServiceException(String message) -{ - super(message); -} + /** + * Create a new instance without a descriptive error message. + */ + public UnknownServiceException() + { + } + /** + * Create a new instance with a descriptive error message. + * + * @param message a message describing the error that occurred + */ + public UnknownServiceException(String message) + { + super(message); + } } // class UnknownServiceException - diff --git a/java/rmi/AccessException.java b/java/rmi/AccessException.java index 5ffdba0b5..389d2df05 100644 --- a/java/rmi/AccessException.java +++ b/java/rmi/AccessException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* AccessException.java -- thrown if the caller does not have access + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,17 +37,40 @@ exception statement from your version. */ package java.rmi; -public class AccessException - extends RemoteException { - -public static final long serialVersionUID = 6314925228044966088l; +/** + * Thrown to indicate that the caller does not have permission to access + * certain data, such as <code>bind</code> in an ActivationSystem. + * + * @author unknown + * @see Naming + * @see ActivationSystem + * @since 1.1 + */ +public class AccessException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 6314925228044966088l; -public AccessException(String s) { - super(s); -} - -public AccessException(String s, Exception e) { - super (s, e); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public AccessException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public AccessException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/AlreadyBoundException.java b/java/rmi/AlreadyBoundException.java index e64a58f80..2062aede1 100644 --- a/java/rmi/AlreadyBoundException.java +++ b/java/rmi/AlreadyBoundException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* AlreadyBoundException.java -- thrown if a binding is already bound + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,15 +37,37 @@ exception statement from your version. */ package java.rmi; -public class AlreadyBoundException - extends Exception { - -public AlreadyBoundException() { - super(); -} +/** + * Thrown on an attempt to bind an object in the registry that is already + * bound. + * + * @author unknown + * @see Naming#bind(String, Remote) + * @see Registry#bind(String, Remote) + * @since 1.1 + * @status updated to 1.4 + */ +public class AlreadyBoundException extends Exception +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 9218657361741657110L; -public AlreadyBoundException(String s) { - super (s); -} + /** + * Create an exception with no message. + */ + public AlreadyBoundException() + { + } + /** + * Create an exception with a message. + * + * @param s the message + */ + public AlreadyBoundException(String s) + { + super(s); + } } diff --git a/java/rmi/ConnectException.java b/java/rmi/ConnectException.java index eca5f4edb..75a7c454f 100644 --- a/java/rmi/ConnectException.java +++ b/java/rmi/ConnectException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ConnectException.java -- thrown if a connection is refused + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,16 +37,38 @@ exception statement from your version. */ package java.rmi; -public class ConnectException - extends RemoteException { - +/** + * Thrown if a connection is refused for a remote call. + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class ConnectException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 4863550261346652506L; -public ConnectException(String s) { - super(s); -} - -public ConnectException(String s, Exception e) { - super (s, e); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public ConnectException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public ConnectException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/ConnectIOException.java b/java/rmi/ConnectIOException.java index 960b16759..24c779d2b 100644 --- a/java/rmi/ConnectIOException.java +++ b/java/rmi/ConnectIOException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ConnectIOException.java -- thrown if an IO exception occurs during connect + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,16 +37,38 @@ exception statement from your version. */ package java.rmi; -public class ConnectIOException - extends RemoteException { - +/** + * Wraps an I/O Exception thrown while connecting for a remote call. + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class ConnectIOException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -8087809532704668744L; -public ConnectIOException(String s) { - super(s); -} - -public ConnectIOException(String s, Exception e) { - super (s, e); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public ConnectIOException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public ConnectIOException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/MarshalException.java b/java/rmi/MarshalException.java index efea1c938..98482a965 100644 --- a/java/rmi/MarshalException.java +++ b/java/rmi/MarshalException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* MarshalException.java -- wraps error while marshalling parameters + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,16 +37,40 @@ exception statement from your version. */ package java.rmi; -public class MarshalException - extends RemoteException { - +/** + * Thrown if an exception occurs while marshalling data to send in a remote + * call. The call may not be retransmitted, if the "at most once" semantics + * are to be preserved. + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class MarshalException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 6223554758134037936L; -public MarshalException(String s) { - super(s); -} - -public MarshalException(String s, Exception e) { - super (s, e); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public MarshalException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public MarshalException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/NoSuchObjectException.java b/java/rmi/NoSuchObjectException.java index ff9ba86f7..dd61f950c 100644 --- a/java/rmi/NoSuchObjectException.java +++ b/java/rmi/NoSuchObjectException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* NoSuchObjectException.java -- thrown if the remote object no longer exists + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,13 +37,32 @@ exception statement from your version. */ package java.rmi; -public class NoSuchObjectException - extends RemoteException { - -public static final long serialVersionUID = 6619395951570472985L; - -public NoSuchObjectException(String s) { - super(s); -} +/** + * Thrown on an attempt to invoke a call on an object that no longer exists + * in the remote Virtual Machine. The call may be retransmitted and still + * obey the semantics of "at most once". + * + * @author unknown + * @see RemoteObject#toStub(Remote) + * @see UnicastRemoteObject#unexportObject(Remote, boolean) + * @see Activatable#unexportObject(Remote, boolean) + * @since 1.1 + * @status updated to 1.4 + */ +public class NoSuchObjectException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 6619395951570472985L; + /** + * Create an exception with a message. + * + * @param s the message + */ + public NoSuchObjectException(String s) + { + super(s); + } } diff --git a/java/rmi/NotBoundException.java b/java/rmi/NotBoundException.java index e7c6cb955..95af177f3 100644 --- a/java/rmi/NotBoundException.java +++ b/java/rmi/NotBoundException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* NotBoundException.java -- attempt to use a registry name with no binding + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,17 +37,39 @@ exception statement from your version. */ package java.rmi; -public class NotBoundException - extends Exception { - -public static final long serialVersionUID = -1857741824849069317l; +/** + * Thrown on an attempt to lookup or unbind a registry name that has no + * associated binding. + * + * @author unknown + * @see Naming#lookup(String) + * @see Naming#unbind(String) + * @see Registry#lookup(String) + * @see Registry#unbind(String) + * @since 1.1 + * @status updated to 1.4 + */ +public class NotBoundException extends Exception +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -1857741824849069317l; -public NotBoundException() { - super(); -} - -public NotBoundException(String s) { - super (s); -} + /** + * Create an exception with no message. + */ + public NotBoundException() + { + } + /** + * Create an exception with a message. + * + * @param s the message + */ + public NotBoundException(String s) + { + super(s); + } } diff --git a/java/rmi/RMISecurityException.java b/java/rmi/RMISecurityException.java index 8f04fad5d..3697b7c95 100644 --- a/java/rmi/RMISecurityException.java +++ b/java/rmi/RMISecurityException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* RMISecurityException.java -- deprecated version of SecurityException + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,17 +37,41 @@ exception statement from your version. */ package java.rmi; -import java.lang.SecurityException; - -public class RMISecurityException - extends SecurityException { +/** + * Never thrown, but originally intended to wrap a java.lang.SecurityException. + * + * @author unknown + * @since 1.1 + * @deprecated use {@link SecurityException} instead + * @status updated to 1.4 + */ +public class RMISecurityException extends SecurityException +{ + /** + * Compatible with JDK 1.1. + */ + private static final long serialVersionUID = -8433406075740433514L; -public RMISecurityException(String n) { - super(n); -} - -public RMISecurityException(String n, String a) { - super(n); -} + /** + * Create an exception with a message. + * + * @param s the message + * @deprecated no longer needed + */ + public RMISecurityException(String n) + { + super(n); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + * @deprecated no longer needed + */ + public RMISecurityException(String n, String a) + { + super(n); + } } diff --git a/java/rmi/RemoteException.java b/java/rmi/RemoteException.java index 0e0d5e722..17e38b30b 100644 --- a/java/rmi/RemoteException.java +++ b/java/rmi/RemoteException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* RemoteException.java -- common superclass for exceptions in java.rmi + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,59 +37,91 @@ exception statement from your version. */ package java.rmi; -import java.lang.Throwable; import java.io.IOException; -import java.io.PrintStream; -import java.io.PrintWriter; - - -public class RemoteException - extends IOException { - -public static final long serialVersionUID = -5148567311918794206l; - -public Throwable detail; - -public RemoteException() { - super(); - detail = null; -} - -public RemoteException(String s) { - super(s); - detail = null; -} - -public RemoteException(String s, Throwable e) { - super(s); - detail = e; -} - -public String getMessage() { - if (detail == null) { - return (super.getMessage()); - } - else { - return (super.getMessage() + "; nested exception is: " + detail.getMessage()); - } -} - -public void printStackTrace(PrintStream s) { - if (detail != null) { - detail.printStackTrace(s); - } - super.printStackTrace(s); -} - -public void printStackTrace(PrintWriter s) { - if (detail != null) { - detail.printStackTrace(s); - } - super.printStackTrace(s); -} - -public void printStackTrace() { - printStackTrace(System.err); -} +/** + * The superclass of exceptions related to RMI (remote method invocation). + * Classes that implement <code>java.rmi.Remote</code> should list this + * exception in their throws clause. + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class RemoteException extends IOException +{ + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -5148567311918794206l; + + /** + * The cause of this exception. This pre-dates the exception chaining + * of Throwable; and although you can change this field, you are wiser + * to leave it alone. + * + * @serial the exception cause + */ + public Throwable detail; + + /** + * Create an exception with no message, and cause initialized to null. + */ + public RemoteException() + { + this(null, null); + } + + /** + * Create an exception with the given message, and cause initialized to null. + * + * @param s the message + */ + public RemoteException(String s) + { + this(s, null); + } + + /** + * Create an exception with the given message and cause. + * + * @param s the message + * @param ex the cause + */ + public RemoteException(String s, Throwable e) + { + super(s); + initCause(e); + detail = e; + } + + /** + * This method returns a message indicating what went wrong, in this + * format: + * <code>super.getMessage() + (detail == null ? "" + * : "; nested exception is:\n\t" + detail)<code>. + * + * @return the chained message + */ + public String getMessage() + { + if (detail == this || detail == null) + return super.getMessage(); + return super.getMessage() + "; nested exception is:\n\t" + detail; + } + + /** + * Returns the cause of this exception. Note that this may not be the + * original cause, thanks to the <code>detail</code> field being public + * and non-final (yuck). However, to avoid violating the contract of + * Throwable.getCause(), this returns null if <code>detail == this</code>, + * as no exception can be its own cause. + * + * @return the cause + * @since 1.4 + */ + public Throwable getCause() + { + return detail == this ? null : detail; + } } diff --git a/java/rmi/ServerError.java b/java/rmi/ServerError.java index e5e8147a4..59c6a55a4 100644 --- a/java/rmi/ServerError.java +++ b/java/rmi/ServerError.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ServerError.java -- wraps an error while creating the server + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,11 +37,28 @@ exception statement from your version. */ package java.rmi; -public class ServerError - extends RemoteException { - -public ServerError(String s, Error e) { - super(s, e); -} +/** + * Wraps any error thrown while processing the server of a remote call. + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class ServerError extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 8455284893909696482L; + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public ServerError(String s, Error e) + { + super(s, e); + } } diff --git a/java/rmi/ServerException.java b/java/rmi/ServerException.java index 2082c81c8..17c3a5790 100644 --- a/java/rmi/ServerException.java +++ b/java/rmi/ServerException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ServerException.java -- wraps an exception while creating the server + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,17 +37,38 @@ exception statement from your version. */ package java.rmi; -public class ServerException - extends RemoteException { - -public static final long serialVersionUID = -4775845313121906682l; +/** + * Wraps any exception thrown while processing the server of a remote call. + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class ServerException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -4775845313121906682l; -public ServerException(String s) { - super(s); -} - -public ServerException(String s, Exception e) { - super(s, e); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public ServerException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public ServerException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/ServerRuntimeException.java b/java/rmi/ServerRuntimeException.java index 9c2550e97..d7e11916a 100644 --- a/java/rmi/ServerRuntimeException.java +++ b/java/rmi/ServerRuntimeException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ServerRuntimeException.java -- wraps an exception while creating the server + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,11 +37,31 @@ exception statement from your version. */ package java.rmi; -public class ServerRuntimeException - extends RemoteException { - -public ServerRuntimeException(String s, Exception e) { - super(s, e); -} +/** + * Wraps any runtime exception thrown while processing the server of a + * remote call. Note, this exception is no longer used. + * + * @author unknown + * @since 1.1 + * @deprecated no replacement + * @status updated to 1.4 + */ +public class ServerRuntimeException extends RemoteException +{ + /** + * Compatible with JDK 1.1. + */ + private static final long serialVersionUID = 7054464920481467219L; + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + * @deprecated no longer needed + */ + public ServerRuntimeException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/StubNotFoundException.java b/java/rmi/StubNotFoundException.java index e6b384f7b..837153bca 100644 --- a/java/rmi/StubNotFoundException.java +++ b/java/rmi/StubNotFoundException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* StubNotFoundException.java -- thrown if a valid stub is not found + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,15 +37,41 @@ exception statement from your version. */ package java.rmi; -public class StubNotFoundException - extends RemoteException { +/** + * Thrown if a valid stub class is not found for an object when it is exported. + * + * @author unknown + * @see UnicastRemoteObject + * @see Activatable + * @since 1.1 + * @status updated to 1.4 + */ +public class StubNotFoundException extends RemoteException +{ + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -7088199405468872373L; -public StubNotFoundException(String s) { - super(s); -} -public StubNotFoundException(String s, Exception e) { - super(s, e); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public StubNotFoundException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public StubNotFoundException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/UnexpectedException.java b/java/rmi/UnexpectedException.java index 9cfddb457..42b6f15d5 100644 --- a/java/rmi/UnexpectedException.java +++ b/java/rmi/UnexpectedException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* UnexpectedException.java -- an unexpected checked exception was received + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,15 +37,39 @@ exception statement from your version. */ package java.rmi; -public class UnexpectedException - extends RemoteException { - -public UnexpectedException(String s) { - super(s); -} +/** + * Thrown if an unexpected checked exception was received in a remote + * procedure call. + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class UnexpectedException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 1800467484195073863L; -public UnexpectedException(String s, Exception e) { - super(s, e); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public UnexpectedException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public UnexpectedException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/UnknownHostException.java b/java/rmi/UnknownHostException.java index 9e3a95efe..089800c36 100644 --- a/java/rmi/UnknownHostException.java +++ b/java/rmi/UnknownHostException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* UnknownHostException.java -- wraps java.net.UnknownHostException in RMI + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,15 +37,39 @@ exception statement from your version. */ package java.rmi; -public class UnknownHostException - extends RemoteException { - -public UnknownHostException(String s) { - super(s); -} +/** + * Thrown if a java.net.UnknownHostException occurs during a remote + * procedure call. + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class UnknownHostException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -8152710247442114228L; -public UnknownHostException(String s, Exception e) { - super(s, e); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public UnknownHostException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public UnknownHostException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/UnmarshalException.java b/java/rmi/UnmarshalException.java index 78a3c629c..cff74a935 100644 --- a/java/rmi/UnmarshalException.java +++ b/java/rmi/UnmarshalException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* UnmarshalException.java -- wraps error while unmarshalling parameters + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,17 +37,52 @@ exception statement from your version. */ package java.rmi; -public class UnmarshalException - extends RemoteException { - -public static final long serialVersionUID = 594380845140740218l; +/** + * Thrown if an exception occurs while unmarshalling parameters or results + * of a remote method call. This includes:<br><ul> + * <li>if an exception occurs while unmarshalling the call header</li> + * <li>if the protocol for the return value is invalid</li> + * <li>if a java.io.IOException occurs unmarshalling parameters (on the + * server side) or the return value (on the client side).</li> + * <li>if a java.lang.ClassNotFoundException occurs during unmarshalling + * parameters or return values</li> + * <li>if no skeleton can be loaded on the server-side; note that skeletons + * are required in the 1.1 stub protocol, but not in the 1.2 stub + * protocol.</li> + * <li>if the method hash is invalid (i.e., missing method).</li> + * <li>if there is a failure to create a remote reference object for a remote + * object's stub when it is unmarshalled.</li> + * </ul> + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class UnmarshalException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 594380845140740218l; -public UnmarshalException(String s) { - super(s); -} - -public UnmarshalException(String s, Exception e) { - super(s, e); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public UnmarshalException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public UnmarshalException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/activation/ActivateFailedException.java b/java/rmi/activation/ActivateFailedException.java index 3b107d55d..02d764c6c 100644 --- a/java/rmi/activation/ActivateFailedException.java +++ b/java/rmi/activation/ActivateFailedException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ActivateFailedException.java -- thrown when activation fails + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,15 +39,38 @@ package java.rmi.activation; import java.rmi.RemoteException; -public class ActivateFailedException - extends RemoteException { - -public ActivateFailedException(String s) { - super(s); -} +/** + * Thrown when activation fails on a remote call to an activatable object. + * + * @author unknown + * @since 1.2 + * @status updated to 1.4 + */ +public class ActivateFailedException extends RemoteException +{ + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 4863550261346652506L; -public ActivateFailedException(String s, Exception ex) { - super(s, ex); -} + /** + * Create an exception with a message. + * + * @param s the message + */ + public ActivateFailedException(String s) + { + super(s); + } + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param ex the cause + */ + public ActivateFailedException(String s, Exception ex) + { + super(s, ex); + } } diff --git a/java/rmi/activation/ActivationException.java b/java/rmi/activation/ActivationException.java index 8734ab4f4..a1ac7bd6a 100644 --- a/java/rmi/activation/ActivationException.java +++ b/java/rmi/activation/ActivationException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ActivationException.java -- general Activation exception + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,52 +37,86 @@ exception statement from your version. */ package java.rmi.activation; -import java.io.PrintStream; -import java.io.PrintWriter; - -public class ActivationException - extends Exception { - -public Throwable detail; - -public ActivationException() { - super(); -} - -public ActivationException(String s) { - super(s); -} - -public ActivationException(String s, Throwable ex) { - super(s); - detail = ex; -} - -public String getMessage() { - if (detail == null) { - return (super.getMessage()); - } - else { - return (super.getMessage() + ":" + detail.getMessage()); - } -} - -public void printStackTrace(PrintStream s) { - if (detail != null) { - detail.printStackTrace(s); - } - super.printStackTrace(s); -} - -public void printStackTrace() { - printStackTrace(System.err); -} - -public void printStackTrace(PrintWriter s) { - if (detail != null) { - detail.printStackTrace(s); - } - super.printStackTrace(s); -} - +/** + * General exception class for <code>java.rmi.activation</code>. + * + * @author unknown + * @since 1.2 + * @status updated to 1.4 + */ +public class ActivationException extends Exception +{ + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -4320118837291406071L; + + /** + * The cause of this exception. This pre-dates the exception chaining + * of Throwable; and although you can change this field, you are wiser + * to leave it alone. + * + * @serial the exception cause + */ + public Throwable detail; + + /** + * Create an exception with no message, and cause initialized to null. + */ + public ActivationException() + { + this(null, null); + } + + /** + * Create an exception with the given message, and cause initialized to null. + * + * @param s the message + */ + public ActivationException(String s) + { + this(s, null); + } + + /** + * Create an exception with the given message and cause. + * + * @param s the message + * @param ex the cause + */ + public ActivationException(String s, Throwable ex) + { + super(s, ex); + detail = ex; + } + + /** + * This method returns a message indicating what went wrong, in this + * format: + * <code>super.getMessage() + (detail == null ? "" + * : "; nested exception is:\n\t" + detail)<code>. + * + * @return the chained message + */ + public String getMessage() + { + if (detail == this || detail == null) + return super.getMessage(); + return super.getMessage() + "; nested exception is:\n\t" + detail; + } + + /** + * Returns the cause of this exception. Note that this may not be the + * original cause, thanks to the <code>detail</code> field being public + * and non-final (yuck). However, to avoid violating the contract of + * Throwable.getCause(), this returns null if <code>detail == this</code>, + * as no exception can be its own cause. + * + * @return the cause + * @since 1.4 + */ + public Throwable getCause() + { + return detail == this ? null : detail; + } } diff --git a/java/rmi/activation/UnknownGroupException.java b/java/rmi/activation/UnknownGroupException.java index b9a5cbca8..b53e8c28e 100644 --- a/java/rmi/activation/UnknownGroupException.java +++ b/java/rmi/activation/UnknownGroupException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* UnknownGroupException.java -- thrown on an invalid ActivationGroupID + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -37,11 +37,33 @@ exception statement from your version. */ package java.rmi.activation; -public class UnknownGroupException - extends ActivationException { - -public UnknownGroupException(String s) { - super(s); -} +/** + * Thrown when an <code>ActivationGroupID</code> parameter is invalid or + * unknown. + * + * @author unknown + * @see Activatable + * @see ActivationGroup + * @see ActivationID + * @see ActivationMonitor + * @see ActivationSystem + * @since 1.2 + * @status updated to 1.4 + */ +public class UnknownGroupException extends ActivationException +{ + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 7056094974750002460L; + /** + * Create an exception with a message. + * + * @param s the message + */ + public UnknownGroupException(String s) + { + super(s); + } } diff --git a/java/rmi/activation/UnknownObjectException.java b/java/rmi/activation/UnknownObjectException.java index 8dfdd216c..81e3871ad 100644 --- a/java/rmi/activation/UnknownObjectException.java +++ b/java/rmi/activation/UnknownObjectException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* UnknownObjectException.java -- thrown on an invalid ActivationID + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,11 +37,33 @@ exception statement from your version. */ package java.rmi.activation; -public class UnknownObjectException - extends ActivationException { - -public UnknownObjectException(String s) { - super(s); -} +/** + * Thrown when an <code>ActivationID</code> parameter is invalid or unknown. + * + * @author unknown + * @see Activatable + * @see ActivationGroup + * @see ActivationID + * @see ActivationMonitor + * @see ActivationSystem + * @see Activator + * @since 1.2 + * @status updated to 1.4 + */ +public class UnknownObjectException extends ActivationException +{ + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 3425547551622251430L; + /** + * Create an exception with an error message. + * + * @param s the message + */ + public UnknownObjectException(String s) + { + super(s); + } } diff --git a/java/rmi/server/ExportException.java b/java/rmi/server/ExportException.java index 7bb8f1644..20e565c73 100644 --- a/java/rmi/server/ExportException.java +++ b/java/rmi/server/ExportException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ExportException.java -- an export attempt failed + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,15 +39,40 @@ package java.rmi.server; import java.rmi.RemoteException; -public class ExportException - extends RemoteException { - -public ExportException(String s) { - super(s); -} +/** + * Thrown if an attempt to export a remote object fails. + * + * @author unknown + * @see UnicastRemoteObject + * @see Activatable + * @since 1.1 + * @status updated to 1.4 + */ +public class ExportException extends RemoteException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -9155485338494060170L; -public ExportException(String s, Exception e) { - super(s, e); -} + /** + * Create an exception with the specified message. + * + * @param s the message + */ + public ExportException(String s) + { + super(s); + } + /** + * Create an exception with the specified message and cause. + * + * @param s the message + * @param e the cause + */ + public ExportException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/server/ServerCloneException.java b/java/rmi/server/ServerCloneException.java index 77cc1b376..faf43c8e2 100644 --- a/java/rmi/server/ServerCloneException.java +++ b/java/rmi/server/ServerCloneException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ServerCloneException.java -- a UnicastRemoteObject could not be cloned + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,50 +37,81 @@ exception statement from your version. */ package java.rmi.server; -import java.lang.CloneNotSupportedException; -import java.io.PrintStream; -import java.io.PrintWriter; - -public class ServerCloneException - extends CloneNotSupportedException { - -public Exception detail; - -public ServerCloneException(String s) { - super(s); - detail = null; -} - -public ServerCloneException(String s, Exception e) { - super(s); - detail = e; -} - -public String getMessage() { - if (detail != null) { - return (super.getMessage() + ":" + detail.getMessage()); - } - else { - return (super.getMessage()); - } -} - -public void printStackTrace(PrintStream s) { - if (detail != null) { - detail.printStackTrace(s); - } - super.printStackTrace(s); -} - -public void printStackTrace() { - printStackTrace(System.err); -} - -public void printStackTrace(PrintWriter s) { - if (detail != null) { - detail.printStackTrace(s); - } - super.printStackTrace(s); -} - +/** + * Thrown if a remote exception occurs during the cloning process of a + * <code>UnicastRemoteObject</code>. + * + * @author unknown + * @see UnicastRemoteObject#clone() + * @since 1.1 + * @status updated to 1.4 + */ +public class ServerCloneException extends CloneNotSupportedException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 6617456357664815945L; + + /** + * The cause of this exception. This pre-dates the exception chaining + * of Throwable; and although you can change this field, you are wiser + * to leave it alone. + * + * @serial the exception cause + */ + public Exception detail; + + /** + * Create an exception with a message. + * + * @param s the message + */ + public ServerCloneException(String s) + { + this(s, null); + } + + /** + * Create an exception with a message and a cause. + * + * @param s the message + * @param e the cause + */ + public ServerCloneException(String s, Exception e) + { + super(s); + initCause(e); + detail = e; + } + + /** + * This method returns a message indicating what went wrong, in this + * format: + * <code>super.getMessage() + (detail == null ? "" + * : "; nested exception is:\n\t" + detail)<code>. + * + * @return the chained message + */ + public String getMessage() + { + if (detail == this || detail == null) + return super.getMessage(); + return super.getMessage() + "; nested exception is:\n\t" + detail; + } + + /** + * Returns the cause of this exception. Note that this may not be the + * original cause, thanks to the <code>detail</code> field being public + * and non-final (yuck). However, to avoid violating the contract of + * Throwable.getCause(), this returns null if <code>detail == this</code>, + * as no exception can be its own cause. + * + * @return the cause + * @since 1.4 + */ + public Throwable getCause() + { + return detail == this ? null : detail; + } } diff --git a/java/rmi/server/ServerNotActiveException.java b/java/rmi/server/ServerNotActiveException.java index 18c8e76bd..426d5e325 100644 --- a/java/rmi/server/ServerNotActiveException.java +++ b/java/rmi/server/ServerNotActiveException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* ServerNotActiveException.java -- the method is not servicing a remote call + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,17 +37,36 @@ exception statement from your version. */ package java.rmi.server; -import java.lang.Exception; - -public class ServerNotActiveException - extends Exception { +/** + * Thrown during <code>RemoteServer.getClientHost</code> if the host is + * not servicing a remote method call. + * + * @author unknown + * @see RemoteServer#getClientHost() + * @since 1.1 + * @status updated to 1.4 + */ +public class ServerNotActiveException extends Exception +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 4687940720827538231L; -public ServerNotActiveException() { - super(); -} - -public ServerNotActiveException(String s) { - super(s); -} + /** + * Create an exception with no message. + */ + public ServerNotActiveException() + { + } + /** + * Create an exception with a message. + * + * @param s the message + */ + public ServerNotActiveException(String s) + { + super(s); + } } diff --git a/java/rmi/server/SkeletonMismatchException.java b/java/rmi/server/SkeletonMismatchException.java index 9d6986a58..5a4b6ae96 100644 --- a/java/rmi/server/SkeletonMismatchException.java +++ b/java/rmi/server/SkeletonMismatchException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* SkeletonMismatchException.java -- thrown when stub class versions mismatch + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,13 +39,30 @@ package java.rmi.server; import java.rmi.RemoteException; -public class SkeletonMismatchException - extends RemoteException { - -public static final long serialVersionUID = -7780460454818859281l; - -public SkeletonMismatchException(String s) { - super(s); -} +/** + * Thrown if a call is received that does not match a Skeleton. Note that + * Skeletons are no longer required. + * + * @author unknown + * @since 1.1 + * @deprecated no replacement. Skeletons are no longer required. + * @status updated to 1.4 + */ +public class SkeletonMismatchException extends RemoteException +{ + /** + * Compatible with JDK 1.1. + */ + private static final long serialVersionUID = -7780460454818859281l; + /** + * Create an exception with the specified message. + * + * @param s the message + * @deprecated no longer needed + */ + public SkeletonMismatchException(String s) + { + super(s); + } } diff --git a/java/rmi/server/SkeletonNotFoundException.java b/java/rmi/server/SkeletonNotFoundException.java index 5c4fb4b83..41819d938 100644 --- a/java/rmi/server/SkeletonNotFoundException.java +++ b/java/rmi/server/SkeletonNotFoundException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* SkeletonNotFoundException.java -- thrown if a Skeleton is not found + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,15 +39,42 @@ package java.rmi.server; import java.rmi.RemoteException; -public class SkeletonNotFoundException - extends RemoteException { - -public SkeletonNotFoundException(String s) { - super(s); -} +/** + * Thrown if a Skeleton corresponding to the remote object is not found. + * Note that Skeletons are no longer required. + * + * @author unknown + * @since 1.1 + * @deprecated no replacement. Skeletons are no longer required. + * @status updated to 1.4 + */ +public class SkeletonNotFoundException extends RemoteException +{ + /** + * Compatible with JDK 1.1. + */ + private static final long serialVersionUID = -7860299673822761231L; -public SkeletonNotFoundException(String s, Exception e) { - super(s, e); -} + /** + * Create an exception with the specified message. + * + * @param s the message + * @deprecated no longer needed + */ + public SkeletonNotFoundException(String s) + { + super(s); + } + /** + * Create an exception with the specified message and cause. + * + * @param s the message + * @param e the cause + * @deprecated no longer needed + */ + public SkeletonNotFoundException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/rmi/server/SocketSecurityException.java b/java/rmi/server/SocketSecurityException.java index fbd36afdf..314ad8784 100644 --- a/java/rmi/server/SocketSecurityException.java +++ b/java/rmi/server/SocketSecurityException.java @@ -1,5 +1,5 @@ -/* - Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* SocketSecurityException.java -- the socket could not be created + Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,17 +37,39 @@ exception statement from your version. */ package java.rmi.server; -import java.rmi.server.ExportException; - -public class SocketSecurityException - extends ExportException { +/** + * Thrown during remote object export if the code does not have permission + * to create a <code>java.net.ServerSocket</code> on the specified port. + * + * @author unknown + * @since 1.1 + * @status updated to 1.4 + */ +public class SocketSecurityException extends ExportException +{ + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -7622072999407781979L; -public SocketSecurityException(String s) { - super(s); -} - -public SocketSecurityException(String s, Exception e) { - super(s, e); -} + /** + * Create an exception with the specified message. + * + * @param s the message + */ + public SocketSecurityException(String s) + { + super(s); + } + /** + * Create an exception with the specified message and cause. + * + * @param s the message + * @param e the cause + */ + public SocketSecurityException(String s, Exception e) + { + super(s, e); + } } diff --git a/java/security/AccessControlException.java b/java/security/AccessControlException.java index 11c7d6884..ff8b5a93f 100644 --- a/java/security/AccessControlException.java +++ b/java/security/AccessControlException.java @@ -1,5 +1,5 @@ /* AccessControlException.java -- Permission is denied - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -39,38 +39,44 @@ package java.security; /** * This exception is thrown when the <code>AccessController</code> denies - * an attempt to perform an operation. + * an attempt to perform an operation. This often keeps track of the + * permission that was not granted. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @see AccessController + * @status updated to 1.4 */ public class AccessControlException extends SecurityException { /** - * The <code>Permission</code> associated with this exception + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 5138225684096988535L; + + /** + * The <code>Permission</code> associated with this exception. + * + * @serial the permission */ - private Permission perm; + private final Permission perm; /** - * This method initializes a new instance of <code>AccessControlException</code> - * with a descriptive error message. There will be no <code>Permission</code> - * object associated with this exception. + * Create a new instance with a descriptive error message, and a null + * <code>Permission</code> object. * - * @param msg The descriptive error message + * @param msg the descriptive error message */ public AccessControlException(String msg) { - super(msg); + this(msg, null); } /** - * This method initializes a new instance of <code>AccessControlException</code> - * with a descriptive error message and an instance of <code>Permission</code> - * that is the permission that caused the exception to be thrown. + * Create a new instance with a descriptive error message and an associated + * <code>Permission</code> object. * - * @param msg The descriptive error message - * @param perm The <code>Permission</code> object that caused this exception. + * @param msg the descriptive error message + * @param perm the permission that caused this */ public AccessControlException(String msg, Permission perm) { @@ -82,10 +88,10 @@ public class AccessControlException extends SecurityException * This method returns the <code>Permission</code> object that caused * this exception to be thrown. * - * @return The requested <code>Permission</code> object, or <code>null</code> if none is available. + * @return the denied permission, or null */ public Permission getPermission() { - return (perm); + return perm; } } diff --git a/java/security/DigestException.java b/java/security/DigestException.java index c28c99dc3..f5c8d627d 100644 --- a/java/security/DigestException.java +++ b/java/security/DigestException.java @@ -1,5 +1,5 @@ /* DigestException.java -- A generic message digest exception - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,29 +38,30 @@ exception statement from your version. */ package java.security; /** - * This exception indicates that a generic message digest exception has + * This exception indicates that a generic message digest exception has * occurred. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 */ public class DigestException extends GeneralSecurityException { /** - * This method initializes a new <code>DigestException</code> with no - * descriptive message. + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 5821450303093652515L; + + /** + * Create a new instance with no descriptive message. */ public DigestException() { - super(); } /** - * This method initializes a new instance of <code>DigestException</code> - * with a descriptive error message. + * Create a new instance with a descriptive error message. * - * @param msg The descriptive message + * @param msg the descriptive message */ public DigestException(String msg) { diff --git a/java/security/GeneralSecurityException.java b/java/security/GeneralSecurityException.java index a41a980f7..d1db3c5d6 100644 --- a/java/security/GeneralSecurityException.java +++ b/java/security/GeneralSecurityException.java @@ -1,5 +1,5 @@ /* GeneralSecurityException.java -- Common superclass of security exceptions - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,31 +41,32 @@ package java.security; * This class is the common superclass of all security exceptions. All * exceptions in java.security extend this class with the exception (no * pun intended) of <code>AccessControlException</code> and - * <code>CertificateException</code> which extend <code>SecurityException</code> - * and <code>ProviderException</code> which extens <code>RuntimeException</code>. - * and <code>InvalidParamterException</code> which extends - * <code>IllegalArgumentException</code>. + * <code>CertificateException</code> (which extend + * <code>SecurityException</code>), <code>ProviderException</code> + * (<code>RuntimeException</code>), and <code>InvalidParamterException</code> + * (<code>IllegalArgumentException</code>). * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 */ public class GeneralSecurityException extends Exception { /** - * This method initializes a new instance of <code>GeneralSecurityException</code> - * with no descriptive error message. + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 894798122053539237L; + + /** + * Create a new instance with no descriptive error message. */ public GeneralSecurityException() { - super(); } /** - * This method initializes a new instance of <code>GeneralSecurityException</code> - * with a descriptive error message. + * Create a new instance with a descriptive error message. * - * @param msg The descriptive error message. + * @param msg the descriptive error message */ public GeneralSecurityException(String msg) { diff --git a/java/security/InvalidAlgorithmParameterException.java b/java/security/InvalidAlgorithmParameterException.java index a3b041a67..40f953079 100644 --- a/java/security/InvalidAlgorithmParameterException.java +++ b/java/security/InvalidAlgorithmParameterException.java @@ -1,5 +1,6 @@ -/* InvalidAlgorithmParameterException.java - Copyright (C) 2000 Free Software Foundation, Inc. +/* InvalidAlgorithmParameterException.java -- an invalid parameter to a + security algorithm + Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,23 +39,33 @@ exception statement from your version. */ package java.security; /** + * Thrown for an invalid security algorithm parameter. + * * @author Warren Levy <warrenl@cygnus.com> - * @date February 2, 2000. + * @since 1.2 + * @status updated to 1.4 */ - -/** - * Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. - */ - -// JDK1.2 -public class InvalidAlgorithmParameterException extends GeneralSecurityException +public class InvalidAlgorithmParameterException + extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 2864672297499471472L; + + /** + * Construct an exception with no message. + */ public InvalidAlgorithmParameterException() { super(); } + /** + * Construct an exception with a message. + * + * @param msg the message + */ public InvalidAlgorithmParameterException(String msg) { super(msg); diff --git a/java/security/InvalidKeyException.java b/java/security/InvalidKeyException.java index bcf1ee1ba..373e8625a 100644 --- a/java/security/InvalidKeyException.java +++ b/java/security/InvalidKeyException.java @@ -1,4 +1,5 @@ -/* Copyright (C) 2000 Free Software Foundation +/* InvalidKeyException -- thrown for an invalid key + Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. @@ -37,22 +38,30 @@ exception statement from your version. */ package java.security; /** + * Thrown for an invalid key. + * * @author Warren Levy <warrenl@cygnus.com> - * @date February 1, 2000. + * @status updated to 1.4 */ - -/** - * Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. - */ - public class InvalidKeyException extends KeyException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 5698479920593359816L; + + /** + * Construct an exception with no message. + */ public InvalidKeyException() { - super(); } + /** + * Construct an exception with a message. + * + * @param msg the message + */ public InvalidKeyException(String msg) { super(msg); diff --git a/java/security/InvalidParameterException.java b/java/security/InvalidParameterException.java index 574772262..220899197 100644 --- a/java/security/InvalidParameterException.java +++ b/java/security/InvalidParameterException.java @@ -1,4 +1,5 @@ -/* Copyright (C) 2000 Free Software Foundation +/* InvalidParameterException.java -- an invalid parameter in the JCA/JCE engine + Copyright (C) 2000, 2002 Free Software Foundation This file is part of GNU Classpath. @@ -37,22 +38,31 @@ exception statement from your version. */ package java.security; /** + * Thrown when an invalid parameter is passed to a method of the JCA/JCE + * engine classes. + * * @author Warren Levy <warrenl@cygnus.com> - * @date February 1, 2000. + * @status updated to 1.4 */ - -/** - * Written using on-line Java Platform 1.2 API Specification. - * Status: Believed complete and correct. - */ - public class InvalidParameterException extends IllegalArgumentException { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -857968536935667808L; + + /** + * Construct an exception with no message. + */ public InvalidParameterException() { - super(); } + /** + * Construct an exception with a message. + * + * @param msg the message + */ public InvalidParameterException(String msg) { super(msg); diff --git a/java/security/KeyException.java b/java/security/KeyException.java index fbc7c699a..3b7d3886e 100644 --- a/java/security/KeyException.java +++ b/java/security/KeyException.java @@ -1,5 +1,5 @@ /* KeyException.java -- Thrown when there is a problem with a key - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -40,26 +40,30 @@ package java.security; /** * This exception is thrown when there is a problem with a key. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @see Key + * @status updated to 1.4 */ public class KeyException extends GeneralSecurityException { /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -7483676942812432108L; + + /** * This method initializes a new instance of <code>KeyException</code> * with no descriptive message. */ public KeyException() { - super(); } /** * This method initializes a new instance of <code>KeyException</code> * with a descriptive message. * - * @param msg The descriptive message. + * @param msg the descriptive message */ public KeyException(String msg) { diff --git a/java/security/KeyManagementException.java b/java/security/KeyManagementException.java index ef50e3258..52c278629 100644 --- a/java/security/KeyManagementException.java +++ b/java/security/KeyManagementException.java @@ -1,5 +1,5 @@ -/* KeyManagementException.java -- What it says - Copyright (C) 1998 Free Software Foundation, Inc. +/* KeyManagementException.java -- an exception in key management + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,29 +38,31 @@ exception statement from your version. */ package java.security; /** - * This exception is thrown whenever a problem related to the management of - * security keys is encountered. - * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * This exception is thrown whenever a problem related to the management of + * security keys is encountered. + * + * @author Aaron M. Renn <arenn@urbanophile.com> + * @see Key + * @status updated to 1.4 */ public class KeyManagementException extends KeyException { /** - * This method initializes a new instance of <code>KeyManagementException</code> - * with no descriptive error message. + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 947674216157062695L; + + /** + * Create a new instance with no descriptive error message. */ public KeyManagementException() { - super(); } /** - * This method initializes a new instance of <code>KeyManagementException</code> - * with a descriptive error message. + * Create a new instance with a descriptive error message. * - * @param msg The descriptive error message + * @param msg the descriptive error message */ public KeyManagementException(String msg) { diff --git a/java/security/KeyStoreException.java b/java/security/KeyStoreException.java index 39755a07c..369587a59 100644 --- a/java/security/KeyStoreException.java +++ b/java/security/KeyStoreException.java @@ -1,5 +1,5 @@ /* KeyStoreException.java -- Indicates a problem with the key store - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -40,26 +40,28 @@ package java.security; /** * Indicates a problem with the key store. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @since 1.2 + * @status updated to 1.4 */ public class KeyStoreException extends GeneralSecurityException { /** - * This method initializes a new <code>KeyStoreException</code> with no - * detailed error message. + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -1119353179322377262L; + + /** + * Create a new instance detailed error message. */ public KeyStoreException() { - super(); } /** - * This method initializes a new <code>KeyStoreException</code> with a - * detailed error message. + * Create a new instance with a detailed error message. * - * @param msg The descriptive error message. + * @param msg the descriptive error message */ public KeyStoreException(String msg) { diff --git a/java/security/NoSuchAlgorithmException.java b/java/security/NoSuchAlgorithmException.java index 41e3a5095..31e00537a 100644 --- a/java/security/NoSuchAlgorithmException.java +++ b/java/security/NoSuchAlgorithmException.java @@ -1,5 +1,5 @@ -/* NoSuchAlgorithmException.java -- What it says - Copyright (C) 1998 Free Software Foundation, Inc. +/* NoSuchAlgorithmException.java -- an algorithm was not available + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,26 +41,27 @@ package java.security; * This exception is thrown when the requested security algorithm is * not available * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 */ public class NoSuchAlgorithmException extends GeneralSecurityException { /** - * This method initializes a new instance of <code>NoSuchAlgorithmException</code> - * with no descriptive error message. + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -7443947487218346562L; + + /** + * Create a new instance with no descriptive error message. */ public NoSuchAlgorithmException() { - super(); } /** - * This method initializes a new instance of <code>NoSuchAlgorithmException</code> - * with a descriptive error message. + * Create a new instance with a descriptive error message. * - * @param msg The descriptive error message + * @param msg the descriptive error message */ public NoSuchAlgorithmException(String msg) { diff --git a/java/security/NoSuchProviderException.java b/java/security/NoSuchProviderException.java index 130cf644b..546b2dc61 100644 --- a/java/security/NoSuchProviderException.java +++ b/java/security/NoSuchProviderException.java @@ -1,5 +1,5 @@ -/* NoSuchProviderException.java -- What it says - Copyright (C) 1998 Free Software Foundation, Inc. +/* NoSuchProviderException.java -- thrown when a provider is not found + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,26 +41,27 @@ package java.security; * This exception is thrown when the requested security provider is * not available. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 */ public class NoSuchProviderException extends GeneralSecurityException { /** - * This method initializes a new instance of <code>NoSuchProviderException</code> - * with no descriptive error message. + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 8488111756688534474L; + + /** + * Create a new instance with no descriptive error message. */ public NoSuchProviderException() { - super(); } /** - * This method initializes a new instance of <code>NoSuchProviderException</code> - * with a descriptive error message. + * Create a new instance with a descriptive error message. * - * @param msg The descriptive error message. + * @param msg the descriptive error message */ public NoSuchProviderException(String msg) { diff --git a/java/security/PrivilegedActionException.java b/java/security/PrivilegedActionException.java index 270bcebc6..633a872cf 100644 --- a/java/security/PrivilegedActionException.java +++ b/java/security/PrivilegedActionException.java @@ -1,6 +1,5 @@ -/* PrivilegedActionException.java -- An exception occurred in a - privileged action. - Copyright (C) 1998 Free Software Foundation, Inc. +/* PrivilegedActionException.java -- wrap an exception in a privileged action + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,76 +37,73 @@ exception statement from your version. */ package java.security; -import java.io.PrintStream; -import java.io.PrintWriter; - /** * This exception is thrown when an exception is thrown during a - * privileged action being performed with the - * <code>AccessController.doPrivileged()</code> method. It wrappers the + * privileged action being performed with the + * <code>AccessController.doPrivileged()</code> method. It wraps the * actual exception thrown in the privileged code. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @author Eric Blake <ebb9@email.byu.edu> + * @see PrivilegedExceptionAction + * @see AccessController#doPrivileged(PrivilegedExceptionAction) + * @see AccessController#doPrivileged(PrivilegedExceptionAction, AccessControlContext) + * @status updated to 1.4 */ public class PrivilegedActionException extends Exception { - /** - * This is the actual exception that occurred + * Compatible with JDK 1.1+. */ - private Exception e; + private static final long serialVersionUID = 4724086851538908602L; /** - * This method initializes a new instance of <code>PrivilegedActionException</code> - * that wrappers the specified <code>Exception</code>. + * This is the actual exception that occurred. * - * @param e The <code>Exception</code> to wrapper + * @serial the wrapped exception */ - public PrivilegedActionException(Exception e) - { - this.e = e; - } + private Exception exception; /** - * This method returns the underlying <code>Exception</code> that caused - * this exception to be raised. + * Create a new instance that wraps the specified <code>Exception</code>. * - * @return The wrappered <code>Exception</code>. + * @param e the <code>Exception</code> to wrap */ - public Exception getException() + public PrivilegedActionException(Exception e) { - return (e); + super(e); + exception = e; } /** - * This method prints the stack trace of the wrappered exception. + * Get the underlying <code>Exception</code> that caused this one. This + * is a legacy method, the preferred way is {@link #getCause()}. + * + * @return the cause */ - public void printStackTrace() + public Exception getException() { - e.printStackTrace(); + return exception; } /** - * This method prints the stack trace of the wrappered exception to the - * specified <code>PrintStream</code>. + * Gets the cause of this exception. * - * @param ps The <code>PrintStream</code> to print the stack trace to. + * @return the cause + * @since 1.4 */ - public void printStackTrace(PrintStream ps) + public Throwable getCause() { - e.printStackTrace(ps); + return exception; } /** - * This method prints the stack trace of the wrappered exception to the - * specified <code>PrintWriter</code>. + * Convert this to a String. * - * @param pw The <code>PrintWriter</code> to print the stack trace to. + * @return the string representation */ - public void printStackTrace(PrintWriter pw) + public String toString() { - e.printStackTrace(pw); + return super.toString(); } } diff --git a/java/security/ProviderException.java b/java/security/ProviderException.java index ea077c58e..eac3eb064 100644 --- a/java/security/ProviderException.java +++ b/java/security/ProviderException.java @@ -1,5 +1,5 @@ /* ProviderException.java -- Generic security provider runtime exception - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,26 +41,27 @@ package java.security; * This exception indicates that a runtime problem was encounterd with * a security provider. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 */ public class ProviderException extends RuntimeException { /** - * This method initializes a new instance of <code>ProviderException</code> - * with no descriptive error message. + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 5256023526693665674L; + + /** + * Create an instance with no descriptive error message. */ public ProviderException() { - super(); } /** - * This method initializes a new instance of <code>ProviderException</code> - * with a descriptive error message. + * Create an instance with a descriptive error message. * - * @param msg The descriptive error message. + * @param msg the descriptive error message */ public ProviderException(String msg) { diff --git a/java/security/SignatureException.java b/java/security/SignatureException.java index 7b48cb579..8762b0683 100644 --- a/java/security/SignatureException.java +++ b/java/security/SignatureException.java @@ -1,5 +1,5 @@ /* SignatureException.java -- Generic error in signature - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,24 +41,27 @@ package java.security; * This exception is thrown when a problem is encountered with a * digital signature. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 */ public class SignatureException extends GeneralSecurityException { /** - * This method initializes a new instance of <code>SignatureException</code> - * with no descriptive error message. + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 7509989324975124438L; + + /** + * Create an instance with no descriptive error message. */ public SignatureException() { - super(); } /** - * This method initializes a new instance of <code>SignatureException</code> - * with a descriptive error message. + * Create an instance with a descriptive error message. + * + * @param msg the message */ public SignatureException(String msg) { diff --git a/java/security/UnrecoverableKeyException.java b/java/security/UnrecoverableKeyException.java index 539c04f8a..3e93153ad 100644 --- a/java/security/UnrecoverableKeyException.java +++ b/java/security/UnrecoverableKeyException.java @@ -1,5 +1,5 @@ /* UnrecoverableKeyException.java -- Cannot recover a key from the key store - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,26 +41,28 @@ package java.security; * This exception is thrown when a key cannot be recovered from the key * store. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @since 1.2 + * @status updated to 1.4 */ public class UnrecoverableKeyException extends GeneralSecurityException { /** - * This method initializes a new instance of <code>UnrecoverableKeyException</code> - * with no descriptive error message. + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 7275063078190151277L; + + /** + * Create an instance with no descriptive error message. */ public UnrecoverableKeyException() { - super(); } /** - * This method initializes a new instance of <code>UnrecoverableKeyException</code> - * with a descriptive error message. + * Create an instance with a descriptive error message. * - * @param msg The descriptive error message. + * @param msg the descriptive error message */ public UnrecoverableKeyException(String msg) { diff --git a/java/security/acl/AclNotFoundException.java b/java/security/acl/AclNotFoundException.java index 4a234b987..a843fac17 100644 --- a/java/security/acl/AclNotFoundException.java +++ b/java/security/acl/AclNotFoundException.java @@ -1,5 +1,5 @@ -/* AclNotFoundException.java -- What it says - Copyright (C) 1998 Free Software Foundation, Inc. +/* AclNotFoundException.java -- thrown when an ACL is not found + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,17 +41,20 @@ package java.security.acl; * This exception is thrown when a requested access control list (ACL) is * not found. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 */ public class AclNotFoundException extends Exception { /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 5684295034092681791L; + + /** * Initializes a new instance of this class with no descriptive message */ public AclNotFoundException() { - super(); } } diff --git a/java/security/acl/LastOwnerException.java b/java/security/acl/LastOwnerException.java index 6eb0ace40..be2815192 100644 --- a/java/security/acl/LastOwnerException.java +++ b/java/security/acl/LastOwnerException.java @@ -1,5 +1,5 @@ /* LastOwnerException.java -- User attempted to delete last ACL owner - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,18 +41,22 @@ package java.security.acl; * This exception is thrown when an attempt is made to delete the last owner * of an access control list (ACL) * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @see Owner#deleteOwner(java.security.Principal, java.security.Principal) + * @status updated to 1.4 */ -public class LastOwnerException extends java.lang.Exception +public class LastOwnerException extends Exception { /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -5141997548211140359L; + + /** * Initialize a new instance of <code>LastOwnerException</code> that does * not have a log message. */ public LastOwnerException() { - super(); } } diff --git a/java/security/acl/NotOwnerException.java b/java/security/acl/NotOwnerException.java index b17ac651b..8b2739d9c 100644 --- a/java/security/acl/NotOwnerException.java +++ b/java/security/acl/NotOwnerException.java @@ -1,5 +1,5 @@ /* NotOwnerException.java -- Attempt to modify an unowned ACL - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -42,12 +42,15 @@ package java.security.acl; * the caller to be the owner of the access control list (ACL) when the caller * is in fact not the owner of the ACL. * - * @version 0.0 - * - * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Aaron M. Renn <arenn@urbanophile.com> + * @status updated to 1.4 */ -public class NotOwnerException extends java.lang.Exception +public class NotOwnerException extends Exception { + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = -5555597911163362399L; /** * Initializes a new instance of <code>NotOwnerException</code> that does @@ -55,6 +58,5 @@ public class NotOwnerException extends java.lang.Exception */ public NotOwnerException() { - super(); } } diff --git a/java/security/cert/CRLException.java b/java/security/cert/CRLException.java index 7aee1fb7e..be20d1b6c 100644 --- a/java/security/cert/CRLException.java +++ b/java/security/cert/CRLException.java @@ -1,5 +1,5 @@ -/* CRLException.java --- Certificate Revocation List Exception - Copyright (C) 1999 Free Software Foundation, Inc. +/* CRLException.java -- Certificate Revocation List Exception + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,34 +37,37 @@ exception statement from your version. */ package java.security.cert; + import java.security.GeneralSecurityException; /** - Exception for a Certificate Revocation List. - - @since JDK 1.2 - - @author Mark Benvenuto + * Exception for a Certificate Revocation List. + * + * @author Mark Benvenuto + * @since 1.2 + * @status updated to 1.4 */ public class CRLException extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -6694728944094197147L; /** - Constructs an CRLExceptionwithout a message string. - */ + * Constructs an CRLExceptionwithout a message string. + */ public CRLException() { - super(); } /** - Constructs an CRLException with a message string. - - @param msg A message to display with exception - */ + * Constructs an CRLException with a message string. + * + * @param msg a message to display with exception + */ public CRLException(String msg) { - super( msg ); + super(msg); } - } diff --git a/java/security/cert/CertPathBuilderException.java b/java/security/cert/CertPathBuilderException.java new file mode 100644 index 000000000..7cfdb79e5 --- /dev/null +++ b/java/security/cert/CertPathBuilderException.java @@ -0,0 +1,159 @@ +/* CertPathBuilderException.java -- wraps an exception during certificate + path building + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.security.cert; + +import java.io.PrintStream; +import java.io.PrintWriter; +import java.security.GeneralSecurityException; + +/** + * Indicates a problem while using a <code>CertPathBuilder</code>, wrapping + * the lower exception. This class is not thread-safe. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @see CertPathBuilder + * @since 1.4 + * @status updated to 1.4 +*/ +public class CertPathBuilderException extends GeneralSecurityException +{ + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 5316471420178794402L; + + /** + * Create an exception without a message. The cause may be initialized. + */ + public CertPathBuilderException() + { + } + + /** + * Create an exception with a message. The cause may be initialized. + * + * @param msg a message to display with exception + */ + public CertPathBuilderException(String msg) + { + super(msg); + } + + /** + * Create an exception with a cause. The message will be + * <code>cause == null ? null : cause.toString()</code>. + * + * @param cause the cause + */ + public CertPathBuilderException(Throwable cause) + { + this(cause == null ? null : cause.toString(), cause); + } + + /** + * Create an exception with a cause and a message. + * + * @param msg the message + * @param cause the cause + */ + public CertPathBuilderException(String msg, Throwable cause) + { + super(msg); + initCause(cause); + } + + /** + * Get the detail message. + * + * @return the detail message + */ + public String getMessage() + { + return super.getMessage(); + } + + /** + * Get the cause, null if unknown. + * + * @return the cause + */ + public Throwable getCause() + { + return super.getCause(); + } + + /** + * Convert this to a string, including its cause. + * + * @return the string conversion + */ + public String toString() + { + return super.toString(); + } + + /** + * Print the stack trace to <code>System.err</code>. + */ + public void printStackTrace() + { + super.printStackTrace(); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintStream stream) + { + super.printStackTrace(stream); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintWriter stream) + { + super.printStackTrace(stream); + } +} diff --git a/java/security/cert/CertPathValidatorException.java b/java/security/cert/CertPathValidatorException.java new file mode 100644 index 000000000..e7b40b8d3 --- /dev/null +++ b/java/security/cert/CertPathValidatorException.java @@ -0,0 +1,226 @@ +/* CertPathValidatorException.java -- wraps an exception during validation + of a CertPath + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.security.cert; + +import java.io.PrintStream; +import java.io.PrintWriter; +import java.security.GeneralSecurityException; + +/** + * Indicates a problem while validating a certification path. In addition, + * it can store the path an index in that path that caused the problem. This + * class is not thread-safe. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @see CertPathValidator + * @since 1.4 + * @status updated to 1.4 +*/ +public class CertPathValidatorException extends GeneralSecurityException +{ + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = -3083180014971893139L; + + /** + * The index of the certificate path that failed, or -1. + * + * @serial the failed index + */ + private final int index; + + /** + * The <code>CertPath</code> that failed. + * + * @serial the object being validated at time of failure + */ + private final CertPath certPath; + + /** + * Create an exception without a message. The cause may be initialized. The + * index is set to -1 and the failed CertPath object to null. + */ + public CertPathValidatorException() + { + this((String) null); + } + + /** + * Create an exception with a message. The cause may be initialized. The + * index is set to -1 and the failed CertPath object to null. + * + * @param msg a message to display with exception + */ + public CertPathValidatorException(String msg) + { + super(msg); + index = -1; + certPath = null; + } + + /** + * Create an exception with a cause. The message will be + * <code>cause == null ? null : cause.toString()</code>. The index is set + * to -1 and the failed CertPath object to null. + * + * @param cause the cause + */ + public CertPathValidatorException(Throwable cause) + { + this(cause == null ? null : cause.toString(), cause, null, -1); + } + + /** + * Create an exception with a cause and a message. The index is set to -1 + * and the failed CertPath object to null. + * + * @param msg the message + * @param cause the cause + */ + public CertPathValidatorException(String msg, Throwable cause) + { + this(msg, cause, null, -1); + } + + /** + * Create an exception with a cause, message, failed object, and index of + * failure in that CertPath. + * + * @param msg the message + * @param cause the cause + * @param certPath the path that was being validated, or null + * @param index the index of the path, or -1 + * @throws IndexOutOfBoundsException if index is < -1 or + * > certPath.getCertificates().size() + * @throws IllegalArgumentException if certPath is null but index != -1 + */ + public CertPathValidatorException(String msg, Throwable cause, + CertPath certPath, int index) + { + super(msg); + initCause(cause); + if (index < -1 || (certPath != null + && index >= certPath.getCertificates().size())) + throw new IndexOutOfBoundsException(); + if ((certPath == null) != (index == -1)) + throw new IllegalArgumentException(); + this.certPath = certPath; + this.index = index; + } + + /** + * Get the detail message. + * + * @return the detail message + */ + public String getMessage() + { + return super.getMessage(); + } + + /** + * Get the certificate path that had the failure, or null. + * + * @return the culprit path + */ + public CertPath getCertPath() + { + return certPath; + } + + /** + * Get the index that failed, or -1. + * + * @return the colprit index + */ + public int getIndex() + { + return index; + } + + /** + * Get the cause, null if unknown. + * + * @return the cause + */ + public Throwable getCause() + { + return super.getCause(); + } + + /** + * Convert this to a string, including its cause. + * + * @return the string conversion + */ + public String toString() + { + return super.toString(); + } + + /** + * Print the stack trace to <code>System.err</code>. + */ + public void printStackTrace() + { + super.printStackTrace(); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintStream stream) + { + super.printStackTrace(stream); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintWriter stream) + { + super.printStackTrace(stream); + } +} diff --git a/java/security/cert/CertStoreException.java b/java/security/cert/CertStoreException.java new file mode 100644 index 000000000..7d7bd148e --- /dev/null +++ b/java/security/cert/CertStoreException.java @@ -0,0 +1,159 @@ +/* CertStoreException.java -- wraps an exception during certificate storage + Copyright (C) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package java.security.cert; + +import java.io.PrintStream; +import java.io.PrintWriter; +import java.security.GeneralSecurityException; + +/** + * Indicates a problem while retrieving certificates and CRLs from + * <code>CertStore</code>, wrapping the lower exception. This class is not + * thread-safe. + * + * @author Eric Blake <ebb9@email.byu.edu> + * @see CertStore + * @since 1.4 + * @status updated to 1.4 +*/ +public class CertStoreException extends GeneralSecurityException +{ + /** + * Compatible with JDK 1.4+. + */ + private static final long serialVersionUID = 2395296107471573245L; + + /** + * Create an exception without a message. The cause may be initialized. + */ + public CertStoreException() + { + } + + /** + * Create an exception with a message. The cause may be initialized. + * + * @param msg a message to display with exception + */ + public CertStoreException(String msg) + { + super(msg); + } + + /** + * Create an exception with a cause. The message will be + * <code>cause == null ? null : cause.toString()</code>. + * + * @param cause the cause + */ + public CertStoreException(Throwable cause) + { + this(cause == null ? null : cause.toString(), cause); + } + + /** + * Create an exception with a cause and a message. + * + * @param msg the message + * @param cause the cause + */ + public CertStoreException(String msg, Throwable cause) + { + super(msg); + initCause(cause); + } + + /** + * Get the detail message. + * + * @return the detail message + */ + public String getMessage() + { + return super.getMessage(); + } + + /** + * Get the cause, null if unknown. + * + * @return the cause + */ + public Throwable getCause() + { + return super.getCause(); + } + + /** + * Convert this to a string, including its cause. + * + * @return the string conversion + */ + public String toString() + { + return super.toString(); + } + + /** + * Print the stack trace to <code>System.err</code>. + */ + public void printStackTrace() + { + super.printStackTrace(); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintStream stream) + { + super.printStackTrace(stream); + } + + /** + * Print the stack trace to a stream. + * + * @param stream the stream + */ + public void printStackTrace(PrintWriter stream) + { + super.printStackTrace(stream); + } +} diff --git a/java/security/cert/CertificateEncodingException.java b/java/security/cert/CertificateEncodingException.java index e74852e49..a7730098f 100644 --- a/java/security/cert/CertificateEncodingException.java +++ b/java/security/cert/CertificateEncodingException.java @@ -1,5 +1,5 @@ -/* CertificateEncodingException.java --- Certificate Encoding Exception - Copyright (C) 1999 Free Software Foundation, Inc. +/* CertificateEncodingException.java -- Certificate Encoding Exception + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,31 +39,33 @@ exception statement from your version. */ package java.security.cert; /** - Exception for a Certificate Encoding. - - @since JDK 1.2 - - @author Mark Benvenuto -*/ + * Exception for a Certificate Encoding. + * + * @author Mark Benvenuto + * @since 1.2 + * @status updated to 1.4 + */ public class CertificateEncodingException extends CertificateException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 6219492851589449162L; /** - Constructs an CertificateEncodingException without a message string. - */ + * Constructs an exception without a message string. + */ public CertificateEncodingException() { - super(); } /** - Constructs an CertificateEncodingException with a message string. - - @param msg A message to display with exception - */ + * Constructs an exception with a message string. + * + * @param msg A message to display with exception + */ public CertificateEncodingException(String msg) { - super( msg ); + super(msg); } - } diff --git a/java/security/cert/CertificateException.java b/java/security/cert/CertificateException.java index a3647ca33..d833834a1 100644 --- a/java/security/cert/CertificateException.java +++ b/java/security/cert/CertificateException.java @@ -1,5 +1,5 @@ -/* CertificateException.java --- Certificate Exception - Copyright (C) 1999 Free Software Foundation, Inc. +/* CertificateException.java -- Certificate Exception + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,34 +37,38 @@ exception statement from your version. */ package java.security.cert; + import java.security.GeneralSecurityException; /** - Exception for a Certificate. - - @since JDK 1.2 - - @author Mark Benvenuto -*/ + * Exception for a Certificate. + * + * @author Mark Benvenuto + * @see Certificate + * @since 1.2 + * @status updated to 1.4 + */ public class CertificateException extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 3192535253797119798L; /** - Constructs an CertificateException without a message string. - */ + * Constructs an exception without a message string. + */ public CertificateException() { - super(); } /** - Constructs an CertificateException with a message string. - - @param msg A message to display with exception - */ + * Constructs an exception with a message string. + * + * @param msg a message to display with exception + */ public CertificateException(String msg) { - super( msg ); + super(msg); } - } diff --git a/java/security/cert/CertificateExpiredException.java b/java/security/cert/CertificateExpiredException.java index d3f322a09..6d2350865 100644 --- a/java/security/cert/CertificateExpiredException.java +++ b/java/security/cert/CertificateExpiredException.java @@ -1,5 +1,5 @@ /* CertificateExpiredException.java --- Certificate Expired Exception - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,31 +39,33 @@ exception statement from your version. */ package java.security.cert; /** - Exception for a Certificate Expiring. - - @since JDK 1.2 - - @author Mark Benvenuto -*/ + * Exception for a Certificate Expiring. + * + * @author Mark Benvenuto + * @since 1.2 + * @status updated to 1.4 + */ public class CertificateExpiredException extends CertificateException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 9071001339691533771L; /** - Constructs an CertificateExpiredException without a message string. - */ + * Constructs an exception without a message string. + */ public CertificateExpiredException() { - super(); } /** - Constructs an CertificateExpiredException with a message string. - - @param msg A message to display with exception - */ + * Constructs an exception with a message string. + * + * @param msg a message to display with exception + */ public CertificateExpiredException(String msg) { - super( msg ); + super(msg); } - } diff --git a/java/security/cert/CertificateNotYetValidException.java b/java/security/cert/CertificateNotYetValidException.java index 359fb8cc7..d831265a9 100644 --- a/java/security/cert/CertificateNotYetValidException.java +++ b/java/security/cert/CertificateNotYetValidException.java @@ -1,5 +1,5 @@ -/* CertificateNotYetValidException.java --- Certificate Not Yet Valid Exception - Copyright (C) 1999 Free Software Foundation, Inc. +/* CertificateNotYetValidException.java -- Certificate Not Yet Valid Exception + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,31 +39,33 @@ exception statement from your version. */ package java.security.cert; /** - Exception for a Certificate being not yet valid. - - @since JDK 1.2 - - @author Mark Benvenuto + * Exception for a Certificate that is not yet valid. + * + * @author Mark Benvenuto + * @since 1.2 + * @status updated to 1.4 */ public class CertificateNotYetValidException extends CertificateException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 4355919900041064702L; /** - Constructs an CertificateNotYetValidException without a message string. - */ + * Constructs an exception without a message string. + */ public CertificateNotYetValidException() { - super(); } /** - Constructs an CertificateNotYetValidException with a message string. - - @param msg A message to display with exception - */ + * Constructs an exception with a message string. + * + * @param msg A message to display with exception + */ public CertificateNotYetValidException(String msg) { - super( msg ); + super(msg); } - } diff --git a/java/security/cert/CertificateParsingException.java b/java/security/cert/CertificateParsingException.java index 8e26acdde..adc8935d2 100644 --- a/java/security/cert/CertificateParsingException.java +++ b/java/security/cert/CertificateParsingException.java @@ -1,5 +1,5 @@ -/* CertificateParsingException.java --- Certificate Parsing Exception - Copyright (C) 1999 Free Software Foundation, Inc. +/* CertificateParsingException.java -- Certificate Parsing Exception + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,31 +39,33 @@ exception statement from your version. */ package java.security.cert; /** - Exception for a Certificate Parsing. - - @since JDK 1.2 - - @author Mark Benvenuto + * Exception for parsing a DER-encoded Certificate. + * + * @author Mark Benvenuto + * @since 1.2 + * @status updated to 1.4 */ public class CertificateParsingException extends CertificateException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -7989222416793322029L; /** - Constructs an CertificateParsingException without a message string. - */ + * Constructs an exception without a message string. + */ public CertificateParsingException() { - super(); } /** - Constructs an CertificateParsingException with a message string. - - @param msg A message to display with exception - */ + * Constructs an exception with a message string. + * + * @param msg a message to display with exception + */ public CertificateParsingException(String msg) { - super( msg ); + super(msg); } - } diff --git a/java/security/cert/Makefile.am b/java/security/cert/Makefile.am index 7d36c63bc..b4b8a2e52 100644 --- a/java/security/cert/Makefile.am +++ b/java/security/cert/Makefile.am @@ -11,9 +11,10 @@ CertificateFactory.java \ CertificateFactorySpi.java \ CertificateNotYetValidException.java \ CertificateParsingException.java \ +CertPathBuilderException.java \ +CertPathValidatorException.java \ +CertStoreException.java \ X509CRL.java \ X509CRLEntry.java \ X509Certificate.java \ -X509Extension.java - - +X509Extension.java diff --git a/java/security/spec/InvalidKeySpecException.java b/java/security/spec/InvalidKeySpecException.java index e4ac737bc..d64e3f66e 100644 --- a/java/security/spec/InvalidKeySpecException.java +++ b/java/security/spec/InvalidKeySpecException.java @@ -1,5 +1,5 @@ -/* InvalidKeySpecException.java --- Invalid KeySpec Exception - Copyright (C) 1999 Free Software Foundation, Inc. +/* InvalidKeySpecException.java -- invalid KeySpec Exception + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,34 +37,38 @@ exception statement from your version. */ package java.security.spec; + import java.security.GeneralSecurityException; /** - Exception for an invalid key specification. - - @since JDK 1.2 - - @author Mark Benvenuto -*/ -public class InvalidKeySpecException extends GeneralSecurityException + * Exception for an invalid key specification. + * + * @author Mark Benvenuto + * @see KeySpec + * @since 1.2 + * @status updated to 1.4 + */ +public class InvalidKeySpecException extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 3546139293998810778L; /** - Constructs an InvalidKeySpecException without a message string. - */ - public InvalidKeySpecException() + * Constructs an InvalidKeySpecException without a message string. + */ + public InvalidKeySpecException() { - super(); } /** - Constructs an InvalidKeySpecException with a message string. - - @param msg A message to display with exception - */ + * Constructs an InvalidKeySpecException with a message string. + * + * @param msg a message to display with exception + */ public InvalidKeySpecException(String msg) { - super( msg ); + super(msg); } - } diff --git a/java/security/spec/InvalidParameterSpecException.java b/java/security/spec/InvalidParameterSpecException.java index 63331e23e..7b8aca602 100644 --- a/java/security/spec/InvalidParameterSpecException.java +++ b/java/security/spec/InvalidParameterSpecException.java @@ -1,5 +1,5 @@ -/* InvalidParameterSpecException.java --- Invalid ParameterSpec Exception - Copyright (C) 1999 Free Software Foundation, Inc. +/* InvalidParameterSpecException.java --- invalid ParameterSpec Exception + Copyright (C) 1999, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -37,34 +37,40 @@ exception statement from your version. */ package java.security.spec; + import java.security.GeneralSecurityException; /** - Exception for an invalid algorithm specification. - - @since JDK 1.2 - - @author Mark Benvenuto + * Exception for an invalid algorithm specification. + * + * @author Mark Benvenuto + * @see AlogorithmParameters + * @see AlogorithmParameterSpec + * @see DSAParameterSpec + * @since 1.2 + * @status updated to 1.4 */ public class InvalidParameterSpecException extends GeneralSecurityException { + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = -970468769593399342L; /** - Constructs an InvalidParameterSpecException without a message string. - */ + * Constructs an InvalidParameterSpecException without a message string. + */ public InvalidParameterSpecException() { - super(); } /** - Constructs an InvalidParameterSpecException with a message string. - - @param msg A message to display with exception - */ - public InvalidParameterSpecException(String msg) + * Constructs an InvalidParameterSpecException with a message string. + * + * @param msg a message to display with exception + */ + public InvalidParameterSpecException(String msg) { - super( msg ); + super(msg); } - } diff --git a/java/sql/BatchUpdateException.java b/java/sql/BatchUpdateException.java index 04478ee4b..ead198e99 100644 --- a/java/sql/BatchUpdateException.java +++ b/java/sql/BatchUpdateException.java @@ -1,5 +1,5 @@ -/* BatchUpdateException.java -- Exception for batch oriented SQL errors - Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* BatchUpdateException.java -- exception for batch oriented SQL errors + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,142 +39,109 @@ exception statement from your version. */ package java.sql; /** - * This class extends <code>SQLException</code> to count the successful - * updates in each statement in a batch that was successfully updated prior - * to the error. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class BatchUpdateException extends SQLException -{ - -/*************************************************************************/ - -/* - * Instance Variables - */ - -/** - * This is the array of update counts for the commands which completed - * successfully prior to the error. - * @serialized - */ -private int[] updateCounts; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * This method initializes a new instance of <code>BatchUpdateException</code> - * with no descriptive error message. The SQL state and update count will - * be initialized to <code>null</code> and the vendor specific error code will - * initialized to 0. - */ -public -BatchUpdateException() -{ - super(); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of <code>BatchUpdateException</code> - * with the specified update count information and no descriptive error - * message. This SQL state will be initialized to <code>null</code> and - * the vendor specific error code will be initialized to 0. - * - * @param updateCounts The update count array. - */ -public -BatchUpdateException(int[] updateCounts) -{ - super(); - - this.updateCounts = updateCounts; -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of <code>BatchUpdateException</code> - * with the specified descriptive error message and update count information. - * The SQL state will be initialized to <code>null</code> and the vendor - * specific error code will be initialized to 0. - * - * @param message The descriptive error message. - * @param updateCounts The update count information for this error. - */ -public -BatchUpdateException(String message, int[] updateCounts) -{ - super(message); - - this.updateCounts = updateCounts; -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of <code>BatchUpdateException</code> - * with the specified descriptive error message, SQL state, and update count - * information. The vendor specific error code will be initialized to 0. - * - * @param message The descriptive error message. - * @param SQLState The SQL state information for this error. - * @param updateCounts The update count information for this error. - */ -public -BatchUpdateException(String message, String SQLState, int[] updateCounts) -{ - super(message, SQLState); - - this.updateCounts = updateCounts; -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of <code>BatchUpdateException</code> - * with the specified descriptive error message, SQL state, vendor - * specific error code and update count information. - * - * @param message The descriptive error message. - * @param SQLState The SQL state information for this error. - * @param vendorCode The vendor specific error code for this error. - * @param updateCounts The update count information for this error. - */ -public -BatchUpdateException(String message, String SQLState, int vendorCode, - int[] updateCounts) -{ - super(message, SQLState, vendorCode); - - this.updateCounts = updateCounts; -} - -/*************************************************************************/ - -/* - * Instance Methods + * This class extends <code>SQLException</code> to count the successful + * updates in each statement in a batch that was successfully updated prior + * to the error. The driver may continue to process batch commands, in which + * case those commands also have an entry in the array. So, to tell which + * command failed, search for <code>Statement.EXECUTE_FAILED</code>. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @since 1.2 + * @status updated to 1.4 */ - -/** - * This method returns the update count information for this error. If - * not <code>null</code> this is an array of <code>int</code>'s that are - * the update accounts for each command that was successfully executed. - * The array elements are in the order that the commands were executed. - * - * @return The update count information, which may be <code>null</code>. - */ -public int[] -getUpdateCounts() +public class BatchUpdateException extends SQLException { - return(updateCounts); -} - + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 5977529877145521757L; + + /** + * This is the array of update counts for the commands which completed + * successfully prior to the error. + * + * @serial the outcome of the batch execution + */ + private final int[] updateCounts; + + /** + * Create a new instance with no descriptive error message. The SQL state + * and update count will be initialized to <code>null</code> and the + * vendor specific error code will initialized to 0. + */ + public BatchUpdateException() + { + this(null, null, 0, null); + } + + /** + * Create a new instance with the specified update count information and + * no descriptive error message. This SQL state will be initialized to + * <code>null</code> and the vendor specific error code will be initialized + * to 0. + * + * @param updateCounts the update count array + */ + public BatchUpdateException(int[] updateCounts) + { + this(null, null, 0, updateCounts); + } + + /** + * Create a new instance with the specified descriptive error message and + * update count information. The SQL state will be initialized to + * <code>null</code> and the vendor specific error code will be + * initialized to 0. + * + * @param message the descriptive error message + * @param updateCounts the update count information for this error + */ + public BatchUpdateException(String message, int[] updateCounts) + { + this(message, null, 0, updateCounts); + } + + /** + * Create a new instance with the specified descriptive error message, + * SQL state, and update count information. The vendor specific error + * code will be initialized to 0. + * + * @param message the descriptive error message + * @param state the SQL state information for this error + * @param updateCounts the update count information for this error + */ + public BatchUpdateException(String message, String state, + int[] updateCounts) + { + this(message, state, 0, updateCounts); + } + + /** + * Create a new instance with the specified descriptive error message, + * SQL state, vendor specific error code and update count information. + * + * @param message the descriptive error message + * @param state the SQL state information for this error + * @param vendorCode the vendor specific error code for this error + * @param updateCounts the update count information for this error + */ + public BatchUpdateException(String message, String state, int vendorCode, + int[] updateCounts) + { + super(message, state, vendorCode); + this.updateCounts = updateCounts; + } + + /** + * Get the update count information for this error. If not + * <code>null</code>, this is an array of <code>int</code>'s that are + * the update accounts for each command that was successfully executed. + * The array elements are in the order that the commands were executed. + * + * @return the update count information, which may be <code>null</code> + */ + public int[] getUpdateCounts() + { + return updateCounts; + } } // class BatchUpdateException - diff --git a/java/sql/DataTruncation.java b/java/sql/DataTruncation.java index 0cb67ae24..fb4035cb4 100644 --- a/java/sql/DataTruncation.java +++ b/java/sql/DataTruncation.java @@ -1,5 +1,5 @@ -/* DataTruncation.java -- Warning when data has been truncated. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* DataTruncation.java -- warning when data has been truncated + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,169 +39,125 @@ exception statement from your version. */ package java.sql; /** - * This exception is thrown when a piece of data is unexpectedly - * truncated in JDBC. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class DataTruncation extends SQLWarning -{ - -/*************************************************************************/ - -/* - * Instance Variables - */ - -/** - * The original size of the data. - * @serialized - */ -private int dataSize; - -/** - * The index of the parameter or column whose value was truncated. - * @serialized - */ -private int index; - -/** - * Indicates whether or not a parameter value was truncated. - * @serialized - */ -private boolean parameter; - -/** - * Indicates whether or not a data column value was truncated. - * @serialized - */ -private boolean read; - -/** - * This is the size of the data after truncation. - * @serialized - */ -private int transferSize; - -/*************************************************************************/ - -/** - * Static Variables - */ - -/** - * This is the serialization UID for this class - */ -private static final long serialVersionUID = 6464298989504059473L; - -/*************************************************************************/ - -/* - * Constructors + * This exception is thrown when a piece of data is unexpectedly + * truncated in JDBC. This has an SQLstate of <code>01004</code>. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @status updated to 1.4 */ - -/** - * This method initializes a new instance of <code>DataTruncation</code> - * with the specified values. The descriptive error message for this - * exception will be "Data truncation", the SQL state will be "01004" - * and the vendor specific error code will be set to 0. - * - * @param index The index of the parameter or column that was truncated. - * @param parameter <code>true</code> if a parameter was truncated, - * <code>false</code> otherwise. - * @param read <code>true</code> if a data column was truncated, - * <code>false</code> otherwise. - * @param dataSize The original size of the data. - * @param transferSize The size of the data after truncation. - */ -public -DataTruncation(int index, boolean parameter, boolean read, int dataSize, - int transferSize) -{ - super("Data truncation", "01004"); - - this.index = index; - this.parameter = parameter; - this.read = read; - this.dataSize = dataSize; - this.transferSize = transferSize; -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method returns the index of the column or parameter that was - * truncated. - * - * @return The index of the column or parameter that was truncated. - */ -public int -getIndex() -{ - return(index); -} - -/*************************************************************************/ - -/** - * This method determines whether or not it was a parameter that was - * truncated. - * - * @return <code>true</code> if a parameter was truncated, <code>false</code> - * otherwise. - */ -public boolean -getParameter() -{ - return(parameter); -} - -/*************************************************************************/ - -/** - * This method determines whether or not it was a column that was - * truncated. - * - * @return <code>true</code> if a column was truncated, <code>false</code> - * otherwise. - */ -public boolean -getRead() -{ - return(read); -} - -/*************************************************************************/ - -/** - * This method returns the original size of the parameter or column that - * was truncated. - * - * @return The original size of the parameter or column that was truncated. - */ -public int -getDataSize() -{ - return(dataSize); -} - -/*************************************************************************/ - -/** - * This method returns the size of the parameter or column after it was - * truncated. - * - * @return The size of the parameter or column after it was truncated. - */ -public int -getTransferSize() +public class DataTruncation extends SQLWarning { - return(transferSize); -} - + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 6464298989504059473L; + + /** + * The original size of the data. + * + * @serial the original data size + */ + private final int dataSize; + + /** + * The index of the parameter or column whose value was truncated. + * + * @serial the index that was truncated + */ + private final int index; + + /** + * Indicates whether or not a parameter value was truncated. + * + * @serial true if a parameter was truncated + */ + private final boolean parameter; + + /** + * Indicates whether or not a data column value was truncated. + * + * @serial true if a data column was read before truncation + */ + private final boolean read; + + /** + * This is the size of the data after truncation. + * + * @serial the size actually transferred + */ + private final int transferSize; + + /** + * Create a new instance with the specified values. The descriptive error + * message for this exception will be "Data truncation", the SQL state + * will be "01004", and the vendor specific error code will be set to 0. + * + * @param index the index of the parameter or column that was truncated + * @param parameter <code>true</code> if a parameter was truncated + * @param read <code>true</code> if a data column was truncated + * @param dataSize the original size of the data + * @param transferSize the size of the data after truncation + */ + public DataTruncation(int index, boolean parameter, boolean read, + int dataSize, int transferSize) + { + super("Data truncation", "01004"); + this.index = index; + this.parameter = parameter; + this.read = read; + this.dataSize = dataSize; + this.transferSize = transferSize; + } + + /** + * Get the index of the column or parameter that was truncated. + * + * @return the index of the column or parameter that was truncated + */ + public int getIndex() + { + return index; + } + + /** + * Return true if it was a parameter that was truncated. + * + * @return <code>true</code> if a parameter was truncated + */ + public boolean getParameter() + { + return parameter; + } + + /** + * Return true if it was a column that was truncated. + * + * @return <code>true</code> if a column was truncated + */ + public boolean getRead() + { + return read; + } + + /** + * This method returns the original size of the parameter or column that + * was truncated. + * + * @return the original size + */ + public int getDataSize() + { + return dataSize; + } + + /** + * This method returns the size of the parameter or column after it was + * truncated. + * + * @return the truncated size + */ + public int getTransferSize() + { + return transferSize; + } } // class DataTruncation - diff --git a/java/sql/SQLException.java b/java/sql/SQLException.java index fce56650f..64e14503d 100644 --- a/java/sql/SQLException.java +++ b/java/sql/SQLException.java @@ -1,5 +1,5 @@ /* SQLException.java -- General SQL exception - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,183 +39,139 @@ exception statement from your version. */ package java.sql; /** - * This exception is thrown when a database error occurs. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class SQLException extends Exception -{ - -/*************************************************************************/ - -/* - * Instance Variables + * This exception is thrown when a database error occurs. This exception + * keeps track of additional information:<br><ul> + * <li>The error message string (part of all Throwables)</li> + * <li>An "SQLstate" string, following either the XOPEN SQLstate or the SQL 99 + * conventions.</li> + * <li>A vendor-specific integer error code.</li> + * <li>A chain to the next exception.</li> + * <ul> + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @status updated to 1.4 */ - -/** - * This is the next exception in the chain - * @serialized - */ -private SQLException next; - -/** - * This is the state of the SQL statement at the time of the error. - * @serialized - */ -private String SQLState; - -/** - * The vendor error code for this error - * @serialized - */ -private int vendorCode; - -/*************************************************************************/ - -/** - * Static Variables - */ - -/** - * This is the serialization UID for this class - */ -private static final long serialVersionUID = 2135244094396331484L; - -/*************************************************************************/ - -/* - * Constructors - */ - -/** - * This method initializes a new instance of <code>SQLException</code> - * that does not have a descriptive messages and SQL state, and which - * has a vendor error code of 0. - */ -public -SQLException() -{ - this(null, null, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of <code>SQLException</code> - * with the specified descriptive error message. The SQL state of this - * instance will be <code>null</code> and the vendor error code will be 0. - * - * @param message A string describing the nature of the error. - */ -public -SQLException(String message) -{ - this(message, null, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of <code>SQLException</code> - * with the specified descriptive error message and SQL state string. - * The vendor error code of this instance will be 0. - * - * @param message A string describing the nature of the error. - * @param SQLState A string containing the SQL state of the error. - */ -public -SQLException(String message, String SQLState) -{ - this(message, SQLState, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a nwe instance of <code>SQLException</code> - * with the specified descriptive error message, SQL state string, and - * vendor code. - * - * @param message A string describing the nature of the error. - * @param SQLState A string containing the SQL state of the error. - * @param vendorCode The vendor error code associated with this error. - */ -public -SQLException(String message, String SQLState, int vendorCode) -{ - super(message); - - this.SQLState = SQLState; - this.vendorCode = vendorCode; -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method returns the SQLState information associated with this - * error. The value returned is a <code>String</code> which is formatted - * using the XOPEN SQL state conventions. - * - * @return The SQL state, which may be <code>null</code>. - */ -public String -getSQLState() -{ - return(SQLState); -} - -/*************************************************************************/ - -/** - * This method returns the vendor specific error code associated with - * this error. - * - * @return The vendor specific error code associated with this error. - */ -public int -getErrorCode() -{ - return(vendorCode); -} - -/*************************************************************************/ - -/** - * This method returns the exception that is chained to this object. - * - * @return The exception chained to this object, which may be - * <code>null</code>. - */ -public SQLException -getNextException() -{ - return(next); -} - -/*************************************************************************/ - -/** - * This method adds a new exception to the end of the chain of exceptions - * that are chained to this object. - * - * @param e The exception to add to the end of the chain. - */ -public void -setNextException(SQLException e) +public class SQLException extends Exception { - if (e == null) - return; - - SQLException list_entry = this; - while (list_entry.getNextException() != null) - list_entry = list_entry.getNextException(); - - list_entry.next = e; -} - + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 2135244094396331484L; + + /** + * This is the next exception in the chain. + * + * @serial the next exception in the chain + */ + // Package visible for use by SQLWarning. + SQLException next; + + /** + * This is the state of the SQL statement at the time of the error. + * + * @serial the SQLstate + */ + private final String SQLState; + + /** + * The vendor error code for this error. + * + * @serial the vendor code + */ + private final int vendorCode; + + /** + * Create a new instance that does not have a descriptive messages or SQL + * state, and which has a vendor error code of 0. + */ + public SQLException() + { + this(null, null, 0); + } + + /** + * Create a new instance with the specified descriptive error message. The + * SQL state of this instance will be <code>null</code> and the vendor + * error code will be 0. + * + * @param message a string describing the nature of the error + */ + public SQLException(String message) + { + this(message, null, 0); + } + + /** + * Create a new instance with the specified descriptive error message + * and SQL state string. The vendor error code of this instance will be 0. + * + * @param message a string describing the nature of the error + * @param SQLState a string containing the SQL state of the error + */ + public SQLException(String message, String SQLState) + { + this(message, SQLState, 0); + } + + /** + * Create a new instance with the specified descriptive error message, + * SQL state string, and vendor code. + * + * @param message a string describing the nature of the error + * @param SQLState a string containing the SQL state of the error + * @param vendorCode the vendor error code associated with this error + */ + public SQLException(String message, String SQLState, int vendorCode) + { + super(message); + this.SQLState = SQLState; + this.vendorCode = vendorCode; + } + + /** + * Get the SQLState information associated with this error. This + * implementation formats the value using the XOPEN SQL state conventions. + * + * @return The SQL state, which may be <code>null</code> + */ + public String getSQLState() + { + return SQLState; + } + + /** + * Get the vendor specific error code associated with this error. + * + * @return the vendor specific error code associated with this error + */ + public int getErrorCode() + { + return vendorCode; + } + + /** + * Get any exception that is chained to this object. + * + * @return the exception chained to this object, or null + */ + public SQLException getNextException() + { + return next; + } + + /** + * Add a new exception to the end of the chain of exceptions that are + * chained to this object. + * + * @param e the exception to add to the end of the chain + */ + public void setNextException(SQLException e) + { + if (e == null) + return; + SQLException entry = this; + while (entry.next != null) + entry = entry.next; + entry.next = e; + } } // class SQLException - diff --git a/java/sql/SQLWarning.java b/java/sql/SQLWarning.java index 1a74ae028..e2456d5b9 100644 --- a/java/sql/SQLWarning.java +++ b/java/sql/SQLWarning.java @@ -1,5 +1,5 @@ -/* SQLWarning.java -- Database access warnings. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. +/* SQLWarning.java -- database access warnings + Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -39,120 +39,94 @@ exception statement from your version. */ package java.sql; /** - * This exception is thrown when a database warning occurs. - * - * @author Aaron M. Renn (arenn@urbanophile.com) - */ -public class SQLWarning extends SQLException -{ - -/*************************************************************************/ - -/** - * Static Variables - */ - -/** - * This is the serialization UID for this class - */ -private static final long serialVersionUID = 3917336774604784856L; - -/*************************************************************************/ - -/* - * Constructors + * This exception is thrown when a database warning occurs. Warnings are + * silently chained to the object which caused them. + * + * <p>Warnings may be retrieved from <code>Connection</code>, + * <code>Statement</code>, and <code>ResultSet</code> objects. Trying to + * retrieve a warning one of these after it has been closed will cause an + * exception to be thrown. Note that closing a statement also closes a result + * set that it might have produced. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @see Connection#getWarnings() + * @see Statement#getWarnings() + * @see ResultSet#getWarnings() */ - -/** - * This method initializes a new instance of <code>SQLWarning</code> - * that does not have a descriptive messages and SQL state, and which - * has a vendor error code of 0. - */ -public -SQLWarning() -{ - this(null, null, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of <code>SQLWarning</code> - * with the specified descriptive error message. The SQL state of this - * instance will be <code>null</code> and the vendor error code will be 0. - * - * @param message A string describing the nature of the error. - */ -public -SQLWarning(String message) -{ - this(message, null, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a new instance of <code>SQLWarning</code> - * with the specified descriptive error message and SQL state string. - * The vendor error code of this instance will be 0. - * - * @param message A string describing the nature of the error. - * @param SQLState A string containing the SQL state of the error. - */ -public -SQLWarning(String message, String SQLState) -{ - this(message, SQLState, 0); -} - -/*************************************************************************/ - -/** - * This method initializes a nwe instance of <code>SQLWarning</code> - * with the specified descriptive error message, SQL state string, and - * vendor code. - * - * @param message A string describing the nature of the error. - * @param SQLState A string containing the SQL state of the error. - * @param vendorCode The vendor error code associated with this error. - */ -public -SQLWarning(String message, String SQLState, int vendorCode) -{ - super(message, SQLState, vendorCode); -} - -/*************************************************************************/ - -/* - * Instance Methods - */ - -/** - * This method returns the exception that is chained to this object. - * - * @return The exception chained to this object, which may be - * <code>null</code>. - */ -public SQLWarning -getNextWarning() -{ - return((SQLWarning)super.getNextException()); -} - -/*************************************************************************/ - -/** - * This method adds a new exception to the end of the chain of exceptions - * that are chained to this object. - * - * @param e The exception to add to the end of the chain. - */ -public void -setNextWarning(SQLWarning e) +public class SQLWarning extends SQLException { - super.setNextException(e); -} - + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 3917336774604784856L; + + /** + * Create a new instance that does not have a descriptive messages or SQL + * state, and which has a vendor error code of 0. + */ + public SQLWarning() + { + } + + /** + * Create a new instance with the specified descriptive error message. + * The SQL state of this instance will be <code>null</code> and the vendor + * error code will be 0. + * + * @param message a string describing the nature of the error + */ + public SQLWarning(String message) + { + super(message); + } + + /** + * Create a new instance with the specified descriptive error message + * and SQL state string. The vendor error code of this instance will be 0. + * + * @param message a string describing the nature of the error + * @param SQLState a string containing the SQL state of the error + */ + public SQLWarning(String message, String SQLState) + { + super(message, SQLState); + } + + /** + * Create a new instance with the specified descriptive error message, + * SQL state string, and vendor code. + * + * @param message a string describing the nature of the error + * @param SQLState a string containing the SQL state of the error + * @param vendorCode the vendor error code associated with this error + */ + public SQLWarning(String message, String SQLState, int vendorCode) + { + super(message, SQLState, vendorCode); + } + + /** + * Get the warning that is chained to this object. + * + * @return the exception chained to this object, or null + * @throws Error if the next element is not an SQLWarning + */ + public SQLWarning getNextWarning() + { + if (next == null) + return null; + if (! (next instanceof SQLWarning)) + throw new Error("SQLWarning chain holds value that is not a SQLWarning"); + return (SQLWarning) next; + } + + /** + * Set the new end of the warning chain. + * + * @param e the exception to add to the end of the chain + */ + public void setNextWarning(SQLWarning e) + { + setNextException(e); + } } // class SQLWarning - diff --git a/java/text/ParseException.java b/java/text/ParseException.java index 0bbc3d21c..20e828e18 100644 --- a/java/text/ParseException.java +++ b/java/text/ParseException.java @@ -1,5 +1,5 @@ -/* ParseException.java -- An error occurred while parsing. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* ParseException.java -- an error occurred while parsing + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +7,7 @@ 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 @@ -38,65 +38,49 @@ exception statement from your version. */ package java.text; -/* 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 <bothner@cygnus.com> - * @date October 25, 1998. - */ -public class ParseException extends Exception -{ - -/* - * Instance Variables - */ - /** - * This is the position where the error was encountered. - */ -private int errorOffset; - -/*************************************************************************/ - -/* - * Constructors + * This exception is thrown when an unexpected error occurs during parsing. + * + * @author Aaron M. Renn (arenn@urbanophile.com) + * @author Per Bothner <bothner@cygnus.com> + * @see Format + * @see FieldPosition + * @status updated to 1.4 */ - -/** - * This method initializes a new instance of <code>ParseException</code> - * 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() +public class ParseException extends Exception { - return(errorOffset); -} - + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 2703218443322787634L; + + /** + * This is the position where the error was encountered. + * + * @serial the zero-based offset in the string where the error occurred + */ + private final int errorOffset; + + /** + * This method initializes a new instance of <code>ParseException</code> + * 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 - diff --git a/java/util/MissingResourceException.java b/java/util/MissingResourceException.java index 1618c4f56..47525e55b 100644 --- a/java/util/MissingResourceException.java +++ b/java/util/MissingResourceException.java @@ -1,5 +1,5 @@ -/* java.util.MissingResourceException - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. +/* MissingResourceException.java -- thrown for a missing resource + Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,38 +38,42 @@ exception statement from your version. */ package java.util; -/* 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 when a resource is missing. * - * @see ResourceBundle * @author Jochen Hoenicke * @author Warren Levy <warrenl@cygnus.com> + * @see ResourceBundle + * @since 1.1 + * @status updated to 1.4 */ public class MissingResourceException extends RuntimeException { + /** + * Compatible with JDK 1.1+. + */ private static final long serialVersionUID = -4876345176062000401L; /** * The name of the resource bundle requested by user. + * + * @serial the class name of the resource bundle */ - private String className; + private final String className; /** * The key of the resource in the bundle requested by user. + * + * @serial the name of the resouce */ - private String key; + private final String key; /** * Creates a new exception, with the specified parameters. - * @param s the detail message. - * @param className the name of the resource bundle. - * @param key the key of the missing resource. + * + * @param s the detail message + * @param className the name of the resource bundle + * @param key the key of the missing resource */ public MissingResourceException(String s, String className, String key) { @@ -80,7 +84,8 @@ public class MissingResourceException extends RuntimeException /** * Gets the name of the resource bundle, for which a resource is missing. - * @return the name of the resource bundle. + * + * @return the name of the resource bundle */ public String getClassName() { @@ -90,7 +95,8 @@ public class MissingResourceException extends RuntimeException /** * Gets the key of the resource that is missing bundle, this is an empty * string if the whole resource bundle is missing. - * @return the name of the resource bundle. + * + * @return the name of the resource bundle */ public String getKey() { diff --git a/java/util/jar/JarException.java b/java/util/jar/JarException.java index c8c0fba37..54291c687 100644 --- a/java/util/jar/JarException.java +++ b/java/util/jar/JarException.java @@ -1,5 +1,5 @@ -/* Attributes.java -- exception thrown to indicate an problem with a jar file - Copyright (C) 2000 Free Software Foundation, Inc. +/* JarException.java -- thrown to indicate an problem with a jar file + Copyright (C) 2000, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -41,35 +41,34 @@ import java.util.zip.ZipException; /** * This exception is thrown to indicate an problem with a jar file. - * It can be constructed with or without a descriptive message of the problem. - * <p> * Note that none of the methods in the java.util.jar package actually declare * to throw this exception, most just declare that they throw an IOException * which is super class of JarException. - * - * @since 1.2 + * * @author Mark Wielaard (mark@klomp.org) + * @since 1.2 */ - public class JarException extends ZipException { - // Constructors + /** + * Compatible with JDK 1.2+. + */ + private static final long serialVersionUID = 7159778400963954473L; /** * Create a new JarException without a descriptive error message. */ public JarException() { - super(); } /** * Create a new JarException with a descriptive error message indicating * what went wrong. This message can later be retrieved by calling the * <code>getMessage()</code> method. - * @see java.lang.Throwable@getMessage() * * @param message The descriptive error message + * @see #getMessage() */ public JarException(String message) { diff --git a/java/util/prefs/BackingStoreException.java b/java/util/prefs/BackingStoreException.java index 9977f0e55..84debf318 100644 --- a/java/util/prefs/BackingStoreException.java +++ b/java/util/prefs/BackingStoreException.java @@ -1,5 +1,6 @@ -/* BackingStoreException - Chained exception thrown when backing store fails - Copyright (C) 2001 Free Software Foundation, Inc. +/* BackingStoreException.java - chained exception thrown when backing store + fails + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +8,7 @@ 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 @@ -37,31 +38,65 @@ exception statement from your version. */ package java.util.prefs; +import java.io.ObjectOutputStream; +import java.io.ObjectInputStream; +import java.io.NotSerializableException; + /** - * Chained exception thrown when backing store fails. - * This exception is only thrown from methods that actually have to access - * the backing store such as <code>clear(), keys(), childrenNames(), - * nodeExists(), removeNode(), flush(), sync(), exportNode(), exportSubTree() - * </code>, normal operations do not throw BackingStoreExceptions. + * Chained exception thrown when backing store fails. This exception is + * only thrown from methods that actually have to access the backing store, + * such as <code>clear(), keys(), childrenNames(), nodeExists(), removeNode(), + * flush(), sync(), exportNode(), exportSubTree()</code>; normal operations + * do not throw BackingStoreExceptions. * + * <p>Note that although this class inherits the Serializable interface, an + * attempt to serialize will fail with a <code>NotSerializableException</code>. + * + * @author Mark Wielaard <mark@klomp.org> * @since 1.4 - * @author Mark Wielaard (mark@klomp.org) + * @status updated to 1.4 */ -public class BackingStoreException extends Exception { +public class BackingStoreException extends Exception +{ + /** + * Creates a new exception with a descriptive message. + * + * @param message the message + */ + public BackingStoreException(String message) + { + super(message); + } + + /** + * Create a new exception with the given cause. + * + * @param cause the cause + */ + public BackingStoreException(Throwable cause) + { + super(cause); + } - /** - * Creates a new exception with a descriptive message. - */ - public BackingStoreException(String message) { - super(message); - } + /** + * This class should not be serialized. + * + * @param o the output stream + */ + private void writeObject(ObjectOutputStream o) + { + throw new NotSerializableException + ("java.util.prefs.BackingStoreException"); + } - /** - * Create a new exception with the given cause. - */ - public BackingStoreException(Throwable cause) { - // XXX - use when we have 1.4 Throwable support - // super(cause); - super(); - } + /** + * This class should not be serialized. + * + * @param i the input stream + */ + private void readObject(ObjectInputStream i) + { + throw new NotSerializableException + ("java.util.prefs.BackingStoreException"); + } } diff --git a/java/util/prefs/InvalidPreferencesFormatException.java b/java/util/prefs/InvalidPreferencesFormatException.java index aa4409ce9..ba06b72fb 100644 --- a/java/util/prefs/InvalidPreferencesFormatException.java +++ b/java/util/prefs/InvalidPreferencesFormatException.java @@ -1,5 +1,6 @@ -/* InvalidPreferenceFormatException - Indicates reading prefs from stream failed - Copyright (C) 2001 Free Software Foundation, Inc. +/* InvalidPreferencesFormatException - indicates reading prefs from stream + failed + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -7,7 +8,7 @@ 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 @@ -37,38 +38,77 @@ exception statement from your version. */ package java.util.prefs; +import java.io.ObjectOutputStream; +import java.io.ObjectInputStream; +import java.io.NotSerializableException; + /** * Indicates reading prefs from stream failed. Thrown by the * <code>importPreferences()</code> method when the supplied input stream * could not be read because it was not in the correct XML format. * + * <p>Note that although this class inherits the Serializable interface, an + * attempt to serialize will fail with a <code>NotSerializableException</code>. + * + * @author Mark Wielaard <mark@klomp.org> + * @see Preferences * @since 1.4 - * @author Mark Wielaard (mark@klomp.org) + * @status updated to 1.4 */ -public class InvalidPreferencesFormatException extends Exception { +public class InvalidPreferencesFormatException extends Exception +{ + /** + * Creates a new exception with a descriptive message. The cause remains + * uninitialized. + * + * @param message the message + */ + public InvalidPreferencesFormatException(String message) + { + super(message); + } + + /** + * Creates a new exception with the given cause. + * + * @param cause the cause + */ + public InvalidPreferencesFormatException(Throwable cause) + { + super(cause); + } - /** - * Creates a new exception with a descriptive message. - */ - public InvalidPreferencesFormatException(String message) { - super(message); - } + /** + * Creates a new exception with a descriptive message and a cause. + * + * @param message the message + * @param cause the cause + */ + public InvalidPreferencesFormatException(String message, Throwable cause) + { + super(message, cause); + super(message); + } - /** - * Creates a new exception with the given cause. - */ - public InvalidPreferencesFormatException(Throwable cause) { - // XXX - Use when we have 1.4 Throwable support - // super(cause); - super(); - } + /** + * This class should not be serialized. + * + * @param o the output stream + */ + private void writeObject(ObjectOutputStream o) + { + throw new NotSerializableException + ("java.util.prefs.InvalidPreferencesFormatException"); + } - /** - * Creates a new exception with a descriptive message and a cause. - */ - public InvalidPreferencesFormatException(String message, Throwable cause) { - // XXX - Use when we have 1.4 Throwable support - // super(message, cause); - super(message); - } + /** + * This class should not be serialized. + * + * @param i the input stream + */ + private void readObject(ObjectInputStream i) + { + throw new NotSerializableException + ("java.util.prefs.InvalidPreferencesFormatException"); + } } diff --git a/java/util/zip/DataFormatException.java b/java/util/zip/DataFormatException.java index 28ecef059..e5a948e8a 100644 --- a/java/util/zip/DataFormatException.java +++ b/java/util/zip/DataFormatException.java @@ -1,5 +1,5 @@ -/* DataformatException.java - Exception thrown when compressed data is corrupt - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. +/* DataformatException.java -- thrown when compressed data is corrupt + Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -37,25 +37,34 @@ exception statement from your version. */ package java.util.zip; -/* Written using on-line Java Platform 1.2 API Specification. - * Believed complete and correct. - */ - /** * Exception thrown when compressed data is corrupt. * * @author Tom Tromey * @author John Leuner - * @since JDK 1.1 + * @since 1.1 + * @status updated to 1.4 */ public class DataFormatException extends Exception { - public DataFormatException () + /** + * Compatible with JDK 1.1+. + */ + private static final long serialVersionUID = 2219632870893641452L; + + /** + * Create an exception without a message. + */ + public DataFormatException() { - super(); } - public DataFormatException (String msg) + /** + * Create an exception with a message. + * + * @param msg the message + */ + public DataFormatException(String msg) { super(msg); } diff --git a/java/util/zip/ZipException.java b/java/util/zip/ZipException.java index ed02c8564..9130ef296 100644 --- a/java/util/zip/ZipException.java +++ b/java/util/zip/ZipException.java @@ -1,5 +1,5 @@ -/* ZipException.java - Exception representing a zip related error - Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* ZipException.java - exception representing a zip related error + Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -37,24 +37,34 @@ exception statement from your version. */ package java.util.zip; -/* Written using on-line Java Platform 1.2 API Specification. - * Believed complete and correct. - */ +import java.io.IOException; /** - * Is thrown during the creation or input of a zip file. + * Thrown during the creation or input of a zip file. * * @author Jochen Hoenicke * @author Per Bothner - * @since JDK 1.1 + * @status updated to 1.4 */ -public class ZipException extends java.io.IOException +public class ZipException extends IOException { - public ZipException () + /** + * Compatible with JDK 1.0+. + */ + private static final long serialVersionUID = 8000196834066748623L; + + /** + * Create an exception without a message. + */ + public ZipException() { - super(); } + /** + * Create an exception with a message. + * + * @param msg the message + */ public ZipException (String msg) { super(msg); |