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 Checksum.java
Date Mon, 28 Jan 2002 14:38:40 GMT
bodewig     02/01/28 06:38:40

  Modified:    src/main/org/apache/tools/ant/taskdefs Checksum.java
  Log:
  fix the condition version of <checksum>
  
  Revision  Changes    Path
  1.13      +6 -5      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Checksum.java
  
  Index: Checksum.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Checksum.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Checksum.java	26 Jan 2002 19:41:06 -0000	1.12
  +++ Checksum.java	28 Jan 2002 14:38:39 -0000	1.13
  @@ -360,14 +360,15 @@
                   fis.close();
                   fis = null;
                   byte[] fileDigest = messageDigest.digest ();
  -                StringBuffer checksum = new StringBuffer();
  +                StringBuffer checksumSb = new StringBuffer();
                   for (int i = 0; i < fileDigest.length; i++) {
                       String hexStr = Integer.toHexString(0x00ff & fileDigest[i]);
                       if (hexStr.length() < 2) {
  -                        checksum.append("0");
  +                        checksumSb.append("0");
                       }
  -                    checksum.append(hexStr);
  +                    checksumSb.append(hexStr);
                   }
  +                String checksum = checksumSb.toString();
                   //can either be a property name string or a file
                   Object destination = includeFileMap.get(src);
                   if (destination instanceof java.lang.String) {
  @@ -375,7 +376,7 @@
                       if (isCondition) {
                           checksumMatches = checksum.equals(property);
                       } else {
  -                        project.setProperty(prop, checksum.toString());
  +                        project.setProperty(prop, checksum);
                       }
                   } else if (destination instanceof java.io.File) {
                       if (isCondition) {
  @@ -398,7 +399,7 @@
                       } else {
                           File dest = (File) destination;
                           fos = new FileOutputStream(dest);
  -                        fos.write(checksum.toString().getBytes());
  +                        fos.write(checksum.getBytes());
                           fos.close();
                           fos = null;
                       }
  
  
  

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