[ 
https://issues.apache.org/jira/browse/SLING-12160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17787137#comment-17787137
 ] 

Konrad Windszus edited comment on SLING-12160 at 11/17/23 11:13 AM:
--------------------------------------------------------------------

I think this may happen when the {{MappingEntries}} are modified while 
iterating through 
https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/a314ef3ce2e826bfde26493738ed94316c18bfbf/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L246

Even in master (although now due to refactoring in a different line) this may 
still happen in 
https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/938fbfd176c58a9fb5bc5d18a37b47eb5c3c53bd/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L297.


was (Author: kwin):
I think this may happen when the {{MappingEntries}} are modified while 
iterating through 
https://github.com/apache/sling-org-apache-sling-resourceresolver/blob/a314ef3ce2e826bfde26493738ed94316c18bfbf/src/main/java/org/apache/sling/resourceresolver/impl/mapping/ResourceMapperImpl.java#L246

> ConcurrentModificationException in ResourceMapperImpl.readAliases()
> -------------------------------------------------------------------
>
>                 Key: SLING-12160
>                 URL: https://issues.apache.org/jira/browse/SLING-12160
>             Project: Sling
>          Issue Type: Bug
>          Components: ResourceResolver
>    Affects Versions: Resource Resolver 1.7.10
>            Reporter: Konrad Windszus
>            Priority: Major
>
> I have seen the following exception with Resource Resolver 1.7.10 triggered 
> by calling {{ResourceResolver.map(...)}}
> {code}
> java.util.ConcurrentModificationException
>       at 
> java.base/java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719)
>       at 
> java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:751)
>       at 
> java.base/java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:749)
>       at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
>       at 
> java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
>       at 
> java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
>       at 
> java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
>       at 
> java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
>       at 
> java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
>       at 
> java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
>       at 
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImpl.readAliases(ResourceMapperImpl.java:249)
>       at 
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImpl.loadAliasesIfApplicable(ResourceMapperImpl.java:209)
>       at 
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImpl.getAllMappings(ResourceMapperImpl.java:147)
>       at 
> org.apache.sling.resourceresolver.impl.mapping.ResourceMapperImpl.getMapping(ResourceMapperImpl.java:73)
>       at 
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl.map(ResourceResolverImpl.java:444)
>       at 
> org.apache.sling.resourceresolver.impl.ResourceResolverImpl.map(ResourceResolverImpl.java:431)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to