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

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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: