Program |
 |
|
|
Find in Program |
 |
|
|
Page |
 |
|
|
Basket |
 |
|
view, help
"Converting Java Programs to Use Generic Libraries"
|
|
|
|
Converting Java Programs to Use Generic Libraries
Ballroom A-B Tuesday, 11:00, 30 minutes 7 | · | 8 | · | 9 | · | 10 | · | 11 | · | 12 | · | 13 | · | 14 | · | 15 | · | 16 | · | 17 | · | 18 | · | 19 | · | 20 | · | 21 |
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.
|