squid:S128: False positive

14 visningar
Hoppa till det första olästa meddelandet

Tobias Stadler

oläst,
8 apr. 2017 16:14:242017-04-08
till sona...@googlegroups.com
Hello,

I think a found a false positive for squid:S128:

public class Test {

public enum E {
A, B
}

public int test(String s, E e) {
switch (s) {
case "FOO":
return 0;
case "BAR":
switch(e) {
case A:
return 1;
case B:
return 2;
default:
throw new IllegalArgumentException();
}
default:
throw new IllegalArgumentException();
}
}
}

Yes, the „BAR“ case is missing a break or return at the end, but the following case is not executed, because. the „BAR“ case always returns/throws an exception. What do you think?

Best Regards
Tobias

Michael Gumowski

oläst,
10 apr. 2017 05:13:112017-04-10
till Tobias Stadler, sona...@googlegroups.com
Hey Tobias,

Thanks a lot for the feedback. This is indeed a FP.
Ticket created to handle the issue: SONARJAVA-2231

Cheers,
Michael



--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/37271872-FE87-4A6B-AA16-8F448DFF8EED%40gmx.de.
For more options, visit https://groups.google.com/d/optout.
--

Michael GUMOWSKI | SonarSource
Software Developer @ Language Team
http://sonarsource.com
Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden