You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Dale Emery (Jira)" <ji...@apache.org> on 2019/12/18 23:48:00 UTC

[jira] [Commented] (GEODE-7592) possible NPE in SystemManagementService

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

Dale Emery commented on GEODE-7592:
-----------------------------------

The {{else if}} block is executed only if {{isManagerCreated()}} returns {{true}}. It returns {{true}} only if {{federatingManager}} is non-{{null}}.

The code will not NPE in the {{else if}}.

> possible NPE in SystemManagementService
> ---------------------------------------
>
>                 Key: GEODE-7592
>                 URL: https://issues.apache.org/jira/browse/GEODE-7592
>             Project: Geode
>          Issue Type: Improvement
>          Components: management
>            Reporter: Bruce J Schuchardt
>            Priority: Major
>
> LGTM is reporting a possible NPE in this code:
> {code:java}
> if (federatingManager != null && federatingManager.isRunning()) {
>   throw new AlreadyRunningException(
>       "Manager is already running");
> }
> boolean needsToBeStarted = false;
> if (!isManagerCreated()) {
>   createManager();
>   needsToBeStarted = true;
> } else if (!federatingManager.isRunning()) {
>   needsToBeStarted = true;
> } {code}
>  
> There is a null check in the first "if" statement but no check in the subsequent "else if" statement.



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