AnnoDomini: from type theory to Year 2000 conversion tool
Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Aggregate structure identification and its application to program analysis
Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Refactoring: improving the design of existing code
Refactoring: improving the design of existing code
Effective Java programming language guide
Effective Java programming language guide
Types and programming languages
Types and programming languages
Identifying Enumeration Types Modeled with Symbolic Constants
WCRE '96 Proceedings of the 3rd Working Conference on Reverse Engineering (WCRE '96)
Type Inference for COBOL Systems
WCRE '98 Proceedings of the Working Conference on Reverse Engineering (WCRE'98)
Refactoring to Patterns
Annotation refactoring: inferring upgrade transformations for legacy applications
Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications
Efficiently refactoring java applications to use generic libraries
ECOOP'05 Proceedings of the 19th European conference on Object-Oriented Programming
Hi-index | 0.00 |
Java 5 introduces several new features that offer significant improvements over older Java technology. We consider the new enum construct, which provides language support for enumerated types. Before Java 5, programmers needed to employ various patterns 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 demonstrate an automated refactoring tool called Convert Constants to Enum for transforming legacy Java code to use the new enumeration construct. An interprocedural type inferencing algorithm that tracks the flow of enumerated values drives the approach, and the tool is implemented as a seamless extension to existing refactoring support in Eclipse. The resulting code is semantically equivalent to the original, increasingly type-safe, easier to comprehend, less complex, and supports separate compilation.