New Rule: Avoid reusing of a local variable between switch cases
A source code analyzer
Brought to you by:
adangel,
juansotuyo
Irrespective of this bug it's worth considering the reuse of a local variable in another case block questionable and add a corresponding PMD rule.
See [#1305]
Example code:
int switchvar = 0; switch (switchvar) { case 1: boolean localvar = false; break; case 2: localvar = true; break; case 3: if (localvar) { // } }