You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Robert Munteanu (Jira)" <ji...@apache.org> on 2020/10/15 09:17:00 UTC

[jira] [Closed] (SLING-9722) AbstractSlingRepositoryManager.stop throws NullPointerExceptions if invoked multiple times

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

Robert Munteanu closed SLING-9722.
----------------------------------

> AbstractSlingRepositoryManager.stop throws NullPointerExceptions if invoked multiple times
> ------------------------------------------------------------------------------------------
>
>                 Key: SLING-9722
>                 URL: https://issues.apache.org/jira/browse/SLING-9722
>             Project: Sling
>          Issue Type: Bug
>          Components: JCR
>    Affects Versions: JCR Base 3.1.4
>            Reporter: Robert Munteanu
>            Assignee: Robert Munteanu
>            Priority: Major
>             Fix For: JCR Base 3.1.6
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> The stop method has a check for the currentThread
> {code:java}
>         if ( startupThread != Thread.currentThread() ) {
>             waitForStartupThreadToComplete();
>             startupThread = null;
>         }
> {code}
> On the first invocation, the {{startupThread}} is not null, the if block is entered and the field is then set to null. On subsequent invocations, the condition will also be true, since {{startupThread == null}}, which will cause an NPE in the {{waitForStartupThreadToComplete}} method.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)