Revision: 648
          http://stripes.svn.sourceforge.net/stripes/?rev=648&view=rev
Author:   bengunter
Date:     2007-12-06 20:39:19 -0800 (Thu, 06 Dec 2007)

Log Message:
-----------
Fixed STS-425: @Validate annotation on boolean property isXyz() fails. It now 
checks for get, set and is prefixes.

Modified Paths:
--------------
    
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java

Modified: 
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
===================================================================
--- 
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
   2007-12-06 05:38:35 UTC (rev 647)
+++ 
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
   2007-12-07 04:39:19 UTC (rev 648)
@@ -525,10 +525,16 @@
      * characters and makes the next character lower case.
      */
     protected String getPropertyName(String methodName) {
-        if (methodName.length() > 3)
+        if (methodName.length() > 3
+                && (methodName.startsWith("get") || 
methodName.startsWith("set"))) {
             return methodName.substring(3, 4).toLowerCase() + 
methodName.substring(4);
-        else
+        }
+        else if (methodName.length() > 2 && methodName.startsWith("is")) {
+            return methodName.substring(2, 3).toLowerCase() + 
methodName.substring(3);
+        }
+        else {
             return "";
+        }
     }
 
     /**


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

-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to