Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-347

Iterating over the keys of a file-based configuration can cause a ConcurrentModificationException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: 1.6
    • Component/s: File reloading
    • Labels:
      None

      Description

      Some implementations of FileConfiguration return an iterator in their getKeys() method that is directly connected to the underlying data store. When now a reload is performed (which can happen at any time) the data store is modified, and the iterator becomes invalid.

      This behavior is very confusing because ConcurrentModificationExceptions are typically related to multi-threading access. But even if the code performing the iteration is the only instance that accesses the configuration, the exception can be thrown.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              oheger Oliver Heger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: