skip to main content
10.1145/1028664.1028669acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Advanced refactorings in eclipse

Published:23 October 2004Publication History

ABSTRACT

We will demonstrate several advanced refactorings for Java that have been implemented in the context of the Eclipse development environment for Java (see <b>www.eclipse.org</b>). These refactorings are semantics-preserving program transformations that are typical of the sorts of transformations object-oriented programmers perform manually in order to improve the structure of existing code, and to promote reuse, clarity, and extensibility.

Our demonstration will consist of three parts: (i) a quick review of the implementation in Eclipse of several widely-used refactorings such as <sc>Extract Method</sc>, <sc>Introduce Factory</sc> and <sc>Change Method Signature</sc> as described in Fowler's seminal book on refactoring, (ii) a demonstration of generalization-related refactorings such as <sc>Extract Interface</sc>, for extracting an interface from a class in order to reduce client dependencies on implementation particulars, and <sc>Generalize Type</sc>, for remediating over-specific declarations, and (iii) a demonstration of <sc>Genericize Container Uses</sc>, a refactoring that we are currently developing for migrating occurrences of standard container classes such as <b>ArrayList</b> or <b>HashMap</b> in a user's program to instantiations of the generic versions of these container classes in Java 1.5 (e.g., <b>ArrayList<String></b>). This involves determining the element types that flow into each container object, modifying their declarations and allocations sites where possible, and removing casts that have been rendered redundant.

The latter two categories of refactorings involve non-trivial static analysis, as well as challenging usability issues from a software engineering perspective, which reflect the complications that programmers face when performing the transformations manually. Therefore, during each demonstration, we will give a brief overview of the technical challenges that the refactorings present, along with highlights of the approach we took in addressing them. In particular, we will briefly describe a new piece of Eclipse infrastructure designed to help implement various kinds of context-sensitive and context-insensitive type and pointer analyses for Java.

References

  1. Refactoring: Improving the Design of Existing Code, Martin Fowler, Addison-Wesley, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Refactoring for Generalization using Type Constraints", Frank Tip, Adam Kieżun., Dirk BÄaumer, Proceedings of 2003 OOPSLA, pp. 13--26. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Integrating Refactoring Support into a Java Development Tool", Dirk BÄaumer, Erich Gamma, Adam Kieżun, OOPSLA 2001 Companion.Google ScholarGoogle Scholar
  4. Eclipse "New and Noteworthy" page describing Extract Interface: http://fullmoon.torolab.ibm.com/downloads/drops/R-2.1-200303272130/whats-new-jdt-refactor.html Eclipse "New and Noteworthy" page describing Generalize Type and Introduce Factory: http://fullmoon.torolab.ibm.com/downloads/drops/S-3.0M5-200311211210/eclipse-news-part1-M5.htmlGoogle ScholarGoogle Scholar

Index Terms

  1. Advanced refactorings in eclipse

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        OOPSLA '04: Companion to the 19th annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications
        October 2004
        348 pages
        ISBN:1581138334
        DOI:10.1145/1028664

        Copyright © 2004 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 23 October 2004

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • Article

        Upcoming Conference

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader