myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r960696 - in /myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy: DoubleRangeStrategy.java LongRangeStrategy.java
Date Mon, 05 Jul 2010 20:56:33 GMT
Author: gpetracek
Date: Mon Jul  5 20:56:33 2010
New Revision: 960696

URL: http://svn.apache.org/viewvc?rev=960696&view=rev
Log:
EXTVAL-104 thx to Rudy De Busscher

Modified:
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/DoubleRangeStrategy.java
    myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/LongRangeStrategy.java

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/DoubleRangeStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/DoubleRangeStrategy.java?rev=960696&r1=960695&r2=960696&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/DoubleRangeStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/DoubleRangeStrategy.java
Mon Jul  5 20:56:33 2010
@@ -47,8 +47,15 @@ public class DoubleRangeStrategy extends
         DoubleRangeValidator doubleRangeValidator = (DoubleRangeValidator)facesContext.getApplication()
                                                         .createValidator("javax.faces.DoubleRange");
 
-        doubleRangeValidator.setMinimum(annotation.minimum());
-        doubleRangeValidator.setMaximum(annotation.maximum());
+        if(annotation.minimum() != Double.MIN_VALUE)
+        {
+            doubleRangeValidator.setMinimum(annotation.minimum());
+        }
+
+        if(annotation.maximum() != Double.MAX_VALUE)
+        {
+            doubleRangeValidator.setMaximum(annotation.maximum());
+        }
 
         doubleRangeValidator.validate(facesContext, uiComponent, convertedObject);
     }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/LongRangeStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/LongRangeStrategy.java?rev=960696&r1=960695&r2=960696&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/LongRangeStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_1_1/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/baseval/strategy/LongRangeStrategy.java
Mon Jul  5 20:56:33 2010
@@ -47,8 +47,15 @@ public class LongRangeStrategy extends A
         LongRangeValidator longRangeValidator = (LongRangeValidator)facesContext.getApplication()
                                                     .createValidator("javax.faces.LongRange");
 
-        longRangeValidator.setMinimum(annotation.minimum());
-        longRangeValidator.setMaximum(annotation.maximum());
+        if(annotation.minimum() != Long.MIN_VALUE)
+        {
+            longRangeValidator.setMinimum(annotation.minimum());
+        }
+
+        if(annotation.maximum() != Long.MAX_VALUE)
+        {
+            longRangeValidator.setMaximum(annotation.maximum());
+        }
 
         longRangeValidator.validate(facesContext, uiComponent, convertedObject);
     }



Mime
View raw message