struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: rev 51823 - struts/trunk/src/share/org/apache/struts/validator/validwhen
Date Sun, 03 Oct 2004 05:42:02 GMT
Author: niallp
Date: Sat Oct  2 22:42:01 2004
New Revision: 51823

Modified:
   struts/trunk/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.g
   struts/trunk/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.java
Log:
Bug 31514 Do numeric compare when both items convertable to Integer - reported by Yegor Jbanov

Modified: struts/trunk/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.g
==============================================================================
--- struts/trunk/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.g	(original)
+++ struts/trunk/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.g	Sat Oct
 2 22:42:01 2004
@@ -2,7 +2,7 @@
 /*
  * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.g,v
1.7 2004/09/03 18:06:58 niallp Exp $
  * $Revision: 1.7 $
- * $Date: 2004/09/03 18:06:58 $
+ * $Date$
  *
  * Copyright 2003-2004 The Apache Software Foundation.
  * 
@@ -77,8 +77,12 @@
 		    return (v1 != v2);
 		}
 	}
-        if (!Integer.class.isInstance(v1) &&
-	    !Integer.class.isInstance(v2)) {
+      if ((Integer.class.isInstance(v1) ||
+           String.class.isInstance(v1)) &&
+	    (Integer.class.isInstance(v2) ||
+           String.class.isInstance(v2))) {
+	    intCompare = true;
+      } else {
 	    intCompare = false;
 	}
 	if (intCompare) {

Modified: struts/trunk/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.java
==============================================================================
--- struts/trunk/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.java	(original)
+++ struts/trunk/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.java	Sat
Oct  2 22:42:01 2004
@@ -1,9 +1,9 @@
 // $ANTLR 2.7.2: "ValidWhenParser.g" -> "ValidWhenParser.java"$
 
 /*
- * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.java,v
1.10 2004/09/03 18:06:58 niallp Exp $
- * $Revision: 1.10 $
- * $Date: 2004/09/03 18:06:58 $
+ * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/validator/validwhen/ValidWhenParser.g,v
1.7 2004/09/03 18:06:58 niallp Exp $
+ * $Revision: 1.7 $
+ * $Date$
  *
  * Copyright 2003-2004 The Apache Software Foundation.
  * 
@@ -89,8 +89,12 @@
 		    return (v1 != v2);
 		}
 	}
-        if (!Integer.class.isInstance(v1) &&
-	    !Integer.class.isInstance(v2)) {
+      if ((Integer.class.isInstance(v1) ||
+           String.class.isInstance(v1)) &&
+	    (Integer.class.isInstance(v2) ||
+           String.class.isInstance(v2))) {
+	    intCompare = true;
+      } else {
 	    intCompare = false;
 	}
 	if (intCompare) {

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


Mime
View raw message