Converting java programs to use generic libraries
Alan Donovan,Adam Kiežun,Matthew S. Tschantz,Michael D. Ernst +3 more
- 01 Oct 2004
- Vol. 39, Iss: 10, pp 15-34
TL;DR: This work presents a technique to determine sound and precise JSR-14 types at each use of a class for which a generic type specification is available, and uses a precise and context-sensitive pointer analysis to determine possible types at allocation sites.
read more
Abstract: Java 1.5 will include a type system (called JSR-14) that supports parametric polymorphism, or generic classes. This will bring many benefits to Java programmers, not least because current Java practice makes heavy use of logically-generic classes, including container classes. Translation of Java source code into semantically equivalent JSR-14 source code requires two steps: parameterization (adding type parameters to class definitions) and instantiation (adding the type arguments at each use of a parameterized class). Parameterization need be done only once for a class, whereas instantiation must be performed for each client, of which there are potentially many more. Therefore, this work focuses on the instantiation problem. We present a technique to determine sound and precise JSR-14 types at each use of a class for which a generic type specification is available. Our approach uses a precise and context-sensitive pointer analysis to determine possible types at allocation sites, and a set-constraint-based analysis (that incorporates guarded, or conditional, constraints) to choose consistent types for both allocation and declaration sites. The technique handles all features of the JSR-14 type system, notably the raw types that provide backward compatibility. We have implemented our analysis in a tool that automatically inserts type parameters into Java code, and we report its performance when applied to a number of real-world Java programs.
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
Refinement-based context-sensitive points-to analysis for Java
Manu Sridharan,Rastislav Bodik +1 more
- 11 Jun 2006
TL;DR: This work has developed a refinement-based analysis that succeeds by simultaneously refining handling of method calls and heap accesses, allowing the analysis to precisely analyze important code while entirely skipping irrelevant code.
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.
Efficiently refactoring java applications to use generic libraries
Robert M. Fuhrer,Frank Tip,Adam Kiezun,Julian Dolby,Markus Keller +4 more
- 25 Jul 2005
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.
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.
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.
References
•Book
The C++ Programming Language
Bjarne Stroustrup
- 01 Jan 1985
TL;DR: Bjarne Stroustrup makes C even more accessible to those new to the language, while adding advanced information and techniques that even expert C programmers will find invaluable.
8.1K
•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.
A theory of type polymorphism in programming
TL;DR: This work presents a formal type discipline for polymorphic procedures in the context of a simple programming language, and a compile time type-checking algorithm w which enforces the discipline.
2.6K
On understanding types, data abstraction, and polymorphism
Luca Cardelli,Peter Wegner +1 more
TL;DR: A λ-calculus-based model for type systems that allows us to explore the interaction among the concepts of type, data abstraction, and polymorphism in a simple setting, unencumbered by complexities of production programming languages is developed.
Soot: a Java bytecode optimization framework
Raja Vallée-Rai,Phong Co,Etienne Gagnon,Laurie Hendren,Patrick Lam,Vijay Sundaresan +5 more
- 01 Nov 2010
TL;DR: Soot, a framework for optimizing Java* bytecode, is implemented in Java and supports three intermediate representations for representing Java bytecode: Baf, a streamlined representation of bytecode which is simple to manipulate; Jimple, a typed 3-address intermediate representation suitable for optimization; and Grimp, an aggregated version of Jimple suitable for decompilation.
Related Papers (5)
Daniel von Dincklage,Amer Diwan +1 more
- 01 Oct 2004
Martin Fowler
- 01 Jan 1999
Ittai Balaban,Frank Tip,Robert M. Fuhrer +2 more
- 12 Oct 2005
Adam Kiezun,Michael D. Ernst,Frank Tip,Robert M. Fuhrer +3 more
- 24 May 2007