geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Swapnil Bawaskar (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GEODE-1742) Possible NPE from CqAttributesFactory.getCQListeners
Date Sat, 01 Oct 2016 22:22:22 GMT

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

Swapnil Bawaskar updated GEODE-1742:
------------------------------------
    Fix Version/s: 1.0.0-incubating

> 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
>             Fix For: 1.0.0-incubating
>
>
> 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