Refactoring for Parameterizing Java Classes
Adam Kiezun,Michael D. Ernst,Frank Tip,Robert M. Fuhrer +3 more
- 24 May 2007
- pp 437-446
TL;DR: A type- constraint-based algorithm for converting non-generic libraries to add type parameters, which handles the full Java language and preserves backward compatibility, thus making it safe for existing clients.
read more
Abstract: Type safety and expressiveness of many existing Java libraries and their client applications would improve, if the libraries were upgraded to define generic classes. Ef- ficient and accurate tools exist to assist client applications to use generic libraries, but so far the libraries themselves must be parameterized manually, which is a tedious, time-consuming, and error-prone task. We present a type-constraint- based algorithm for converting non-generic libraries to add type parameters. The algorithm handles the full Java language and preserves backward compatibility, thus making it safe for existing clients. Among other features, it is capable of inferring wildcard types and introducing type parameters for mutually-dependent classes. We have implemented the algorithm as a fully automatic refactoring in Eclipse. We evaluated our work in two ways. First, our tool parameterized code that was lacking type parameters. We contacted the developers of several of these applications, and in all cases they confirmed that the resulting parameterizations were correct and useful. Second, to better quantify its effectiveness, our tool parameterized classes from already-generic libraries, and we compared the results to those that were created by the libraries' authors. Our tool performed the refactoring accurately.in 87% of cases the results were as good as those created manually by a human expert, in 9% of cases the tool results were better, and in 4% of cases the tool results were worse.
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
Refactoring for Parameterizing Java Classes
Adam Kiezun,Michael D. Ernst,Frank Tip,Robert M. Fuhrer +3 more
- 24 May 2007
TL;DR: A type- constraint-based algorithm for converting non-generic libraries to add type parameters, which handles the full Java language and preserves backward compatibility, thus making it safe for existing clients.
Systematically refactoring inheritance to delegation in java
Hannes Kegel,Friedrich Steimann +1 more
- 10 May 2008
TL;DR: This work has identified the necessary preconditions and realizable postconditions of the refactoring, and built a tool that can perform it completely automatically and collected evidence of the applicability of theRefactoring and of its capability to deliver on its promises.
Refactoring Java programs for flexible locking
Max Schäfer,Manu Sridharan,Julian Dolby,Frank Tip +3 more
- 21 May 2011
TL;DR: Relocker is presented, an automated tool that assists programmers with refactoring synchronized blocks into ReentrantLocks and ReadWriteLocks, to make exploring the performance tradeoffs among these constructs easier.
Correct refactoring of concurrent java code
Max Schäfer,Julian Dolby,Manu Sridharan,Emina Torlak,Frank Tip +4 more
- 21 Jun 2010
TL;DR: It is shown that a broad range of refactorings are not influenced by concurrency at all, whereas other important refactoring can be made behavior-preserving for correctly synchronized programs by using the proposed framework.
References
•Book
The Java Language Specification
James Gosling,Bill Joy,Guy L. Steele +2 more
- 12 Sep 1996
TL;DR: The Java Language Specification, Second Edition is the definitive technical reference for the Java programming language and provides complete, accurate, and detailed coverage of the syntax and semantics of the Java language.
Simple unification-based type inference for GADTs
Simon Jones,Dimitrios Vytiniotis,Stephanie Weirich,Geoffrey Washburn +3 more
- 16 Sep 2006
TL;DR: Wobbly types are presented, which express in a declarative way the uncertainty caused by the incremental nature of typical type-inference algorithms.
5th international conference on software engineering
TL;DR: This year’s WOW is going away from tradition a little, and is following a new production timeline, so watch out for the WOW staffers walking around with notepads (not the Windows kind) and cameras.
159
Refactoring for Parameterizing Java Classes
Adam Kiezun,Michael D. Ernst,Frank Tip,Robert M. Fuhrer +3 more
- 24 May 2007
TL;DR: A type- constraint-based algorithm for converting non-generic libraries to add type parameters, which handles the full Java language and preserves backward compatibility, thus making it safe for existing clients.