ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Replace.java Touch.java PathConvert.java Concat.java
Date Tue, 04 Jan 2005 19:11:59 GMT
jkf         2005/01/04 11:11:59

  Modified:    src/main/org/apache/tools/ant/taskdefs Replace.java
                        Touch.java PathConvert.java Concat.java
  Log:
  Minor style updates.
  
  Revision  Changes    Path
  1.59      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/Replace.java
  
  Index: Replace.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- Replace.java	13 Dec 2004 16:01:18 -0000	1.58
  +++ Replace.java	4 Jan 2005 19:11:58 -0000	1.59
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000-2004 The Apache Software Foundation
  + * Copyright  2000-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -173,7 +173,7 @@
           }
   
           /**
  -         * Set the token to replace,
  +         * Set the token to replace.
            * @param token <code>String</code> token.
            */
           public void setToken(String token) {
  
  
  
  1.44      +13 -14    ant/src/main/org/apache/tools/ant/taskdefs/Touch.java
  
  Index: Touch.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Touch.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- Touch.java	17 Dec 2004 12:03:58 -0000	1.43
  +++ Touch.java	4 Jan 2005 19:11:58 -0000	1.44
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2000-2004 The Apache Software Foundation
  + * Copyright  2000-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -22,7 +22,6 @@
   import java.text.DateFormat;
   import java.text.ParseException;
   import java.text.SimpleDateFormat;
  -import java.util.Date;
   import java.util.Locale;
   import java.util.Vector;
   import org.apache.tools.ant.BuildException;
  @@ -34,7 +33,6 @@
   import org.apache.tools.ant.types.FileList;
   import org.apache.tools.ant.util.FileUtils;
   import org.apache.tools.ant.util.FileNameMapper;
  -import org.apache.tools.ant.util.JavaEnvUtils;
   
   /**
    * Touch a file and/or fileset(s) and/or filelist(s);
  @@ -174,12 +172,13 @@
   
       /**
        * Add a <code>FileNameMapper</code>.
  -     * @param mapper the <code>FileNameMapper</code> to add.
  +     * @param fileNameMapper the <code>FileNameMapper</code> to add.
        * @since Ant 1.6.3
  +     * @throws BuildException if multiple mappers are added.
        */
  -    public void add(FileNameMapper fileNameMapper) {
  +    public void add(FileNameMapper fileNameMapper) throws BuildException {
           if (this.fileNameMapper != null) {
  -            throw new BuildException( "Only one mapper may be added to the "
  +            throw new BuildException("Only one mapper may be added to the "
                   + getTaskName() + " task.");
           }
           this.fileNameMapper = fileNameMapper;
  @@ -203,10 +202,10 @@
   
       /**
        * Check that this task has been configured properly.
  -     * @throws <code>BuildException</code> if configuration errors are detected.
  +     * @throws BuildException if configuration errors are detected.
        * @since Ant 1.6.3
        */
  -    protected synchronized void checkConfiguration() {
  +    protected synchronized void checkConfiguration() throws BuildException {
           if (file == null && filesets.size() + filelists.size() == 0) {
               throw new BuildException("Specify at least one source"
                                      + "--a file, filelist or a fileset.");
  @@ -253,22 +252,22 @@
   
       /**
        * Execute the touch operation.
  -     * @throws <code>BuildException</code> if an error occurs.
  +     * @throws BuildException if an error occurs.
        */
  -    public void execute() {
  +    public void execute() throws BuildException {
           checkConfiguration();
           touch();
       }
   
       /**
        * Does the actual work; assumes everything has been checked by now.
  -     * @throws <code>BuildException</code> if an error occurs.
  +     * @throws BuildException if an error occurs.
        */
  -    protected void touch() {
  +    protected void touch() throws BuildException {
           long defaultTimestamp = getTimestamp();
   
           if (file != null) {
  -            touch(fileUtils.getParentFile(file), file.getName(), defaultTimestamp);
  +            touch(file.getParentFile(), file.getName(), defaultTimestamp);
           }
           // deal with the filesets
           for (int i = 0; i < filesets.size(); i++) {
  @@ -323,7 +322,7 @@
               String[] mapped = fileNameMapper.mapFileName(filename);
               if (mapped != null && mapped.length > 0) {
                   long modTime = (f.exists()) ? f.lastModified() : defaultTimestamp;
  -                for (int i = 0; i < mapped.length ; i++) {
  +                for (int i = 0; i < mapped.length; i++) {
                       touch(getProject().resolveFile(mapped[i]), modTime);
                   }
               }
  
  
  
  1.35      +2 -2      ant/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
  
  Index: PathConvert.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/PathConvert.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- PathConvert.java	6 Dec 2004 19:27:13 -0000	1.34
  +++ PathConvert.java	4 Jan 2005 19:11:58 -0000	1.35
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2001-2004 The Apache Software Foundation
  + * Copyright  2001-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -361,7 +361,7 @@
               // case-insensitive.
               String fromDirSep = onWindows ? "\\" : "/";
   
  -            StringBuffer rslt = new StringBuffer(100);
  +            StringBuffer rslt = new StringBuffer();
   
               // Get the list of path components in canonical form
               String[] elems = path.list();
  
  
  
  1.40      +3 -3      ant/src/main/org/apache/tools/ant/taskdefs/Concat.java
  
  Index: Concat.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Concat.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- Concat.java	11 Dec 2004 22:43:05 -0000	1.39
  +++ Concat.java	4 Jan 2005 19:11:59 -0000	1.40
  @@ -1,5 +1,5 @@
   /*
  - * Copyright  2002-2004 The Apache Software Foundation
  + * Copyright  2002-2005 The Apache Software Foundation
    *
    *  Licensed under the Apache License, Version 2.0 (the "License");
    *  you may not use this file except in compliance with the License.
  @@ -480,7 +480,7 @@
               + " files to " + destinationFile);
           FileOutputStream out = null;
           FileInputStream in = null;
  -        byte[] buffer = new byte[8 * 1024];
  +        byte[] buffer = new byte[BUFFER_SIZE];
           try {
               try {
                   out = new FileOutputStream(destinationFile);
  @@ -713,7 +713,7 @@
            * @throws BuildException if the file does not exist, or cannot be
            *                        read
            */
  -        public void setFile(File file) {
  +        public void setFile(File file) throws BuildException {
               // non-existing files are not allowed
               if (!file.exists()) {
                   throw new BuildException("File " + file + " does not exist.");
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message