Book Chapter10.1007/11531142_4
Efficiently refactoring java applications to use generic libraries
Robert M. Fuhrer,Frank Tip,Adam Kiezun,Julian Dolby,Markus Keller +4 more
- 25 Jul 2005
- pp 71-96
TL;DR: In this paper, the authors present a refactoring that replaces raw references to generic library classes with parameterized references, which eliminates the need for potentially unsafe downcast when retrieving elements from containers.
read more
Abstract: Java 1.5 generics enable the creation of reusable container classes with compiler-enforced type-safe usage. This eliminates the need for potentially unsafe down-casts when retrieving elements from containers. We present a refactoring that replaces raw references to generic library classes with parameterized references. The refactoring infers actual type parameters for allocation sites and declarations using an existing framework of type constraints, and removes casts that have been rendered redundant. The refactoring was implemented in Eclipse, a popular open-source development environment for Java, and laid the grounds for a similar refactoring in the forthcoming Eclipse 3.1 release. We evaluated our work by refactoring several Java programs that use the standard collections framework to use Java 1.5's generic version instead. In these benchmarks, on average, 48.6% of the casts are removed, and 91.2% of the compiler warnings related to the use of raw types are eliminated. Our approach distinguishes itself from the state-of-the-art [8] by being more scalable, by its ability to accommodate user-defined subtypes of generic library classes, and by being incorporated in a popular integrated development environment.
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
SPOON: A library for implementing analyses and transformations of Java source code
Renaud Pawlak,Martin Monperrus,Martin Monperrus,Nicolas Petitprez,Carlos Noguera,Lionel Seinturier,Lionel Seinturier +6 more
TL;DR: SPOON enables Java developers to write a large range of domain‐specific analyses and transformations in an easy and concise manner and developers do not need to dive into parsing, to hack a compiler infrastructure, or to master a new formalism.
ANDROMEDA: accurate and scalable security analysis of web applications
Omer Tripp,Marco Pistoia,Patrick Cousot,Radhia Cousot,Salvatore A. Guarnieri +4 more
- 16 Mar 2013
TL;DR: The key observation informing the approach is that taint analysis is a demand-driven problem, which enables lazy computation of vulnerable information flows, instead of eagerly computing a complete data-flow solution, which is the reason for the traditional dichotomy between scalability and precision.
Refactoring for reentrancy
Jan Wloka,Manu Sridharan,Frank Tip +2 more
- 24 Aug 2009
TL;DR: This work presents a mostly-automated refactoring that makes existing Java programs reentrant by replacing global state with thread-local state and performing each execution in a fresh thread.
81
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.
Spoon: Program Analysis and Transformation in Java
Renaud Pawlak,Carlos Noguera,Nicolas Petitprez +2 more
- 01 Jan 2006
TL;DR: Spoon is an open and extensible Java compiler, written in pure Java by using Compile-time reflection techniques, and takes advantage of the new features added by Java 5, and particularly of annotations and generics.
References
•Book
Refactoring: Improving the Design of Existing Code
Martin Fowler
- 01 Jan 1999
TL;DR: Almost every expert in Object-Oriented Development stresses the importance of iterative development, but how do you add function to the existing code base while still preserving its design integrity?
•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.
Refactoring improving the design of existing code
Mauricio A. Saca
- 01 Nov 2017
TL;DR: The present document details the how, why and when to apply refactoring in computer systems that have been poorly designed, this in order to a better performance and maintenance of the constituent components.
4.1K
Featherweight Java: a minimal core calculus for Java and GJ
TL;DR: This work extends Featherweight Java with generic classes in the style of GJ and gives a detailed proof of type safety, which formalizes for the first time some of the key features ofGJ.
Featherweight Java: a minimal core calculus for Java and GJ
Atsushi Igarashi,Benjamin C. Pierce,Philip Wadler +2 more
- 01 Oct 1999
TL;DR: A proof of type safety for Featherweight Java illustrates many of the interesting features of a safety proof for the full language, while remaining pleasingly compact.
Related Papers (5)
Martin Fowler
- 01 Jan 1999
Adam Kiezun,Michael D. Ernst,Frank Tip,Robert M. Fuhrer +3 more
- 24 May 2007
Daniel von Dincklage,Amer Diwan +1 more
- 01 Oct 2004