ACM Home Page
Please provide us with feedback. Feedback
Sound and extensible renaming for java
Full text PdfPdf (261 KB)
Source
Conference on Object Oriented Programming Systems Languages and Applications archive
Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications table of contents
Nashville, TN, USA
SESSION: Refactoring table of contents
Pages 277-294  
Year of Publication: 2008
ISBN:978-1-60558-215-3
Also published in ...
Authors
Max Schäfer  University of Oxford, Oxford, United Kingdom
Torbjörn Ekman  University of Oxford, Oxford, United Kingdom
Oege de Moor  University of Oxford, Oxford, United Kingdom
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 17,   Downloads (12 Months): 199,   Citation Count: 1
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1449764.1449787
What is a DOI?

ABSTRACT

Descriptive names are crucial to understand code. However, good names are notoriously hard to choose and manually changing a globally visible name can be a maintenance nightmare. Hence, tool support for automated renaming is an essential aid for developers and widely supported by popular development environments.

This work improves on two limitations in current refactoring tools: too weak preconditions that lead to unsoundness where names do not bind to the correct declarations after renaming, and too strong preconditions that prevent renaming of certain programs. We identify two main reasons for unsoundness: complex name lookup rules make it hard to define sufficient preconditions, and new language features require additional preconditions. We alleviate both problems by presenting a novel extensible technique for creating symbolic names that are guaranteed to bind to a desired entity in a particular context by inverting lookup functions. The inverted lookup functions can then be tailored to create qualified names where otherwise a conflict would occur, allowing the refactoring to proceed and improve on the problem with too strong preconditions.

We have implemented renaming for Java as an extension to the JastAdd Extensible Java Compiler and integrated it in Eclipse. We show examples for which other refactoring engines have too weak preconditions, as well as examples where our approach succeeds in renaming entities by inserting qualifications. To validate the extensibility of the approach we have implemented renaming support for Java 5 and AspectJ like inter-type declarations as modular extensions to the initial Java 1.4 refactoring engine. The renaming engine is only a few thousand lines of code including extensions and performance is on par with industrial strength refactoring tools.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
2
 
3
AspectJ Development Tools 1.5.1. http://www.eclipse.org/ajdt.
 
4
John Brant and Don Roberts. The Smalltalk Refactoring Browser. http://st-www.cs.uiuc.edu/users/brant/Refactory/, 1999.
5
6
 
7
Márcio Lopes Cornélio. Refactorings as Formal Refinements. Ph.D. thesis, Universidade Federal de Pernambuco, 2004.
8
9
 
10
Eclipse 3.3.1. http://www.eclipse.org, 2007.
 
11
Torbjörn Ekman, Ran Ettinger, Max Schäfer, and Mathieu Verbaere. Refactoring bugs in Eclipse, IDEA and Visual Studio, 2008. http://progtools.comlab.ox.ac.uk/refactoring/bugreports.
 
12
Torbjörn Ekman and Görel Hedin. Modular name analysis for Java using JastAdd. In Generative and Transformational Techniques in Software Engineering, International Summer School, GTTSE 2005, volume 4143 of LNCS. Springer, 2006.
13
 
14
Ran Ettinger. Refactoring via Program Slicing and Sliding. D.Phil. thesis, Computing Laboratory, Oxford, UK, 2007.
 
15
Martin Fowler. Refactoring: improving the design of existing code. Addison Wesley, 2000.
 
16
 
17
 
18
Stefan Hanenberg, Christian Oberschulte, and Rainer Unland. Refactoring of Aspect-Oriented Software. In Net.ObjectDays, 2003.
 
19
JBuilder 2007. http://www.codegear.com/products/jbuilder, 2007.
 
20
IntelliJ IDEA 7.0.1. http://www.jetbrains.com, 2007.
 
21
 
22
Netbeans 6.0. http://www.netbeans.com, 2007.
 
23
William F. Opdyke and Ralph E. Johnson. Refactoring: An aid in designing application frameworks and evolving object-oriented systems. In Proceedings of Symposium on Object-Oriented Programming Emphasizing Practical Applications (SOOPPA), September 1990.
 
24
 
25
 
26
Semmle. SemmleCode. http://semmle.com, 2008.
27
 
28
The AspectJ Team. The AspectJ Programming Guide.
29
30
31
 
32
w3c. Jigsaw. http://www.w3.org/Jigsaw/, 2006.
 
33
David Wheeler. SLOCCount. http://www.dwheeler.com/sloccount/, 2006.


Collaborative Colleagues:
Max Schäfer: colleagues
Torbjörn Ekman: colleagues
Oege de Moor: colleagues