• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Licensed to the Apache Software Foundation (ASF) under one or more
3  *  contributor license agreements.  See the NOTICE file distributed with
4  *  this work for additional information regarding copyright ownership.
5  *  The ASF licenses this file to You under the Apache License, Version 2.0
6  *  (the "License"); you may not use this file except in compliance with
7  *  the License.  You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  */
17 
18 package java.util;
19 
20 /**
21  * An {@code ConcurrentModificationException} is thrown when a Collection is
22  * modified and an existing iterator on the Collection is used to modify the
23  * Collection as well.
24  *
25  * @see java.lang.RuntimeException
26  */
27 public class ConcurrentModificationException extends RuntimeException {
28 
29     private static final long serialVersionUID = -3666751008965953603L;
30 
31     /**
32      * Constructs a new {@code ConcurrentModificationException} with the current
33      * stack trace filled in.
34      */
ConcurrentModificationException()35     public ConcurrentModificationException() {
36         /*empty*/
37     }
38 
39     /**
40      * Constructs a new {@code ConcurrentModificationException} with the current
41      * stack trace and message filled in.
42      *
43      * @param detailMessage
44      *           the detail message for the exception.
45      */
ConcurrentModificationException(String detailMessage)46     public ConcurrentModificationException(String detailMessage) {
47         super(detailMessage);
48     }
49 
50     /**
51      * Constructs a new {@code ConcurrentModificationException} with the given detail
52      * message and cause.
53      * @since 1.7
54      */
ConcurrentModificationException(String detailMessage, Throwable cause)55     public ConcurrentModificationException(String detailMessage, Throwable cause) {
56         super(detailMessage, cause);
57     }
58 
59     /**
60      * Constructs a new {@code ConcurrentModificationException} with the given cause.
61      * @since 1.7
62      */
ConcurrentModificationException(Throwable cause)63     public ConcurrentModificationException(Throwable cause) {
64         super(cause);
65     }
66 }
67