[hibernate-issues] [Hibernate-JIRA] Commented: (HV-149) ReflectionHelper.containsMethod ignores "is" methods

Juergen Zimmermann (JIRA) noreply at atlassian.com
Mon May 4 14:33:17 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33081#action_33081 ] 

Juergen Zimmermann commented on HV-149:
---------------------------------------

I checked out trunk: the "is" methods are recognized! Thanks for the immediate response.

> ReflectionHelper.containsMethod ignores "is" methods
> ----------------------------------------------------
>
>                 Key: HV-149
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-149
>             Project: Hibernate Validator
>          Issue Type: Bug
>    Affects Versions: 4.0.0.Beta1
>            Reporter: Juergen Zimmermann
>             Fix For: 4.0.0.Beta2
>
>
> Line 399 of ReflectionHelper looks as follows:
> clazz.getMethod( "get" + methodName.substring( 0, 1 ).toUpperCase() + methodName.substring( 1 ) );
> However, if you have a boolean property, then the get method requires the prefix "is", e.g.
> private boolean female;
> public boolean isFemale() { return female; }  // prefix "is", not "get"
> public void setFemale(boolean female) { this.female = female;  }
> This handling is important for methods being annotated with @AssertTrue and @AssertFalse

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list