Browse Source

Print out the name of the attribute and its value when there is a conversion error

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@531483 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 18 years ago
parent
commit
07b3f5e912
1 changed files with 9 additions and 5 deletions
  1. +9
    -5
      src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java

+ 9
- 5
src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java View File

@@ -77,14 +77,18 @@ public class AntVersion extends Task implements Condition {
if (null == atLeast && null == exactly) {
throw new BuildException("One of atleast or exactly must be set.");
}
try {
if (atLeast != null) {
if (atLeast != null) {
try {
new DeweyDecimal(atLeast);
} else {
} catch (NumberFormatException e) {
throw new BuildException("The 'atleast' attribute is not a Dewey Decimal eg 1.1.0 : " + atLeast);
}
} else {
try {
new DeweyDecimal(exactly);
} catch (NumberFormatException e) {
throw new BuildException("The 'exactly' attribute is not a Dewey Decimal eg 1.1.0 : " + exactly);
}
} catch (NumberFormatException e) {
throw new BuildException("The argument is not a Dewey Decimal eg 1.1.0");
}
}



Loading…
Cancel
Save