AbstractCollection.toArray is not safe for concurrent collections

XMLWordPrintable

    • b87
    • generic
    • generic
    • Verified

      AbstractCollection.toArray assumes that size() is constant during
      method execution. That makes the implementation unsafe for concurrent collections.
      All concurrent collections provided by the JDK must override toArray, and
      any third-party collections must do so as well, but are likely to not notice,
      causing rare unpredictable runtime failures due to the inherent race condition.

            Assignee:
            Martin Buchholz
            Reporter:
            Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: