-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Example of what I mean here.
Instead of using some defined static integers, you could just use a Java enumeration. This would allow code like here to be simplified to a nice switch statement for example. Additionally it will allow type checking at compile time and avoid unwanted double assignment of specific integer values (for example the classical copy & paste error).
Basically nitpicking, but I think it would improve the code readability and maintainability quite a bit.
EDIT: Ups, bad example. If you're using Java 8 though that if-else construct can still be switched out to be a simple switch statement, see here.
EDIT2: In case it is not clear: you could replace many of the static declarations in Constants.java with parameterized enums like shown here.