com.ibatis.common.beans.ProbeException: There is no READABLE property named 
'I_PARAM_INT_1'
-------------------------------------------------------------------------------------------

                 Key: IBATIS-379
                 URL: https://issues.apache.org/jira/browse/IBATIS-379
             Project: iBatis for Java
          Issue Type: Bug
          Components: SQL Maps
    Affects Versions: 2.3.0, 2.2.0
         Environment: jre 1.5
Windows XP 
eclipse / WebSphereStudio
tomcat / WebSphere
Oracle 9.x
            Reporter: Marcello Finessi
            Priority: Critical


Hi the IBATIS team.

I've a java Bean with a getter method named getI_PARAM_INT_1 that returns an 
int type.

I've noted that the method dropCase in class com.ibatis.common.beans.ClassInfo 
does not work properly for names like this.

the code ...
 if (name.length() == 1 || (name.length() > 1 && 
!Character.isUpperCase(name.charAt(1)))) {
      name = name.substring(0, 1).toLowerCase(Locale.US) + name.substring(1);
    }...

will cause the assignement of: name ="i_PARAM_INT_1" because the if condition 
does not consider that could exists the character  '_' 
in fact the expression     !Character.isUpperCase(name.charAt(1))  that is 
!Character.isUpperCase('_') returns true.

This cause an error like this:  com.ibatis.common.beans.ProbeException: There 
is no READABLE property named 'I_PARAM_INT_1'


I  think that the condition should be completed considering just alphabetics 
characters. Like this?....
 if (name.length() == 1 || (name.length() > 1 &&   
Character.isLetter(name.charAt(1)) &&  !Character.isUpperCase(name.charAt(1)))) 
{


Thank you.



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

        

Reply via email to