You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "happyziqi (JIRA)" <ji...@apache.org> on 2016/07/29 17:12:20 UTC

[jira] [Comment Edited] (SQOOP-2989) throw nullpointerexception

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

happyziqi edited comment on SQOOP-2989 at 7/29/16 5:12 PM:
-----------------------------------------------------------

 File[] filesAndDirs = aStartingDir.listFiles();
-    List<File> filesDirs = Arrays.asList(filesAndDirs);
-    for (File file : filesDirs) {
-      result.add(file); //always add, even if directory
-      if (!file.isFile()) {                                                /* if file is a reguar file,but it has been deleted before this line, file.isFile()    return false ,the next  getFileListingNoSort() will throw NullPointerException at  line 'List<File> filesDirs = Arrays.asList(filesAndDirs);'  */


-        //must be a directory
-        //recursive call!
-        List<File> deeperList = getFileListingNoSort(file);
-        result.addAll(deeperList);


was (Author: happyziqi):
 File[] filesAndDirs = aStartingDir.listFiles();
-    List<File> filesDirs = Arrays.asList(filesAndDirs);
-    for (File file : filesDirs) {
-      result.add(file); //always add, even if directory
-      if (!file.isFile()) {                                                // if file is a reguar file,but it has been deleted before this line, file.isFile()    return false ,the next  getFileListingNoSort() will throw NullPointerException at  line 'List<File> filesDirs = Arrays.asList(filesAndDirs);'
-        //must be a directory
-        //recursive call!
-        List<File> deeperList = getFileListingNoSort(file);
-        result.addAll(deeperList);

> throw nullpointerexception
> --------------------------
>
>                 Key: SQOOP-2989
>                 URL: https://issues.apache.org/jira/browse/SQOOP-2989
>             Project: Sqoop
>          Issue Type: Bug
>          Components: tools
>            Reporter: happyziqi
>              Labels: newbie
>             Fix For: no-release
>
>         Attachments: nullPinter.patch
>
>
> when the configurable parameter 'bindir' point at a common directory,
> sqoop may throw a NullPointerException  if file in that directory is been deleted during the building jar stage



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)