mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
ENT-3187 Check that we're not calling toList
on concurrent collections (#4828)
* ENT-3165 Kotlin toList() does not work on concurrent collections. OS backport. ENT-3165 Added comment. * ENT-3187 Additional use of toList() on concurrent data structure.
This commit is contained in:
@ -163,7 +163,8 @@ class CordaPersistence(
|
||||
}
|
||||
|
||||
fun onAllOpenTransactionsClosed(callback: () -> Unit) {
|
||||
val allOpen = liveTransactions.values.toList()
|
||||
// Does not use kotlin toList() as that is not safe to use on concurrent collections.
|
||||
val allOpen = ArrayList(liveTransactions.values)
|
||||
if (allOpen.isEmpty()) {
|
||||
callback()
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user