| Summary: | [getter setter][rename] "Rename field" doesn't recognize getter and setter methods | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Gerrit <buglist> | ||||
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
| Status: | RESOLVED INVALID | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P4 | CC: | daniel_megert, deepakazad, markus.kell.r, Olivier_Thomann | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Gerrit
Created attachment 198391 [details]
An example class.
If I try to rename the field iCount in this example, the Eclipse refactoring doesn't recognize the methods getICount() and setICount(int) as getter and setter methods of that field. The checkboxes "Rename getter method" and "Rename setter method" are disabled in the "Rename field" dialog.
It definitly worked in Version 3.3.2 (Build id: M20080221-1800). Moving to JDT/UI Indeed, this works as described till 3.4, but not from 3.5 onward. With no field prefixes defined, for a field named 'iCount' we expect the getter and setter names as Till 3.4 - getICount() and setICount(int) Since 3.5 - getiCount() and setiCount(int) I prefer the old behavior. Markus ? (In reply to comment #4) > Indeed, this works as described till 3.4, but not from 3.5 onward. > > With no field prefixes defined, for a field named 'iCount' we expect the getter > and setter names as > > Till 3.4 - getICount() and setICount(int) > Since 3.5 - getiCount() and setiCount(int) > > I prefer the old behavior. Markus ? This probably got changed with bug 38111. Both can be seen as correct depending on the personal taste. The discussion about this (if needed) should be done in a separate bug. Regarding this bug here: we should be more open when trying to rename the getters and setters and ignore the casing of the first character after get/set. Deepak, please take a look. The behavior change in 3.5 is due to bug 154823, which aligned our behavior with the Java Beans specification. If you set "i" as field prefix on the Java Code Style page in the project properties, then the Rename Field refactoring identifies get/setCount() methods as getter/setter for field iCount. I don't think we should change anything here. |