[
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:30 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()) {
/*even if file is a reguar file having nothing to do with the current running
sqoop job ,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);' Link file will case
the same Exception */
- //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()) {
/*even 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);' Link file will case the same Exception */
- //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)