XStream
  1. XStream
  2. XSTR-679

ConcurrentModificationException when using DefaultConverterLookup

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • JDK version and platform:
      Java HotSpot Server VM "1.6.0_07"; Linux

      Description

      I get a ConcurrentModificationException when using DefaultConverterLookup from multiple threads. The reason is that accesses to the 'converters' list are not synchronized. I attach a minimal example to reproduce the problem. Executing it sometimes leads to the exception (see stack trace below).

      Thanks for fixing this issue!

      Exception in thread "Thread-13791" java.util.ConcurrentModificationException
      at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1100)
      at java.util.TreeMap$KeyIterator.next(TreeMap.java:1154)
      at com.thoughtworks.xstream.core.util.PrioritizedList$PrioritizedItemIterator.next(PrioritizedList.java:91)
      at com.thoughtworks.xstream.core.DefaultConverterLookup.flushCache(DefaultConverterLookup.java:78)
      at MinimalDefaultConverterLookupTest$2.run(MinimalDefaultConverterLookupTest.java:26)

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Michael Pradel
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: