jdk/src/java.base/share/classes/java/util/concurrent/CompletionException.java
author dl
Fri, 03 Mar 2017 10:45:38 -0800
changeset 44039 058585425bb7
parent 25859 3317bb8137f4
permissions -rw-r--r--
8173909: Miscellaneous changes imported from jsr166 CVS 2017-03 Reviewed-by: martin, psandoz
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16745
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
     1
/*
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
     3
 *
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Oracle designates this
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
     8
 * by Oracle in the LICENSE file that accompanied this code.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
     9
 *
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    14
 * accompanied this code).
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    15
 *
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    19
 *
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    22
 * questions.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    23
 */
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    24
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    25
/*
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    26
 * This file is available under and governed by the GNU General Public
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    27
 * License version 2 only, as published by the Free Software Foundation.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    28
 * However, the following notice accompanied the original version of this
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    29
 * file:
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    30
 *
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    31
 * Written by Doug Lea with assistance from members of JCP JSR-166
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    32
 * Expert Group and released to the public domain, as explained at
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    33
 * http://creativecommons.org/publicdomain/zero/1.0/
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    34
 */
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    35
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    36
package java.util.concurrent;
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    37
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    38
/**
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    39
 * Exception thrown when an error or other exception is encountered
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    40
 * in the course of completing a result or task.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    41
 *
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    42
 * @since 1.8
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    43
 * @author Doug Lea
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    44
 */
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    45
public class CompletionException extends RuntimeException {
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    46
    private static final long serialVersionUID = 7830266012832686185L;
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    47
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    48
    /**
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    49
     * Constructs a {@code CompletionException} with no detail message.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    50
     * The cause is not initialized, and may subsequently be
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    51
     * initialized by a call to {@link #initCause(Throwable) initCause}.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    52
     */
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    53
    protected CompletionException() { }
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    54
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    55
    /**
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    56
     * Constructs a {@code CompletionException} with the specified detail
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    57
     * message. The cause is not initialized, and may subsequently be
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    58
     * initialized by a call to {@link #initCause(Throwable) initCause}.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    59
     *
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    60
     * @param message the detail message
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    61
     */
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    62
    protected CompletionException(String message) {
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    63
        super(message);
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    64
    }
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    65
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    66
    /**
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    67
     * Constructs a {@code CompletionException} with the specified detail
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    68
     * message and cause.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    69
     *
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    70
     * @param  message the detail message
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    71
     * @param  cause the cause (which is saved for later retrieval by the
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    72
     *         {@link #getCause()} method)
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    73
     */
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    74
    public CompletionException(String message, Throwable cause) {
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    75
        super(message, cause);
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    76
    }
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    77
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    78
    /**
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    79
     * Constructs a {@code CompletionException} with the specified cause.
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    80
     * The detail message is set to {@code (cause == null ? null :
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    81
     * cause.toString())} (which typically contains the class and
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    82
     * detail message of {@code cause}).
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    83
     *
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    84
     * @param  cause the cause (which is saved for later retrieval by the
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    85
     *         {@link #getCause()} method)
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    86
     */
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    87
    public CompletionException(Throwable cause) {
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    88
        super(cause);
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    89
    }
fcce5e09e23b 8005696: Add CompletableFuture
chegar
parents:
diff changeset
    90
}