RENAME FIELDS RULE
This release adds a new semi-automatic rule called “Rename Fields Rule”.
This new rule can be used for finding and renaming the fields that do not comply with the Naming Conventions.
A configuration wizards provides different refactoring options. The user can select fields to be renamed based on the access modifier key (screenshot of the configuration wizard is given below). As soon as a field which doesn’t comply with the naming conventions is found, the rule will search for its references and compute a renaming. The search scope can be set by the user, either to the current project or to the workspace that eclipse is currently using.
The new name is computed based on the existing field’ name and the configuration options that the user can provide on the rule wizard. On the default configuration, the existing field name is converted to camelCase. Furthermore the occurrences of underscores ‘_’ and dollar-signs ‘$’ are removed and the first letter which is following them (if any) is converted to uppercase. Note however, that the user has the possibility to choose in the configuration wizard whether or not to change the first letter after ‘_’/’$’ to uppercase.
Before the renaming is applied to the original sources, a preview wizard will show the changes related to the renaming of each field. Since a non-private field may be accessed in multiple classes, a single renaming may affect more than one file. A tree-style view in the preview wizard will show the the changes to all of the affected files for each renaming. The user has the possibility to ignore a renaming by unchecking the corresponding element in the tree view.
The renaming cannot be performed automatically if:
- The newly computed name is not a valid java variable name.
- The newly computed name clashes with an existing variable name within the same class.
- Logging Rule:
- Fixed a bug where tooltips for checkboxes would not show up at the right position.