• DocumentCode
    1885326
  • Title

    Automated Refactoring of Legacy Java Software to Enumerated Types

  • Author

    Khatchadourian, Raffi ; Sawin, Jason ; Rountev, Atanas

  • Author_Institution
    Ohio State Univ., Columbus
  • fYear
    2007
  • fDate
    2-5 Oct. 2007
  • Firstpage
    224
  • Lastpage
    233
  • Abstract
    Java 1.5 introduces several new features that offer significant improvements over older Java technology. In this paper we consider the new enum construct, which provides language support for enumerated types. Prior to Java 1.5, programmers needed to employ various patterns (e.g., the weak enum pattern) to compensate for the absence of enumerated types in Java. Unfortunately, these compensation patterns lack several highly-desirable properties of the enum construct, most notably, type safety. We present a novel fully-automated approach for transforming legacy Java code to use the new enumeration construct. This semantics-preserving approach increases type safety, produces code that is easier to comprehend, removes unnecessary complexity, and eliminates brittleness problems due to separate compilation. At the core of the proposed approach is an interprocedural type inferencing algorithm which tracks the flow of enumerated values. The algorithm was implemented as an Eclipse plug-in and evaluated experimentally on 17 large Java benchmarks. Our results indicate that analysis cost is practical and the algorithm can successfully refactor a substantial number of fields to enumerated types. This work is a significant step towards providing automated tool support for migrating legacy Java software to modern Java technologies.
  • Keywords
    Java; programming language semantics; software maintenance; Java 1.5; Java technology; enum construct; legacy Java code; legacy Java software; semantics-preserving approach; Algorithm design and analysis; Application software; Costs; Inference algorithms; Java; Programming profession; Robustness; Safety; Software maintenance; Software tools;
  • fLanguage
    English
  • Publisher
    ieee
  • Conference_Titel
    Software Maintenance, 2007. ICSM 2007. IEEE International Conference on
  • Conference_Location
    Paris
  • ISSN
    1063-6773
  • Print_ISBN
    978-1-4244-1256-3
  • Electronic_ISBN
    1063-6773
  • Type

    conf

  • DOI
    10.1109/ICSM.2007.4362635
  • Filename
    4362635