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 Jar.java Zip.java
Date Tue, 09 Apr 2002 15:21:24 GMT
bodewig     02/04/09 08:21:24

  Modified:    src/main/org/apache/tools/ant/taskdefs Jar.java Zip.java
  Log:
  In <zip> and <jara> only reset internal state at the end of execute,
  not the attributes and child elements obtained via configuration.
  
  Add a new method that allows the task instances to be reset to their
  unconfigured state.
  
  PR: 7552
  
  Revision  Changes    Path
  1.44      +14 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java
  
  Index: Jar.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Jar.java,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- Jar.java	4 Apr 2002 14:08:17 -0000	1.43
  +++ Jar.java	9 Apr 2002 15:21:24 -0000	1.44
  @@ -455,15 +455,28 @@
       /**
        * Make sure we don't think we already have a MANIFEST next time this task
        * gets executed.
  +     *
  +     * @see Zip#cleanUp
        */
       protected void cleanUp() {
           super.cleanUp();
   
  +        manifest = null;
  +    }
  +
  +    /**
  +     * reset to default values.
  +     *
  +     * @see Zip#reset
  +     *
  +     * @since 1.44, Ant 1.5
  +     */
  +    public void reset() {
  +        super.reset();
           configuredManifest = null;
           filesetManifest = null;
           mergeManifests = false;
           mergeManifestsMain = false;
  -        manifest = null;
           manifestFile = null;
           index = false;
       }
  
  
  
  1.72      +20 -1     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java
  
  Index: Zip.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- Zip.java	15 Mar 2002 02:36:33 -0000	1.71
  +++ Zip.java	9 Apr 2002 15:21:24 -0000	1.72
  @@ -846,14 +846,33 @@
        *
        * <p>When we get here, the Zip file has been closed and all we
        * need to do is to reset some globals.</p>
  +     *
  +     * <p>This method will only reset globals that have been changed
  +     * during execute(), it will not alter the attributes or nested
  +     * child elements.  If you want to reset the instance so that you
  +     * can later zip a completely different set of files, you must use
  +     * the reset method.</p>
  +     *
  +     * @see #reset
        */
       protected void cleanUp() {
           addedDirs.clear();
           addedFiles.removeAllElements();
  +        entries.clear();
  +    }
  +
  +    /**
  +     * Makes this instance reset all attributes to their default
  +     * values and forget all children.
  +     *
  +     * @since 1.72, Ant 1.5
  +     *
  +     * @see #cleanUp
  +     */
  +    public void reset() {
           filesets.removeAllElements();
           zipFile = null;
           baseDir = null;
  -        entries.clear();
           groupfilesets.removeAllElements();
           duplicate = "add";
           archiveType = "zip";
  
  
  

--
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