Prevent concurrent modification exception

This commit is contained in:
Terry Brady
2016-09-28 10:21:21 -07:00
parent 4607bb90a6
commit 27e557bd83

View File

@@ -561,10 +561,16 @@ public class ItemImportServiceImpl implements ItemImportService, InitializingBea
{
if (!isTest)
{
ArrayList<Collection> removeList = new ArrayList<>();
List<Collection> collections = myitem.getCollections();
// Remove item from all the collections it's in
// Save items to be removed to prevent concurrent modification exception DS-3322
for (Collection collection : collections) {
removeList.add(collection);
}
// Remove item from all the collections it's in
for (Collection collection : removeList) {
collectionService.removeItem(c, collection, myitem);
}
}