Converting java programs to use generic libraries

Author:

Donovan Alan1,Kiežun Adam1,Tschantz Matthew S.1,Ernst Michael D.1

Affiliation:

1. MIT Computer Science & Artificial Intelligence Lab, Cambridge, MA

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.

Publisher

Association for Computing Machinery (ACM)

Subject

Computer Graphics and Computer-Aided Design,Software

Reference47 articles.

1. Type inclusion constraints and type inference

2. Fast static analysis of C++ virtual function calls

3. G. Bracha M. Odersky D. Stoutamire and P. Wadler. GJ specification. http://www.cis.unisa.edu.au/ pizza/gj/Documents/#gj-specification May 1998. G. Bracha M. Odersky D. Stoutamire and P. Wadler. GJ specification. http://www.cis.unisa.edu.au/ pizza/gj/Documents/#gj-specification May 1998.

Cited by 15 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. Automated refactoring of legacy Java software to enumerated types;Automated Software Engineering;2016-12-10

2. Inference rules for generic code migration of aspect-oriented programs;Science of Computer Programming;2013-08

3. A Comprehensive Approach to Naming and Accessibility in Refactoring Java Programs;IEEE Transactions on Software Engineering;2012-11

4. Inference and Checking of Object Ownership;ECOOP 2012 – Object-Oriented Programming;2012

5. Refactoring using type constraints;ACM Transactions on Programming Languages and Systems;2011-04

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3