Converting Java Classes to Use Generics
Tuesday, 10:30, 30 minutes
Daniel von Dincklage, University of Colorado
Amer Diwan, University of Colorado
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
near future. 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 error prone and labor intensive.
We describe a system, \sysnamenospace, that (i) converts non-generic classes
to generic classes and (ii) rewrites the clients of the previously
non-generic class to use the generic class. Our preliminary
to generic classes and (ii) rewrites their clients to use the newly generified classes.
experiments with a number of Java container classes show
that our system is effective in modifying legacy code to use generics.