1. /*
  2. * @(#)ConcurrentModificationException.java 1.11 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.util;
  11. /**
  12. * This exception may be thrown by methods that have detected concurrent
  13. * modification of a backing object when such modification is not permissible.
  14. * <p>
  15. * For example, it is not permssible for one thread to modify a Collection
  16. * while another thread is iterating over it. In general, the results of the
  17. * iteration are undefined under these circumstances. Some Iterator
  18. * implementations (including those of all the collection implementations
  19. * provided by the SDK) may choose to throw this exception if this behavior is
  20. * detected. Iterators that do this are known as <i>fail-fast</i> iterators,
  21. * as they fail quickly and cleanly, rather that risking arbitrary,
  22. * non-deterministic behavior at an undetermined time in the future.
  23. *
  24. * @author Josh Bloch
  25. * @version 1.11, 02/02/00
  26. * @see Collection
  27. * @see Iterator
  28. * @see ListIterator
  29. * @see Vector
  30. * @see LinkedList
  31. * @see HashSet
  32. * @see Hashtable
  33. * @see TreeMap
  34. * @see AbstractList
  35. * @since 1.2
  36. */
  37. public class ConcurrentModificationException extends RuntimeException {
  38. /**
  39. * Constructs a ConcurrentModificationException with no
  40. * detail message.
  41. */
  42. public ConcurrentModificationException() {
  43. }
  44. /**
  45. * Constructs a <tt>ConcurrentModificationException</tt> with the
  46. * specified detail message.
  47. *
  48. * @param message the detail message pertaining to this exception.
  49. */
  50. public ConcurrentModificationException(String message) {
  51. super(message);
  52. }
  53. }