Refactoring Generic Java Programs Based on Type Inference

Lin CHEN,Bao-wen XU,Xiao-yu ZHOU,Jing CAO
2007-01-01
Tien Tzu Hsueh Pao/Acta Electronica Sinica
Abstract:Generalization is an important category of refactorings, preconditions of which depend on the type constraints of the program. The existing automatic generalization refactoring methods do not solve the type constraints of parameterized type in generic programs, which results in the type-incorrect problem after refactoring. In this paper we present a serial of type inference rules for generic Java programs. Type constraints can be solved via traversing a type constraint graph according to the rules. Automatic refactoring algorithms for Extract Interface and Pull Up Members are proposed. The algorithms can preserve type-correctness and run in a linear time with the size of the refactored program.
What problem does this paper attempt to address?