ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sbaill...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Checksum.java
Date Sat, 26 Jan 2002 19:41:06 GMT
sbailliez    02/01/26 11:41:06

  Modified:    src/main/org/apache/tools/ant/taskdefs Checksum.java
  Log:
  Fix violations
  
  Revision  Changes    Path
  1.12      +5 -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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Checksum.java	25 Jan 2002 16:15:44 -0000	1.11
  +++ Checksum.java	26 Jan 2002 19:41:06 -0000	1.12
  @@ -360,13 +360,13 @@
                   fis.close();
                   fis = null;
                   byte[] fileDigest = messageDigest.digest ();
  -                String checksum = "";
  +                StringBuffer checksum = new StringBuffer();
                   for (int i = 0; i < fileDigest.length; i++) {
                       String hexStr = Integer.toHexString(0x00ff & fileDigest[i]);
                       if (hexStr.length() < 2) {
  -                        checksum += "0";
  +                        checksum.append("0");
                       }
  -                    checksum += hexStr;
  +                    checksum.append(hexStr);
                   }
                   //can either be a property name string or a file
                   Object destination = includeFileMap.get(src);
  @@ -375,7 +375,7 @@
                       if (isCondition) {
                           checksumMatches = checksum.equals(property);
                       } else {
  -                        project.setProperty(prop, checksum);
  +                        project.setProperty(prop, checksum.toString());
                       }
                   } else if (destination instanceof java.io.File) {
                       if (isCondition) {
  @@ -398,7 +398,7 @@
                       } else {
                           File dest = (File) destination;
                           fos = new FileOutputStream(dest);
  -                        fos.write(checksum.getBytes());
  +                        fos.write(checksum.toString().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