Relates :
|
|
Relates :
|
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.
|