jdk/src/share/classes/java/util/ConcurrentModificationException.java
changeset 6537 7aa4e7bb5dae
parent 5506 202f599c92aa
child 7668 d4a77089c587
equal deleted inserted replaced
6535:77ffd0e75bfb 6537:7aa4e7bb5dae
    47  * will throw this exception.
    47  * will throw this exception.
    48  *
    48  *
    49  * <p>Note that fail-fast behavior cannot be guaranteed as it is, generally
    49  * <p>Note that fail-fast behavior cannot be guaranteed as it is, generally
    50  * speaking, impossible to make any hard guarantees in the presence of
    50  * speaking, impossible to make any hard guarantees in the presence of
    51  * unsynchronized concurrent modification.  Fail-fast operations
    51  * unsynchronized concurrent modification.  Fail-fast operations
    52  * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
    52  * throw {@code ConcurrentModificationException} on a best-effort basis.
    53  * Therefore, it would be wrong to write a program that depended on this
    53  * Therefore, it would be wrong to write a program that depended on this
    54  * exception for its correctness: <i><tt>ConcurrentModificationException</tt>
    54  * exception for its correctness: <i>{@code ConcurrentModificationException}
    55  * should be used only to detect bugs.</i>
    55  * should be used only to detect bugs.</i>
    56  *
    56  *
    57  * @author  Josh Bloch
    57  * @author  Josh Bloch
    58  * @see     Collection
    58  * @see     Collection
    59  * @see     Iterator
    59  * @see     Iterator
    75      */
    75      */
    76     public ConcurrentModificationException() {
    76     public ConcurrentModificationException() {
    77     }
    77     }
    78 
    78 
    79     /**
    79     /**
    80      * Constructs a <tt>ConcurrentModificationException</tt> with the
    80      * Constructs a {@code ConcurrentModificationException} with the
    81      * specified detail message.
    81      * specified detail message.
    82      *
    82      *
    83      * @param message the detail message pertaining to this exception.
    83      * @param message the detail message pertaining to this exception.
    84      */
    84      */
    85     public ConcurrentModificationException(String message) {
    85     public ConcurrentModificationException(String message) {
    86         super(message);
    86         super(message);
    87     }
    87     }
       
    88 
       
    89     /**
       
    90      * Constructs a new exception with the specified cause and a detail
       
    91      * message of {@code (cause==null ? null : cause.toString())} (which
       
    92      * typically contains the class and detail message of {@code cause}.
       
    93      *
       
    94      * @param  cause the cause (which is saved for later retrieval by the
       
    95      *         {@link Throwable#getCause()} method).  (A {@code null} value is
       
    96      *         permitted, and indicates that the cause is nonexistent or
       
    97      *         unknown.)
       
    98      * @since  1.7
       
    99      */
       
   100     public ConcurrentModificationException(Throwable cause) {
       
   101         super(cause);
       
   102     }
       
   103 
       
   104     /**
       
   105      * Constructs a new exception with the specified detail message and
       
   106      * cause.
       
   107      *
       
   108      * <p>Note that the detail message associated with <code>cause</code> is
       
   109      * <i>not</i> automatically incorporated in this exception's detail
       
   110      * message.
       
   111      *
       
   112      * @param  message the detail message (which is saved for later retrieval
       
   113      *         by the {@link Throwable#getMessage()} method).
       
   114      * @param  cause the cause (which is saved for later retrieval by the
       
   115      *         {@link Throwable#getCause()} method).  (A {@code null} value
       
   116      *         is permitted, and indicates that the cause is nonexistent or
       
   117      *         unknown.)
       
   118      * @since 1.7
       
   119      */
       
   120     public ConcurrentModificationException(String message, Throwable cause) {
       
   121         super(message, cause);
       
   122     }
    88 }
   123 }