ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/util SourceFileScanner.java
Date Mon, 01 Oct 2001 07:44:42 GMT
conor       01/10/01 00:44:42

  Modified:    src/main/org/apache/tools/ant Target.java
               src/main/org/apache/tools/ant/util SourceFileScanner.java
  Log:
  Merge across fixes from 1.4 branch
  
  Revision  Changes    Path
  1.24      +20 -3     jakarta-ant/src/main/org/apache/tools/ant/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Target.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -w -u -r1.23 -r1.24
  --- Target.java	2001/09/30 13:21:53	1.23
  +++ Target.java	2001/10/01 07:44:42	1.24
  @@ -83,11 +83,28 @@
       public void setDepends(String depS) {
           if (depS.length() > 0) {
               StringTokenizer tok =
  -                new StringTokenizer(depS, ",", false);
  +                new StringTokenizer(depS, ",", true);
               while (tok.hasMoreTokens()) {
                   String token = tok.nextToken().trim();
  -                if (!token.equals("")) {
  +
  +                //Make sure the dependency is not empty string
  +                if (token.equals("") || token.equals(",")) {
  +                    throw new BuildException( "Syntax Error: Depend attribute " +
  +                                              "for target \"" + getName() + 
  +                                              "\" has an empty string for dependency."
);
  +                }
  +
                       addDependency(token);
  +                
  +                //Make sure that depends attribute does not
  +                //end in a ,
  +                if (tok.hasMoreTokens()) {
  +                    token = tok.nextToken();
  +                    if (!tok.hasMoreTokens() || !token.equals(",")) {
  +                        throw new BuildException( "Syntax Error: Depend attribute " +
  +                                                  "for target \"" + getName() + 
  +                                                  "\" ends with a , character" );
  +                    }
                   }
               }
           }
  
  
  
  1.7       +7 -1      jakarta-ant/src/main/org/apache/tools/ant/util/SourceFileScanner.java
  
  Index: SourceFileScanner.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/util/SourceFileScanner.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -w -u -r1.6 -r1.7
  --- SourceFileScanner.java	2001/09/30 13:21:54	1.6
  +++ SourceFileScanner.java	2001/10/01 07:44:42	1.7
  @@ -121,7 +121,13 @@
                   continue;
               }
   
  -            File src = fileUtils.resolveFile(srcDir, files[i]);
  +            File src = null;
  +            if (srcDir == null) {
  +                src = new File(files[i]);
  +            } else {
  +                src = fileUtils.resolveFile(srcDir, files[i]);
  +            }
  +
               if (src.lastModified() > now) {
                   task.log("Warning: "+files[i]+" modified in the future.", 
                            Project.MSG_WARN);
  
  
  

Mime
View raw message