You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2007/04/23 16:41:23 UTC
svn commit: r531483 -
/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
Author: stevel
Date: Mon Apr 23 07:41:10 2007
New Revision: 531483
URL: http://svn.apache.org/viewvc?view=rev&rev=531483
Log:
Print out the name of the attribute and its value when there is a conversion error
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java?view=diff&rev=531483&r1=531482&r2=531483
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java Mon Apr 23 07:41:10 2007
@@ -77,14 +77,18 @@
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");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org