Description
The follow stack (based on 2.2.x source) shows AttachmentDeserializer.cacheStreamedAttachments (1) is looping on the LazyAttachmentCollection.attachments List.
for (Attachment a : attachments.getLoadedAttachments()) {
...
}
And, DelegatingInputStream.close() (2) triggers LazyAttachmentCollection.hasNext() (3) to insert new item to LazyAttachmentCollection.attachments List which causes ConcurrentModificationException
Thread [main] (Suspended)
(3) LazyAttachmentCollection.hasNext() line: 64
AttachmentDeserializer.markClosed(DelegatingInputStream) line: 319
(2) DelegatingInputStream.close() line: 47
AttachmentDataSource.cache() line: 51
(1) AttachmentDeserializer.cacheStreamedAttachments() line: 227
AttachmentDeserializer.readNext() line: 192
LazyAttachmentCollection.loadAll() line: 52
LazyAttachmentCollection.size() line: 108