Browse Source

Bugzilla Report 48835 StringUtils.parseHumanSizes() should turn parse failures into BuildExceptions.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1028755 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 14 years ago
parent
commit
f2453ec2ac
2 changed files with 11 additions and 1 deletions
  1. +4
    -0
      WHATSNEW
  2. +7
    -1
      src/main/org/apache/tools/ant/util/StringUtils.java

+ 4
- 0
WHATSNEW View File

@@ -254,6 +254,10 @@ Other changes:
in verbose runs.
Bugzilla Report 48836.

* StringUtils.parseHumanSizes() should turn parse failures into
BuildExceptions.
Bugzilla Report 48835.

Changes from Ant 1.8.0 TO Ant 1.8.1
===================================



+ 7
- 1
src/main/org/apache/tools/ant/util/StringUtils.java View File

@@ -17,6 +17,8 @@
*/
package org.apache.tools.ant.util;

import org.apache.tools.ant.BuildException;

import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Vector;
@@ -239,7 +241,11 @@ public final class StringUtils {
}
humanSize = humanSize.substring(0, humanSize.length() - trim);
}
return factor * Long.parseLong(humanSize);
try {
return factor * Long.parseLong(humanSize);
} catch (NumberFormatException e) {
throw new BuildException("Failed to parse \"" + humanSize + "\"", e);
}
}

/**


Loading…
Cancel
Save