in
switch (sign) { case 1: return "+"; case 0: return "0"; case -1: return "-"; default: throw new IllegalArgumentException(); }
obviously one does not need a break.
Suggestion: require either break or return.
Logged In: YES user_id=1316370
also a throws substitutes for a break.
another problem: each fall-through should be reported seperately such that it can be avoided using NOPMD individually.
still another substitution for a break: a continue-statement refering to an enclosing loop.
Logged In: YES user_id=5159
Hm, this is an interesting one... it only applies if all cases have return stmts. Kind of a data flow analysis problem...
Tom
Logged In: YES user_id=348202 Originator: NO
Was anyone able to make progress on this bug? I am getting a number of false positives from it.
I'm seeing false positives with this issue in 5.1.3. Any updates on whether it can be fixed?
Log in to post a comment.
Logged In: YES
user_id=1316370
also a throws substitutes for a break.
another problem:
each fall-through should be reported seperately
such that it can be avoided using NOPMD individually.
Logged In: YES
user_id=1316370
still another substitution for a break: a continue-statement
refering to an enclosing loop.
Logged In: YES
user_id=5159
Hm, this is an interesting one... it only applies if all
cases have return stmts. Kind of a data flow analysis
problem...
Tom
Logged In: YES
user_id=348202
Originator: NO
Was anyone able to make progress on this bug? I am getting a number of false positives from it.
I'm seeing false positives with this issue in 5.1.3. Any updates on whether it can be fixed?