Technical Program
  Invited Speakers
  Technical Papers
  Practitioner Reports
Educators' Symposium
Doctoral Symposium
Student Research Comp.
Turing Lecture
Social Events
Week at a Glance
Final Program (1.5M .pdf)

Find in Program


view, help

"Converting Java Programs to Use Generic Libraries"
Object-Oriented Programming, Systems, Languages and Applications
Home    Program    Housing & Transportation    Registration    Submissions    Wiki    Maps
  > Technical Program > Technical Papers > Generics

 : Tuesday

Converting Java Programs to Use Generic Libraries

Ballroom A-B
Tuesday, 11:00, 30 minutes


Alan Donovan, MIT
Adam Kiezun, MIT
Michael D. Ernst, MIT

Future versions of Java's type system (called JSR-14) will include support for 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 actual parameters 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 is to use a precise and context-sensitive concrete class analysis to determine possible types at allocation sites, and a set-constraint-based analysis to choose consistent types for both allocation and declaration sites. 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.