geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Smith (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (GEODE-1742) Possible NPE from CqAttributesFactory.getCQListeners
Date Wed, 10 Aug 2016 17:31:20 GMT

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

Dan Smith reassigned GEODE-1742:
--------------------------------

    Assignee: Dan Smith

> Possible NPE from CqAttributesFactory.getCQListeners 
> -----------------------------------------------------
>
>                 Key: GEODE-1742
>                 URL: https://issues.apache.org/jira/browse/GEODE-1742
>             Project: Geode
>          Issue Type: Bug
>          Components: client queues
>            Reporter: Dan Smith
>            Assignee: Dan Smith
>
> This method checks to see if cqListeners is null outside of synchronization. Other methods
can set cqListeners to be null after this check but before cqListeners is used, resulting
in an NPE
> {code}
>     public CqListener[] getCqListeners() {
>       if (this.cqListeners == null){
>         return CqAttributesImpl.EMPTY_LISTENERS;
>       }
>       
>       CqListener[] result = null;
>       synchronized(this.clSync){   
> //Here, cqListeners may have been set to null by another method
>         result = new CqListener[cqListeners.size()];
>         cqListeners.toArray(result);
>       }
>       return result;
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message