Solve sonar issues on constant naming and reuse of variables
SONARJAVA-415 Last case in switch should not be checked.