Revision: 1490
          http://stripes.svn.sourceforge.net/stripes/?rev=1490&view=rev
Author:   bengunter
Date:     2012-05-17 18:09:19 +0000 (Thu, 17 May 2012)
Log Message:
-----------
Fixed STS-877: Meaningful error message when an "on" in @Validate annotation is 
an empty String

Modified Paths:
--------------
    
branches/1.5.x/stripes/src/net/sourceforge/stripes/validation/ValidationMetadata.java

Modified: 
branches/1.5.x/stripes/src/net/sourceforge/stripes/validation/ValidationMetadata.java
===================================================================
--- 
branches/1.5.x/stripes/src/net/sourceforge/stripes/validation/ValidationMetadata.java
       2012-05-17 17:22:07 UTC (rev 1489)
+++ 
branches/1.5.x/stripes/src/net/sourceforge/stripes/validation/ValidationMetadata.java
       2012-05-17 18:09:19 UTC (rev 1490)
@@ -205,6 +205,14 @@
             this.on = null;
         }
         else {
+            // Check for empty strings in the "on" element
+            for (String s : on) {
+                if (s.isEmpty() || "!".equals(s)) {
+                    throw new IllegalArgumentException(
+                            "@Validate's \"on\" element must not contain empty 
strings");
+                }
+            }
+
             this.on = new HashSet<String>();
             this.onIsPositive = !(on[0].charAt(0) == '!');
             for (String s : on) {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to