Describe the problem
This code is using the state design pattern, where a singleton pattern is used for creating each state. However, the naming convention for this singleton pattern is not implemented consistently: sometimes the method getInstance() is used for creating a new unique instance of the state, and sometimes the method Instance() is used for doing so.
Propose a solution
Apply a refactoring to rename all state creation methods consistently, either using the getInstance() method or using the Instance() method.
This refactoring requires making changes in many classes throughout the code, but also in all test files. Therefore, the use of an automated refactoring tool is recommended.
Describe the problem
This code is using the state design pattern, where a singleton pattern is used for creating each state. However, the naming convention for this singleton pattern is not implemented consistently: sometimes the method getInstance() is used for creating a new unique instance of the state, and sometimes the method Instance() is used for doing so.
Propose a solution
Apply a refactoring to rename all state creation methods consistently, either using the getInstance() method or using the Instance() method.
This refactoring requires making changes in many classes throughout the code, but also in all test files. Therefore, the use of an automated refactoring tool is recommended.