ACM Home Page
Please provide us with feedback. Feedback
Converting java programs to use generic libraries
Full text PdfPdf (1.18 MB)
Source Conference on Object Oriented Programming Systems Languages and Applications archive
Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications table of contents
Vancouver, BC, Canada
SESSION: Generics table of contents
Pages: 15 - 34  
Year of Publication: 2004
ISBN:1-58113-831-9
Also published in ...
Authors
Alan Donovan  MIT Computer Science & Artificial Intelligence Lab, Cambridge, MA
Adam Kiežun  MIT Computer Science & Artificial Intelligence Lab, Cambridge, MA
Matthew S. Tschantz  MIT Computer Science & Artificial Intelligence Lab, Cambridge, MA
Michael D. Ernst  MIT Computer Science & Artificial Intelligence Lab, Cambridge, MA
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
SIGSOFT: ACM Special Interest Group on Software Engineering
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 16,   Downloads (12 Months): 68,   Citation Count: 13
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1028976.1028979
What is a DOI?

ABSTRACT

Java 1.5 will include a type system (called JSR-14) that supports <i>parametric polymorphism</i>, or <i>generic</i> 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.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
2
3
 
4
G. Bracha, N. Cohen, C. Kemper, S. Mark, M. Odersky, S.-E. Panitz, D. Stoutamire, K. Thorup, and P. Wadler. Adding generics to the Java programming language: Participant draft specification. Technical report, Sun Microsystems, Apr. 27, 2001.
 
5
G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. GJ specification. http://www.cis.unisa.edu.au/ pizza/gj/Documents/#gj-specification, May 1998.
6
7
8
9
10
11
 
12
OmniCore CodeGuide. http://www.omnicore.com/codeguide.htm.
 
13
B. De Sutter, F. Tip, and J. Dolby. Customization of Java library classes using type constraints and profile information. In ECOOP, June 2004.
 
14
 
15
A. Donovan. Converting Java programs to use generic libraries. Master's thesis, MIT Dept. of EECS, Sept. 2004.
 
16
A. Donovan and M. D. Ernst. Inference of generic types in Java. Technical Report MIT/ LCS/ TR-889, MIT Lab for Computer Science, Mar. 22, 2003.
17
 
18
Eclipse project. http://www.eclipse.org/.
19
 
20
 
21
22
 
23
 
24
JetBrains IntelliJ IDEA. http://www.intellij.com/idea/.
 
25
A. Igarashi, B. C. Pierce, and P. Wadler. A recipe for raw types. In FOOL, London, Jan. 2001.
 
26
 
27
JavaSoft, Sun Microsystems. Prototype for JSR014: Adding generics to the Java programming language v. 1.3. http://jcp.org/jsr/detail/14.html, May 7, 2001.
28
 
29
 
30
R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17(3):348--375, 1978.
31
 
32
33
34
35
 
36
 
37
38
39
 
40
 
41
 
42
F. Tip, R. Fuhrer, J. Dolby, and A. Kiežun. Refactoring techniques for migrating applications to generic Java container classes. IBM Research Report RC 23238, IBM T.J. Watson Research Center, Yorktown Heights, NY, USA, June 2, 2004.
43
44
45
 
46
R. Vallée-Rai, L. Hendren, V. Sundaresan, P. Lam, E. Gagnon, and P. Co. Soot - a Java bytecode optimization framework. In CASCON, pages 125--135, Nov. 1999.
47
 
48
49

CITED BY  13

Collaborative Colleagues:
Alan Donovan: colleagues
Adam Kiežun: colleagues
Matthew S. Tschantz: colleagues
Michael D. Ernst: colleagues