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

Juergen Zimmermann (JIRA) noreply at atlassian.com
Tue Apr 28 09:50:17 EDT 2009


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


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