ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs BuildNumber.java
Date Wed, 10 Apr 2002 13:55:48 GMT
bodewig     02/04/10 06:55:48

  Modified:    src/main/org/apache/tools/ant/taskdefs BuildNumber.java
  Log:
  Make sure <buildnumber> doesn't break property immutability rules,
  make it reset the file attribute at the end of execute (bug 7552
  audit).
  
  Revision  Changes    Path
  1.5       +6 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java
  
  Index: BuildNumber.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/BuildNumber.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BuildNumber.java	2 Apr 2002 15:25:45 -0000	1.4
  +++ BuildNumber.java	10 Apr 2002 13:55:48 -0000	1.5
  @@ -71,7 +71,8 @@
    * by one and write it back out into the file.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.4 $ $Date: 2002/04/02 15:25:45 $
  + * @version $Revision: 1.5 $ $Date: 2002/04/10 13:55:48 $
  + * @since Ant 1.5
    * @ant.task name="buildnumber"
    */
   public class BuildNumber
  @@ -111,6 +112,7 @@
       public void execute()
           throws BuildException
       {
  +        File savedFile = m_file; // may be altered in validate
           validate();
   
           final Properties properties = loadProperties();
  @@ -145,11 +147,12 @@
                   {
                   }
               }
  +            m_file = savedFile;
           }
   
           //Finally set the property
  -        getProject().setProperty( DEFAULT_PROPERTY_NAME,
  -                                  String.valueOf( buildNumber ) );
  +        getProject().setNewProperty( DEFAULT_PROPERTY_NAME,
  +                                     String.valueOf( buildNumber ) );
       }
   
       /**
  
  
  

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


Mime
View raw message