Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5066785

Spec for ConcurrentModificationException does not admit snapshot iterators

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 5.0
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b58
    • CPU:
      generic
    • OS:
      generic

      Description

      The spec for ConcurrentModificationException says:

        "Some Iterator implementations (including those of all the collection
        implementations provided by the JRE) may choose to throw this exception
        if this behavior is detected"

      However, several new collections ((EnumSet, CopyOnWriteArrayList, CopyOnWriteArraySet) have "snapshot iterators" that do not throw ConcurrentModificationException under these circumstances. Thus, we should add some "wiggle words" to the above spec. Suggested change:


        "Some Iterator implementations (including those of all the *general purpose*
        collection implementations provided by the JRE) may choose to throw this
        exception if this behavior is detected"

      (The asterisks denote added prose, not emphasis; they should not be present
      in the documentation.)

        Attachments

          Activity

            People

            Assignee:
            darcy Joe Darcy
            Reporter:
            jjb Josh Bloch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: