From cc9f4f71f5fecb225b79e689e8aa6780ba78727f Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 11 Feb 2004 15:59:50 +0000 Subject: [PATCH] Be a little more defensive in a protected method of a non-final public class, PR 26737 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276074 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/DirectoryScanner.java | 8 ++++++++ src/main/org/apache/tools/ant/taskdefs/Javac.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/DirectoryScanner.java b/src/main/org/apache/tools/ant/DirectoryScanner.java index d880e7b42..edb82c3af 100644 --- a/src/main/org/apache/tools/ant/DirectoryScanner.java +++ b/src/main/org/apache/tools/ant/DirectoryScanner.java @@ -808,6 +808,14 @@ public class DirectoryScanner * @see #slowScan */ protected void scandir(File dir, String vpath, boolean fast) { + if (dir == null) { + throw new BuildException("dir must not be null."); + } else if (!dir.exists()) { + throw new BuildException(dir + " doesn't exists."); + } else if (!dir.isDirectory()) { + throw new BuildException(dir + " is not a directory."); + } + // avoid double scanning of directories, can only happen in fast mode if (fast && hasBeenScanned(vpath)) { return; diff --git a/src/main/org/apache/tools/ant/taskdefs/Javac.java b/src/main/org/apache/tools/ant/taskdefs/Javac.java index 1e815b12f..7953508f5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Javac.java +++ b/src/main/org/apache/tools/ant/taskdefs/Javac.java @@ -567,7 +567,7 @@ public class Javac extends MatchingTask { /** * Sets the target VM that the classes will be compiled for. Valid * values depend on the compiler, for jdk 1.4 the valid values are - * "1.1", "1.2", "1.3" and "1.4". + * "1.1", "1.2", "1.3", "1.4" and "1.5". * @param target the target VM */ public void setTarget(String target) {