ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r549683 - /ant/core/trunk/src/main/org/apache/tools/ant/util/StringUtils.java
Date Fri, 22 Jun 2007 03:09:26 GMT
Author: mbenson
Date: Thu Jun 21 20:09:25 2007
New Revision: 549683

URL: http://svn.apache.org/viewvc?view=rev&rev=549683
Log:
refine

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/util/StringUtils.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/StringUtils.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/StringUtils.java?view=diff&rev=549683&r1=549682&r2=549683
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/StringUtils.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/StringUtils.java Thu Jun 21 20:09:25
2007
@@ -217,6 +217,7 @@
         //last character isn't a digit
         char c = humanSize.charAt(humanSize.length() - 1);
         if (!Character.isDigit(c)) {
+            int trim = 1;
             switch (c) {
                 case 'K':
                     factor *= KILOBYTE;
@@ -234,9 +235,9 @@
                     factor *= PETABYTE;
                     break;
                 default:
-                    break;
+                    trim = 0;
             }
-            humanSize = humanSize.substring(0, humanSize.length() - 1);
+            humanSize = humanSize.substring(0, humanSize.length() - trim);
         }
         return factor * Long.parseLong(humanSize);
     }



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


Mime
View raw message