Applying Generalization Refactoring to Java Generic Programs

In generalization refactoring, preconditions and allowable source code modifications depend on type constraints of the refactored program. Type constraints of parameterized types should be considered when applying the refactoring to generic programs, otherwise type errors may be brought into the refactored program. Some type constraint rules for Java generic programs are presented to verify the preconditions in the refactoring. The type constraints can be solved by traversing a type constraint graph. Based on the type constraint graph, a refactoring algorithm for extract interface is proposed.

[1]  William F. Opdyke,et al.  Refactoring object-oriented frameworks , 1992 .

[2]  William L. Scherlis,et al.  Models of thumb: assuring best practice source code in large java software systems , 2002 .

[3]  Jens Palsberg,et al.  Object-oriented type systems , 1994, Wiley professional computing.

[4]  Michael D. Ernst,et al.  Converting java programs to use generic libraries , 2004, OOPSLA '04.

[5]  James Gosling,et al.  The Java Language Specification, 3rd Edition , 2005 .

[6]  Scott F. Smith,et al.  Precise Constraint-Based Type Inference for Java , 2001, ECOOP.

[7]  Thomas W. Reps,et al.  Program generalization for software reuse: from C to C++ , 1996, SIGSOFT '96.

[8]  Frank Tip,et al.  Refactoring support for class library migration , 2005, OOPSLA '05.

[9]  Frank Tip,et al.  Refactoring for generalization using type constraints , 2003, OOPSLA '03.

[10]  Amer Diwan,et al.  Converting Java classes to use generics , 2004, OOPSLA '04.

[11]  Frank Tip,et al.  Efficiently Refactoring Java Applications to Use Generic Libraries , 2005, ECOOP.

[12]  Martin Fowler,et al.  Refactoring - Improving the Design of Existing Code , 1999, Addison Wesley object technology series.

[13]  Christopher Seguin Refactoring tool challenges in a strongly typed language (poster session) , 2000, OOPSLA '00.

[14]  Frank Tip,et al.  Refactoring Techniques for Migrating Applications to Generic Java Container Classes , 2004 .

[15]  Martin Fowler. Refactoring Improving the Design of Existing Code , 1999 .

[16]  Frank Tip,et al.  Refactoring for Parameterizing Java Classes , 2007, 29th International Conference on Software Engineering (ICSE'07).