Add test case

This commit is contained in:
Clément Fournier
2020-09-02 16:45:19 +02:00
parent 3ce68f4977
commit 3a33092d22

View File

@ -3159,4 +3159,29 @@ public class UnusedAssignmentNative {
]]></code>
</test-code>
<test-code>
<description>False positive with try in loop? #2759</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
class Test {
int a() {
int a = 10;
while (a > 0) {
a--;
try {
if (dummy) {
return somethingThatCanThrowRandomly(1);
} else {
return somethingThatCanThrowRandomly(2);
}
} catch (RuntimeException e) {
// retry
}
}
return 0;
}
}
]]></code>
</test-code>
</test-data>