sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Pauls (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (SLING-8006) IndexOutOfBoundsException in ResourceProviderTracker.setObservationReporterGenerator
Date Thu, 01 Nov 2018 17:13:00 GMT

     [ https://issues.apache.org/jira/browse/SLING-8006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Karl Pauls closed SLING-8006.
-----------------------------

> IndexOutOfBoundsException in ResourceProviderTracker.setObservationReporterGenerator
> ------------------------------------------------------------------------------------
>
>                 Key: SLING-8006
>                 URL: https://issues.apache.org/jira/browse/SLING-8006
>             Project: Sling
>          Issue Type: Bug
>          Components: ResourceResolver
>    Affects Versions: Resource Resolver 1.6.6
>            Reporter: Karl Pauls
>            Assignee: Karl Pauls
>            Priority: Major
>             Fix For: Resource Resolver 1.6.8
>
>
> When a ResourceProvider goes away while being activated, we remove it from the list of
handlers for a given path. However, we don't remove the empty list of handlers in the case
where it was the only available handler for a given path. 
> That can lead to a problem later on where we assume that if we have a list of handlers
for a path it will at least contain one handler (and just use .get(0)). This happens in the
ResourceProviderTracker.setObservationReporterGenerator method and will cause IOOB Exceptions
from that point onwards.
> Looks like this:
> {noformat}
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>         at java.util.ArrayList.rangeCheck(ArrayList.java:657)
>         at java.util.ArrayList.get(ArrayList.java:433)
>         at org.apache.sling.resourceresolver.impl.providers.ResourceProviderTracker.setObservationReporterGenerator(ResourceProviderTracker.java:155)

>         at org.apache.sling.resourceresolver.impl.observation.ResourceChangeListenerWhiteboard.updateProviderTracker(ResourceChangeListenerWhiteboard.java:109)

>         at org.apache.sling.resourceresolver.impl.observation.ResourceChangeListenerWhiteboard.access$100(ResourceChangeListenerWhiteboard.java:44)

>         at org.apache.sling.resourceresolver.impl.observation.ResourceChangeListenerWhiteboard$1.addingService(ResourceChangeListenerWhiteboard.java:88)

>         at org.apache.sling.resourceresolver.impl.observation.ResourceChangeListenerWhiteboard$1.addingService(ResourceChangeListenerWhiteboard.java:64)

> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message