Converting Java classes to use generics

  • Authors:
  • Daniel von Dincklage;Amer Diwan

  • Affiliations:
  • University of Colorado;University of Colorado

  • Venue:
  • OOPSLA '04 Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Generics offer significant software engineering benefits since they provide code reuse without compromising type safety. Thus generics will be added to the Java language in the next release. While this extension to Java will help programmers when they are writing new code, it will not help legacy code unless it is rewritten to use generics. In our experience, manually modifying existing programs to use generics is complex and can be error prone and labor intensive. We describe a system, Ilwith, that (i) converts non-generic classes to generic classes and (ii) rewrites their clients to use the newly generified classes. Our experiments with a number of Java container classes show that our system is effective in modifying legacy code to use generics.