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

Robert Joseph Evans reassigned STORM-3048:
------------------------------------------

    Assignee: lujie

> A Potential NPE
> ---------------
>
>                 Key: STORM-3048
>                 URL: https://issues.apache.org/jira/browse/STORM-3048
>             Project: Apache Storm
>          Issue Type: Bug
>            Reporter: lujie
>            Assignee: lujie
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> We have developed a static analysis tool 
> [NPEDetector|https://github.com/lujiefsi/NPEDetector] to find some potential 
> NPE. Our analysis shows that some callees may return null in corner case(e.g. 
> node crash , IO exception), some of their callers have  _!=null_ check but 
> some do not have. 
> *Bug:*
> Cluster#getAssignmentById has 20 callers, 18 callers have null checker like 
> this:
> {code:java}
> SchedulerAssignment assignment = cluster.getAssignmentById(td.getId());
> if (assignment != null) {
>     cpuNeeded -= getCpuUsed(assignment);
>      memoryNeeded -= getMemoryUsed(assignment);
> }
> {code}
> the caller have no null checker 
> :ConstraintSolverStrategy#checkSpreadSchedulingValid 
> ConstraintSolverStrategy#checkConstraintsSatisfied.



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

Reply via email to