Browse Source

Make DirectoryScanner work on buggy JVMs where File.list() returns an empty array rather than null for files. PR 50295. Submitted by Daniel Smith

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1036905 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 14 years ago
parent
commit
17d4b3461a
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/DirectoryScanner.java

+ 1
- 1
src/main/org/apache/tools/ant/DirectoryScanner.java View File

@@ -1248,7 +1248,7 @@ public class DirectoryScanner
TokenizedPath newPath = new TokenizedPath(path, newfiles[i]); TokenizedPath newPath = new TokenizedPath(path, newfiles[i]);
File file = new File(dir, newfiles[i]); File file = new File(dir, newfiles[i]);
String[] children = file.list(); String[] children = file.list();
if (children == null) { // probably file
if (children == null || file.isFile()) {
if (isIncluded(newPath)) { if (isIncluded(newPath)) {
accountForIncludedFile(newPath, file); accountForIncludedFile(newPath, file);
} else { } else {


Loading…
Cancel
Save