Summary: | improved Rename Refactoring tool | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Hui Liu <liuhui08> | ||||
Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> | ||||
Status: | NEW --- | QA Contact: | |||||
Severity: | enhancement | ||||||
Priority: | P3 | CC: | marcel.bruch, stephan.herrmann | ||||
Version: | 4.5 | ||||||
Target Milestone: | --- | ||||||
Hardware: | PC | ||||||
OS: | Windows 7 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Hui Liu
2015-04-28 08:06:05 EDT
Once a rename refactoring is conducted, 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 From the linked web page I take that you modified existing eclipse plug-ins, right? Don't you think the approach could be implemented as a separate plug-in on top of an unmodified JDT? Copying Marcel, because Code Recommenders might actually be the perfect home for such recommendations? Otherwise, and for now, JDT/UI would be the component we are talking about. (In reply to Stephan Herrmann from comment #2) > From the linked web page I take that you modified existing eclipse plug-ins, > right? Don't you think the approach could be implemented as a separate > plug-in on top of an unmodified JDT? > > Copying Marcel, because Code Recommenders might actually be the perfect home > for such recommendations? > > Otherwise, and for now, JDT/UI would be the component we are talking about. Thanks for your quick response! We have change JDT to get notified once renamings are conducted recently. Detailed changes to JDT and LTK are listed in the attached document. Thanks. Thank you for your quick response! We have changed slightly the JDT and LTK to get notified once renamings are conducted. The changes are listed as follows: 1. Add a method (getJavaElement) to class org.eclipse.jdt.core.refactoring.descriptors.RenameJavaElementDescriptor public IJavaElement getJavaElement() { return this.fJavaElement; } 2. Add an interface (RenameListener) to package org.eclipse.ltk.core.refactoring public interface RenameListener { public void onRename(RefactoringDescriptor descriptor); } 3. Add a static field to class org.eclipse.ltk.core.refactoring.history. RefactoringHistory public static RenameListener renameListener = null; 4.Change method processHistoryNotification(IFileStore, RefactoringHistoryEvent, String) of class org.eclipse.ltk.internal.core.refactoring.history.RefactoringHistorySerializer (adding callback function) if (descriptor != null){ if (org.eclipse.ltk.core.refactoring.history.RefactoringHistory.renameListener != null) org.eclipse.ltk.core.refactoring.history.RefactoringHistory.renameListener.onRename(descriptor); } |