Proceedings/Proceedings - International Conference on Software Engineering · 2007 · 57 citations · 14 references
ComputingComputer ScienceProgramming LanguagesSoftware EngineeringSystems ProgrammingApplication Programming InterfacesObject-oriented ProgrammingParameterizationSoftware RefactoringType CheckingType SystemsBackward CompatibilityConstraint-based Type CheckingError-prone RepairParameterized TypesRefactoringType Parameterization
Type 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 generic 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. 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 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 refactoring accurately-in 87% of cases the results were as good as those created manually by a human expert, in 9% of cases the tool results were better, and in 4% of cases the tool results were worse.
14
Making the future safe for the past
Gilad Bracha, Martin Odersky, David Stoutamire et al. · 1998 · 503 citations · Full text
Simple unification-based type inference for GADTs
Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich et al. · 2006 · 336 citations
Refactoring support for class library migration
Ittai Balaban, Frank Tip, Robert M. Fuhrer · 2005 · 142 citations
Refactoring for generalization using type constraints
Frank Tip, Adam Kieżun, Dirk Bäumer · 2003 · 125 citations
Converting java programs to use generic libraries
Alan Donovan, Adam Kieżun, Matthew S. Tschantz et al. · 2004 · 61 citations · Full text