Merge pull request #1536 from terrywbrady/ds3322

[DS-3322] Prevent concurrent modification exception in Undo Bulk Ingest

At +2, merging
This commit is contained in:
Terry Brady
2016-09-28 13:59:56 -07:00
committed by GitHub

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);
}
}