tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1197681 - /tomcat/taglibs/rdc/trunk/taglibs-rdc/src/main/java/org/apache/taglibs/rdc/Number.java
Date Fri, 04 Nov 2011 17:31:46 GMT
Author: olamy
Date: Fri Nov  4 17:31:46 2011
New Revision: 1197681

URL: http://svn.apache.org/viewvc?rev=1197681&view=rev
Log:
fix compilation

Modified:
    tomcat/taglibs/rdc/trunk/taglibs-rdc/src/main/java/org/apache/taglibs/rdc/Number.java

Modified: tomcat/taglibs/rdc/trunk/taglibs-rdc/src/main/java/org/apache/taglibs/rdc/Number.java
URL: http://svn.apache.org/viewvc/tomcat/taglibs/rdc/trunk/taglibs-rdc/src/main/java/org/apache/taglibs/rdc/Number.java?rev=1197681&r1=1197680&r2=1197681&view=diff
==============================================================================
--- tomcat/taglibs/rdc/trunk/taglibs-rdc/src/main/java/org/apache/taglibs/rdc/Number.java
(original)
+++ tomcat/taglibs/rdc/trunk/taglibs-rdc/src/main/java/org/apache/taglibs/rdc/Number.java
Fri Nov  4 17:31:46 2011
@@ -128,11 +128,13 @@ public class Number extends BaseModel {
      */
     protected Boolean validate(Object newValue, boolean setErrorCode) {
 
-        if (maxValue != null && maxValue.compareTo(newValue) < 0) {
+        if (! (newValue instanceof Double)) return Boolean.FALSE;
+
+        if (maxValue != null && maxValue.compareTo((Double)newValue) < 0) {
             if (setErrorCode) setErrorCode(ERR_NEED_SHORTER_NUMBER);
             return Boolean.FALSE;
         }
-        if (minValue != null && minValue.compareTo(newValue) > 0) {
+        if (minValue != null && minValue.compareTo((Double)newValue) > 0) {
             if (setErrorCode) setErrorCode(ERR_NEED_LONGER_NUMBER);
             return Boolean.FALSE;
         }



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


Mime
View raw message