ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Manifest.java
Date Mon, 07 Jul 2003 08:18:39 GMT
bodewig     2003/07/07 01:18:39

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs Manifest.java
  Log:
  Don't merge Class-Path attributes, deal with them like with any other
  attribute - except that they may occur several times, that is.
  
  PR: 21170
  
  Revision  Changes    Path
  1.452     +7 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.451
  retrieving revision 1.452
  diff -u -r1.451 -r1.452
  --- WHATSNEW	3 Jul 2003 21:48:43 -0000	1.451
  +++ WHATSNEW	7 Jul 2003 08:18:38 -0000	1.452
  @@ -39,6 +39,10 @@
     defined in the project.  If you rely on the task waiting for input,
     don't use the addproperty attribute.
   
  +* The Class-Path attribute in manifests will no longer merge the
  +  entries of all manifests found, but will be treated like all other
  +  manifest attributes - the most recent attribute(s) will be used.
  +
   Fixed bugs:
   -----------
   * Filter readers were not handling line endings properly.  Bugzilla
  @@ -181,6 +185,9 @@
   
   * Nested websphere element for ejbjar does not support spaces in file name.
     Bugzilla Report 21298
  +
  +* Don't multiply Class-Path attributes when updating jars.  Bugzilla
  +  Report 21170.
   
   Other changes:
   --------------
  
  
  
  1.43      +12 -4     ant/src/main/org/apache/tools/ant/taskdefs/Manifest.java
  
  Index: Manifest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Manifest.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- Manifest.java	6 Jul 2003 09:57:36 -0000	1.42
  +++ Manifest.java	7 Jul 2003 08:18:39 -0000	1.43
  @@ -459,21 +459,29 @@
               }
   
               Enumeration e = section.getAttributeKeys();
  +            Attribute classpathAttribute = null;
               while (e.hasMoreElements()) {
                   String attributeName = (String) e.nextElement();
                   Attribute attribute = section.getAttribute(attributeName);
  -                if (attributeName.equals(ATTRIBUTE_CLASSPATH) &&
  -                        attributes.containsKey(attributeName)) {
  -                    Attribute ourClassPath = getAttribute(attributeName);
  +                if (attributeName.equals(ATTRIBUTE_CLASSPATH)) {
  +                    if (classpathAttribute == null) {
  +                        classpathAttribute = new Attribute();
  +                        classpathAttribute.setName(ATTRIBUTE_CLASSPATH);
  +                    }
                       Enumeration cpe = attribute.getValues();
                       while (cpe.hasMoreElements()) {
                           String value = (String) cpe.nextElement();
  -                        ourClassPath.addValue(value);
  +                        classpathAttribute.addValue(value);
                       }
                   } else {
                       // the merge file always wins
                       storeAttribute(attribute);
                   }
  +            }
  +
  +            if (classpathAttribute != null) {
  +                // the merge file *always* wins, even for Class-Path
  +                storeAttribute(classpathAttribute);
               }
   
               // add in the warnings
  
  
  

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


Mime
View raw message