TitleRefactoring for parameterizing Java classes
Publication TypeMiscellaneous
Year of Publication2006
AuthorsKieżun A, Ernst MD, Tip F, Fuhrer RM
Date or Month PublishedSeptember 5,
AbstractType safety and expressiveness of many existing Java libraries and their client applications would improve, if the libraries were upgraded to define generic classes. Efficient and accurate tools exist to assist client applications to use generics libraries, but so far the libraries themselves must be parameterized manually, which is a tedious, time-consuming, and error-prone task. We present a type-constraint-based algorithm for converting non-generic libraries to add type parameters. The algorithm handles the full Java language and preserves backward compatibility, thus making it safe for existing clients. Among other features, it is capable of inferring wildcard types and introducing type parameters for mutually-dependent classes. We have implemented the algorithm as a fully automatic refactoring in Eclipse. \par We evaluated our work in two ways. First, our tool parameterized code that was lacking type parameters. We contacted the developers of several of these applications, and in all cases where we received a response, they confirmed that the resulting parameterizations were correct and useful. Second, to better quantify its effectiveness, our tool parameterized classes from already-generic libraries, and we compared the results to those that were created by the libraries' authors. Our tool performed the supersededby = "KiezunETF2007
Downloadshttps://homes.cs.washington.edu/~mernst/pubs/parameterizing-generics-tr.pdf PDF
Citation KeyKiezunETF2006:TR