[ https://issues.apache.org/jira/browse/YARN-8164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
lujie updated YARN-8164: ------------------------ Description: 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. Callee FairScheduler#getAppsInQueue can return null {code:java} public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null;//here } } {code} it has 4 callers, three of them have null checker, one does not have. In this issue we post a patch which can add !=null based on existed !=null check. was: 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. Callee FairScheduler#getAppsInQueue can return null {code:java} public List<ApplicationAttemptId> getAppsInQueue(String queueName) { FSQueue queue = queueMgr.getQueue(queueName); if (queue == null) { return null;//here } } {code} it has 4 callers, three of them have null checker, one dost not have. In this issue we post a patch which can add !=null based on existed !=null check. > Fix an Potential NPE > --------------------- > > Key: YARN-8164 > URL: https://issues.apache.org/jira/browse/YARN-8164 > Project: Hadoop YARN > Issue Type: Bug > Reporter: lujie > Priority: Major > > 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. > Callee FairScheduler#getAppsInQueue can return null > {code:java} > public List<ApplicationAttemptId> getAppsInQueue(String queueName) { > FSQueue queue = queueMgr.getQueue(queueName); > if (queue == null) { > return null;//here > } > } > {code} > it has 4 callers, three of them have null checker, one does not have. In this > issue we post a patch which can add !=null based on existed !=null check. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org