You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2008/08/14 10:12:01 UTC

svn commit: r685801 - /myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java

Author: matzew
Date: Thu Aug 14 01:12:01 2008
New Revision: 685801

URL: http://svn.apache.org/viewvc?rev=685801&view=rev
Log:
TRINIDAD-1179 - Custom message & custom hint message of the length validator not displayed when the minimum attribute is specified and the maximum is not

Thanks to Anita Anandan for the patch

Modified:
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java?rev=685801&r1=685800&r2=685801&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/validator/LengthValidator.java Thu Aug 14 01:12:01 2008
@@ -61,6 +61,11 @@
   {
     int max = getMaximum();
     int min = getMinimum();
+    // If min is specified, and max is not, it implies that max is Integer.MAX_VALUE
+    if (min > 0 && max == 0) 
+    {
+      max = Integer.MAX_VALUE;
+    }
 
     // Only pass down the messages that are relevant to this
     // validator instance, based on the min and max