commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r293556 - /jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/GenericTypeValidator.java
Date Tue, 04 Oct 2005 07:07:45 GMT
Author: niallp
Date: Tue Oct  4 00:07:32 2005
New Revision: 293556

URL: http://svn.apache.org/viewcvs?rev=293556&view=rev
Log:
Fix Bug 36878 - GenericTypeValidator does not accept negative Floats/Doubles, reported by
Henning Moll.

Modified:
    jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/GenericTypeValidator.java

Modified: jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/GenericTypeValidator.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/GenericTypeValidator.java?rev=293556&r1=293555&r2=293556&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/GenericTypeValidator.java
(original)
+++ jakarta/commons/proper/validator/trunk/src/share/org/apache/commons/validator/GenericTypeValidator.java
Tue Oct  4 00:07:32 2005
@@ -293,7 +293,7 @@
 
             // If there was no error      and we used the whole string
             if (pos.getErrorIndex() == -1 && pos.getIndex() == value.length()) {
-                if (num.doubleValue() >= (Float.MIN_VALUE * -1) &&
+                if (num.doubleValue() >= (Float.MAX_VALUE * -1) &&
                     num.doubleValue() <= Float.MAX_VALUE) {
                     result = new Float(num.floatValue());
                 }
@@ -345,7 +345,7 @@
 
             // If there was no error      and we used the whole string
             if (pos.getErrorIndex() == -1 && pos.getIndex() == value.length()) {
-                if (num.doubleValue() >= (Double.MIN_VALUE * -1) &&
+                if (num.doubleValue() >= (Double.MAX_VALUE * -1) &&
                     num.doubleValue() <= Double.MAX_VALUE) {
                     result = new Double(num.doubleValue());
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message