diff options
Diffstat (limited to 'libjava/classpath/java/lang/IllegalArgumentException.java')
-rw-r--r-- | libjava/classpath/java/lang/IllegalArgumentException.java | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/libjava/classpath/java/lang/IllegalArgumentException.java b/libjava/classpath/java/lang/IllegalArgumentException.java index 7b822b91665..75a0b8bfe38 100644 --- a/libjava/classpath/java/lang/IllegalArgumentException.java +++ b/libjava/classpath/java/lang/IllegalArgumentException.java @@ -47,7 +47,8 @@ package java.lang; * * @author Brian Jones * @author Warren Levy (warrenl@cygnus.com) - * @status updated to 1.4 + * @author Andrew John Hughes (gnu_andrew@member.fsf.org) + * @status updated to 1.5 */ public class IllegalArgumentException extends RuntimeException { @@ -72,4 +73,57 @@ public class IllegalArgumentException extends RuntimeException { super(s); } + + /** + * <p> + * Constructs a <code>IllegalArgumentException</code> using + * the specified error message, which should give further details + * as to the reason for this exception. The specified cause + * <code>Throwable</code> may be used to provide additional history, + * with regards to the root of the problem. It is perfectly valid + * for this to be null, if the cause of the problem is unknown. + * </p> + * <p> + * <strong>Note</strong>: the detail message from the cause is not + * automatically incorporated into the resulting detail message of + * this exception. + * </p> + * + * @param message the detail message, which should give the reason for + * this exception being thrown. + * @param cause the cause of this exception, or null if the cause + * is unknown. + * @since 1.5 + */ + public IllegalArgumentException(String message, Throwable cause) + { + super(message, cause); + } + + /** + * <p> + * Constructs a <code>IllegalArgumentException</code> using + * the specified cause <code>Throwable</code>, which may be used + * to provide additional history, with regards to the root of the + * problem. It is perfectly valid for this to be null, if the + * cause of the problem is unknown. + * </p> + * <p> + * The detail message is automatically constructed from the detail + * message of the supplied causal exception. If the cause is null, + * then the detail message will also be null. Otherwise, the detail + * message of this exception will be that of the causal exception. + * This makes this constructor very useful for simply wrapping another + * exception. + * </p> + * + * @param cause the cause of this exception, or null if the cause + * is unknown. + * @since 1.5 + */ + public IllegalArgumentException(Throwable cause) + { + super(cause); + } + } |