Community
Participate
Working Groups
Build ID: I20070809-1105 Steps To Reproduce: 1. create a field in a class with second character in Uppercase (eg. tStart ) 2. generate getter and setter 3. methods signature generated are incorrect - public void setTStart(...) - public Date getTStart() instead of - public void settStart(...) - public Date gettStart() More information: This is the JavaDoc of the method Introspector.decapitalize used when converting getter and setter method name to field name: ... * Utility method to take a string and convert it to normal Java variable name capitalization. This normally means converting the first character from upper case to lower case, but in the (unusual) special case when there is more than one character and both the first and second characters are upper case, we leave it alone. * <p> * Thus "FooBah" becomes "fooBah" and "X" becomes "x", but "URL" stays as "URL". ... You can see that in case of a method named getTStart the field retreived is TStart and not tStart. This is not a so unusual case when the bean class is a POJO's that map a database table with fields like T_START
Move to JDT/UI
We are using org.eclipse.jdt.core.NamingConventions.suggestGetter/SetterName(...)
Created attachment 77463 [details] test case getter In this test case there are two nested class named OK and NOOK. The first has a field tStart with getter and setter handmade (gettStart ...) The second has the same field but with getter and setter made by Eclipse (getTStart). Via methods Introspector.getBeanInfo -> beanInfo.getPropertyDescriptors() the first class/field is correctly recognized but the second test fails because the field name for the BeanInfo class is TStart and not tStart.
*** This bug has been marked as a duplicate of bug 154823 ***
Verified for 3.6M1 using I20090802-2000
Verified.