首页> 外文期刊>Automated software engineering >Automated refactoring of legacy Java software to enumerated types
【24h】

Automated refactoring of legacy Java software to enumerated types

机译:将旧版Java软件自动重构为枚举类型

获取原文
获取原文并翻译 | 示例

摘要

Modern Java languages introduce several new features that offer significant improvements over older Java technology. In this article we consider the new enum construct, which provides language support for enumerated types. Prior to recent Java languages, 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 open source, publicly available 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.
机译:现代Java语言引入了一些新功能,这些功能比旧Java技术有了显着改进。在本文中,我们考虑了新的枚举构造,该构造为枚举类型提供了语言支持。在最近的Java语言之前,程序员需要采用各种模式(例如,弱枚举模式)来补偿Java中缺少枚举类型的情况。不幸的是,这些补偿模式缺乏枚举构造的几个非常理想的属性,最显着的是类型安全。我们提出了一种新颖的全自动方法,用于将遗留Java代码转换为使用新的枚举构造。这种保留语义的方法提高了类型安全性,生成了更易于理解的代码,消除了不必要的复杂性,并消除了由于单独编译而导致的脆性问题。所提出方法的核心是一种过程间类型推断算法,该算法跟踪枚举值的流。该算法被实现为开放源代码,公开可用的Eclipse插件,并在17个大型Java基准测试中进行了实验评估。我们的结果表明,分析成本是可行的,并且该算法可以成功地将大量字段重构为枚举类型。这项工作是朝着提供自动化工具支持以将旧版Java软件迁移到现代Java技术的重要一步。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号