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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]