1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/emul/mini/src/main/java/java/lang/Exception.java Wed Jan 23 20:39:23 2013 +0100
1.3 @@ -0,0 +1,124 @@
1.4 +/*
1.5 + * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1.7 + *
1.8 + * This code is free software; you can redistribute it and/or modify it
1.9 + * under the terms of the GNU General Public License version 2 only, as
1.10 + * published by the Free Software Foundation. Oracle designates this
1.11 + * particular file as subject to the "Classpath" exception as provided
1.12 + * by Oracle in the LICENSE file that accompanied this code.
1.13 + *
1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1.17 + * version 2 for more details (a copy is included in the LICENSE file that
1.18 + * accompanied this code).
1.19 + *
1.20 + * You should have received a copy of the GNU General Public License version
1.21 + * 2 along with this work; if not, write to the Free Software Foundation,
1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1.23 + *
1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1.25 + * or visit www.oracle.com if you need additional information or have any
1.26 + * questions.
1.27 + */
1.28 +
1.29 +package java.lang;
1.30 +
1.31 +/**
1.32 + * The class {@code Exception} and its subclasses are a form of
1.33 + * {@code Throwable} that indicates conditions that a reasonable
1.34 + * application might want to catch.
1.35 + *
1.36 + * <p>The class {@code Exception} and any subclasses that are not also
1.37 + * subclasses of {@link RuntimeException} are <em>checked
1.38 + * exceptions</em>. Checked exceptions need to be declared in a
1.39 + * method or constructor's {@code throws} clause if they can be thrown
1.40 + * by the execution of the method or constructor and propagate outside
1.41 + * the method or constructor boundary.
1.42 + *
1.43 + * @author Frank Yellin
1.44 + * @see java.lang.Error
1.45 + * @jls 11.2 Compile-Time Checking of Exceptions
1.46 + * @since JDK1.0
1.47 + */
1.48 +public class Exception extends Throwable {
1.49 + static final long serialVersionUID = -3387516993124229948L;
1.50 +
1.51 + /**
1.52 + * Constructs a new exception with {@code null} as its detail message.
1.53 + * The cause is not initialized, and may subsequently be initialized by a
1.54 + * call to {@link #initCause}.
1.55 + */
1.56 + public Exception() {
1.57 + super();
1.58 + }
1.59 +
1.60 + /**
1.61 + * Constructs a new exception with the specified detail message. The
1.62 + * cause is not initialized, and may subsequently be initialized by
1.63 + * a call to {@link #initCause}.
1.64 + *
1.65 + * @param message the detail message. The detail message is saved for
1.66 + * later retrieval by the {@link #getMessage()} method.
1.67 + */
1.68 + public Exception(String message) {
1.69 + super(message);
1.70 + }
1.71 +
1.72 + /**
1.73 + * Constructs a new exception with the specified detail message and
1.74 + * cause. <p>Note that the detail message associated with
1.75 + * {@code cause} is <i>not</i> automatically incorporated in
1.76 + * this exception's detail message.
1.77 + *
1.78 + * @param message the detail message (which is saved for later retrieval
1.79 + * by the {@link #getMessage()} method).
1.80 + * @param cause the cause (which is saved for later retrieval by the
1.81 + * {@link #getCause()} method). (A <tt>null</tt> value is
1.82 + * permitted, and indicates that the cause is nonexistent or
1.83 + * unknown.)
1.84 + * @since 1.4
1.85 + */
1.86 + public Exception(String message, Throwable cause) {
1.87 + super(message, cause);
1.88 + }
1.89 +
1.90 + /**
1.91 + * Constructs a new exception with the specified cause and a detail
1.92 + * message of <tt>(cause==null ? null : cause.toString())</tt> (which
1.93 + * typically contains the class and detail message of <tt>cause</tt>).
1.94 + * This constructor is useful for exceptions that are little more than
1.95 + * wrappers for other throwables (for example, {@link
1.96 + * java.security.PrivilegedActionException}).
1.97 + *
1.98 + * @param cause the cause (which is saved for later retrieval by the
1.99 + * {@link #getCause()} method). (A <tt>null</tt> value is
1.100 + * permitted, and indicates that the cause is nonexistent or
1.101 + * unknown.)
1.102 + * @since 1.4
1.103 + */
1.104 + public Exception(Throwable cause) {
1.105 + super(cause);
1.106 + }
1.107 +
1.108 + /**
1.109 + * Constructs a new exception with the specified detail message,
1.110 + * cause, suppression enabled or disabled, and writable stack
1.111 + * trace enabled or disabled.
1.112 + *
1.113 + * @param message the detail message.
1.114 + * @param cause the cause. (A {@code null} value is permitted,
1.115 + * and indicates that the cause is nonexistent or unknown.)
1.116 + * @param enableSuppression whether or not suppression is enabled
1.117 + * or disabled
1.118 + * @param writableStackTrace whether or not the stack trace should
1.119 + * be writable
1.120 + * @since 1.7
1.121 + */
1.122 + protected Exception(String message, Throwable cause,
1.123 + boolean enableSuppression,
1.124 + boolean writableStackTrace) {
1.125 + super(message, cause, enableSuppression, writableStackTrace);
1.126 + }
1.127 +}