[ 
https://issues.apache.org/jira/browse/YARN-6517?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15984472#comment-15984472
 ] 

Weiwei Yang commented on YARN-6517:
-----------------------------------

Hi [~wilfreds]

Appreciate that you to duplicate your work with this one and thanks for your 
comments. Quite helpful.

bq. A lot of indentation changes to re-use a return statement in both changes...
bq. If we simplify the change to return an empty set, we could pass 0 to the 
HashSet constructor given that we don't reuse it.

Both are good suggestions, I've done that in latest patch. Thanks.

bq. Checking procfsDir for null will hide the case of an incorrect 
configuration. This currently could only happen in test cases but it could hide 
a broken test and would be careful doing this.

Like you said, that's better to have some better logic to handle the 
possibility of a null {{procfsDir}}, removed this check from this patch since 
it aims to fix the findbugs warning.

Thanks

> Fix warnings from Spotbugs in hadoop-yarn-common
> ------------------------------------------------
>
>                 Key: YARN-6517
>                 URL: https://issues.apache.org/jira/browse/YARN-6517
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Weiwei Yang
>            Assignee: Weiwei Yang
>              Labels: findbugs
>         Attachments: YARN-6517.001.patch
>
>
> There are 2 findbugs warnings in hadoop-yarn-common project since switched to 
> spotbugs,
> # Possible null pointer dereference in 
> org.apache.hadoop.yarn.logaggregation.AggregatedLogFormat$LogValue.getPendingLogFilesToUpload(File)
>  due to return value of called method
> # Possible null pointer dereference in 
> org.apache.hadoop.yarn.util.ProcfsBasedProcessTree.getProcessList() due to 
> return value of called method
> see more in 
> [https://builds.apache.org/job/PreCommit-HADOOP-Build/12157/artifact/patchprocess/branch-findbugs-hadoop-yarn-project_hadoop-yarn_hadoop-yarn-common-warnings.html]



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to