Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
We have developed a static analysis tool 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:
SchedulerAssignment assignment = cluster.getAssignmentById(td.getId()); if (assignment != null) { cpuNeeded -= getCpuUsed(assignment); memoryNeeded -= getMemoryUsed(assignment); }
the caller have no null checker :ConstraintSolverStrategy#checkSpreadSchedulingValid ConstraintSolverStrategy#checkConstraintsSatisfied.
Attachments
Issue Links
- links to