Open AccessJournal Article
Efficiently refactoring java applications to use generic libraries
2
TL;DR: This work presents a refactoring that replaces raw references to generic library classes with parameterized references, and infers actual type parameters for allocation sites and declarations using an existing framework of type constraints, and removes casts that have been rendered redundant.
read more
Abstract: Java 1.5 generics enable the creation of reusable container classes with compiler-enforced type-safe usage. This eliminates the need for potentially unsafe down-casts when retrieving elements from containers. We present a refactoring that replaces raw references to generic library classes with parameterized references. The refactoring infers actual type parameters for allocation sites and declarations using an existing framework of type constraints, and removes casts that have been rendered redundant. The refactoring was implemented in Eclipse, a popular open-source development environment for Java, and laid the grounds for a similar refactoring in the forthcoming Eclipse 3.1 release. We evaluated our work by refactoring several Java programs that use the standard collections framework to use Java 1.5's generic version instead. In these benchmarks, on average, 48.6%' of the casts are removed, and 91.2% of the compiler warnings related to the use of raw types are eliminated. Our approach distinguishes itself from the state-of-the-art [8] by being more scalable, by its ability to accommodate user-defined subtypes of generic library classes, and by being incorporated in a popular integrated development environment.
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
ANDROMEDA: accurate and scalable security analysis of web applications
Omer Tripp,Marco Pistoia,Patrick Cousot,Radhia Cousot,Salvatore A. Guarnieri +4 more
- 16 Mar 2013
TL;DR: The key observation informing the approach is that taint analysis is a demand-driven problem, which enables lazy computation of vulnerable information flows, instead of eagerly computing a complete data-flow solution, which is the reason for the traditional dichotomy between scalability and precision.
Generic sensitivity: customizing context-sensitive pointer analysis for generics
Hao Li,Jie Lu,Haining Meng,Liqing Cao,Yongheng Huang,Liang Li,Lin Gao +6 more
- 07 Nov 2022
TL;DR: In this paper , a new context customization scheme targeting generics is proposed, which enhances contexts with a type variable lookup map, which is efficiently updated during the analysis in a context-sensitive manner.
Related Papers (5)
J. Rajesh,Dharanipragada Janakiram +1 more
- 24 Aug 2004
Jongwook Kim,Don Batory,Danny Dig,Maider Azanza +3 more
- 14 May 2016