Sun's Introspector class does the same thing so this is the expected behavior.

Perhaps a better way to think about how the name changes is that "the
character at the second position" has an impact, not necessarily "the
second character".

For an example, the following class outputs this:

a_B
class

===
public class BeanNameInspector {
        private String a_b;
        public static void main(String[] args) throws Exception {
                BeanInfo beanInfo = 
Introspector.getBeanInfo(BeanNameInspector.class);
                PropertyDescriptor[] propertyDescriptors = 
beanInfo.getPropertyDescriptors();
                for(PropertyDescriptor pd: propertyDescriptors){
                        System.out.println(pd.getName());
                }
        }

        public String getA_B() {
                return a_b;
        }

        public void setA_B(String a_b) {
                this.a_b = a_b;
        }
}
===

Larry


On 5/16/06, Emmanuel Bardet (JIRA) <ibatis-dev@incubator.apache.org> wrote:
ClassInfo dropCase method not checking 2nd char appropriately
-------------------------------------------------------------

         Key: IBATIS-295
         URL: http://issues.apache.org/jira/browse/IBATIS-295
     Project: iBatis for Java
        Type: Bug

  Components: SQL Maps
    Versions: 2.1.6
 Environment: WinXP, Oracle10, 1.4
    Reporter: Emmanuel Bardet
    Priority: Trivial


Hello there,

The test:
if (name.length() == 1 || (name.length() > 1 && 
!Character.isUpperCase(name.charAt(1)))) {
does not deal with non letters.  Thus, a method name "getA_B" gets dropCase to return 
"a_B".

Great work u r doing there though!

Tx

E

Reply via email to