Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-60

ChangeSet does not synchronise whilst using the Iterator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.0
    • None
    • None

    Description

      ChangeSet does not synchronize whilst using the Iterator on the Set "changes" which is a synchronizedSet.

      The Javadoc for Collections.synchronizedSet says: "
      ...
      It is imperative that the user manually synchronize on the returned set when iterating over it:
      ...
      Failure to follow this advice may result in non-deterministic behavior."

      This affects the add() and perfom() methods.

      Also, the asSet() method returns a reference to the Set. This method does not seem to be used at present, so perhaps could be removed.
      Otherwise, it should either return a copy of the set, or the Javadoc should point out that any iteration over the set must synchronize on the set.

      Attachments

        Activity

          People

            grobmeier Christian Grobmeier
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: