Refactoring to enums
Answered
For the code like this
public static final String ADD = "Add";
public static final String MOVE = "Move";
public static final String REMOVE = "Remove";
Can be automatically converted to JDK enums and vise versa.. if we were to convert enum code to lower JDK.
Intellij should consider to introduce this refactoring approach.
Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
- Java Product Code Audit Experts
Please sign in to leave a comment.
+1 (8 years later)
Hello Denis,
Seems you could select those strings and run "Refactor | Extract | Delegate" (don't forget to check "Extract as enum")
Not bad. Thanks Yaroslav!