bodewig     2004/02/11 07:59:50

  Modified:    src/main/org/apache/tools/ant DirectoryScanner.java
               src/main/org/apache/tools/ant/taskdefs Javac.java
  Log:
  Be a little more defensive in a protected method of a non-final public class, 
PR 26737
  
  Revision  Changes    Path
  1.69      +8 -0      ant/src/main/org/apache/tools/ant/DirectoryScanner.java
  
  Index: DirectoryScanner.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- DirectoryScanner.java     9 Feb 2004 21:05:16 -0000       1.68
  +++ DirectoryScanner.java     11 Feb 2004 15:59:50 -0000      1.69
  @@ -808,6 +808,14 @@
        * @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;
  
  
  
  1.120     +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.119
  retrieving revision 1.120
  diff -u -r1.119 -r1.120
  --- Javac.java        9 Feb 2004 21:05:19 -0000       1.119
  +++ Javac.java        11 Feb 2004 15:59:50 -0000      1.120
  @@ -567,7 +567,7 @@
       /**
        * 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) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to