ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r531483 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/AntVersion.java
Date Mon, 23 Apr 2007 14:41:23 GMT
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


Mime
View raw message