Rename Expander
1.
Introduction
Rename
Expander identifies renaming opportunities
by expanding conducted renamings. Once a rename refactoring is conducted
manually or with tool support, the proposed approach recommends to rename
closely related software entities whose names are similar to that of the
renamed entity. The rationale is that if an engineer makes a mistake in naming
a software entity it is likely for her to make the same mistake in naming
similar and closely related software entities. The main advantage of the
proposed approach is that it does not involve difficult semantic analysis of
source code or complex natural language understanding. Another advantage of
this approach is that it is less influenced by subjective factors, e.g.,
experience and preference of software engineers.
2.
How to Install
Eclipse: the tool is tested on Kepler
Service Release 2. We expect it to
work on any Eclipse that relies on jdt.core.manipulation_1.5.0
Files
needed:
RenameExpander jdt.core.manipulation ltk.core.refactoring
Installation:
1)
Copy all of the
three jar files into the plugins folder of your Eclipse (recommended)
e.g., C:\eclipse\plugins
2) Install via the update site:
http://www.sei.pku.edu.cn/~liuhui04/tools/rename/RnameExpandUpdateSite
* The update site cannot replace the
jdt or ltk plugins (that are distributed with Eclipse) with the customized
versions. Consequently, if you install the Rename
Expander via update site, please manually copy the following two jar files
into the plugins folder of your Eclipse.
jdt.core.manipulation ltk.core.refactoring
3.
How to Use
1) Open Java Editor
and select a software entity to rename
2) Rename the selected
entity (with rename refactoring tool provided by Eclipse)
3) The tool tries to
recommend renaming opportunities. If any opportunities are identified, the red
mark is presented on the left margin beside the renamed entity.
4) Click on the red
mark, and suggestions are presented as follows
5)
6) Double click the
suggestion, and the cursor goes to the suggested entity that needs to be
renamed
7) If you decide to
rename it, the tool will try to recommend new renamings based on it.
*The
Java document used through as the illustrating example in this document is PreprocessPanel.java of open-source application
Weka 3-3-4. You can try it to make sure the tool has
been installed successfully.
4.
Source Code
The source code could be download here. You can change and redistribute
the source code as you will.
5.
Video