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

Hudson commented on HDFS-1934:
------------------------------

Integrated in Hadoop-Hdfs-trunk #685 (See 
[https://builds.apache.org/hudson/job/Hadoop-Hdfs-trunk/685/])
    HDFS-1934. Fix NullPointerException when certain File APIs return null. 
Contributed by Bharath Mundlapudi.

mattf : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1130262
Files : 
* 
/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java
* 
/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/datanode/FSDataset.java
* /hadoop/hdfs/trunk/CHANGES.txt


> Fix NullPointerException when File.listFiles() API returns null
> ---------------------------------------------------------------
>
>                 Key: HDFS-1934
>                 URL: https://issues.apache.org/jira/browse/HDFS-1934
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Bharath Mundlapudi
>            Assignee: Bharath Mundlapudi
>             Fix For: 0.23.0
>
>         Attachments: HDFS-1934-1.patch, HDFS-1934-2.patch, HDFS-1934-3.patch, 
> HDFS-1934-4.patch, HDFS-1934-5.patch
>
>
> While testing Disk Fail Inplace, We encountered the NPE from this part of the 
> code. 
> File[] files = dir.listFiles();
> for (File f : files) {
> ...
> }
> This is kinda of an API issue. When a disk is bad (or name is not a 
> directory), this API (listFiles, list) return null rather than throwing an 
> exception. This 'for loop' throws a NPE exception. And same applies to 
> dir.list() API.
> Fix all the places where null condition was not checked.
>  

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to