Add test case for #935

This commit is contained in:
Juan Martín Sotuyo Dodero
2024-03-18 00:14:23 -03:00
parent 37d352b3c1
commit d0f8383c3e

View File

@ -1162,6 +1162,24 @@ public class Foo {
return msg;
}
}
]]></code>
</test-code>
<test-code>
<description>#935 FP when exception is obtained from a method call</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Foo {
private static final Logger LOGGER = LoggerFactory.getLogger(Foo.class);
public static IllegalStateException exception() { return new IllegalStateException();}
public static void log() {
// violation raised below, but code is fine
LOGGER.warn("Exception {}", IllegalStateException.class.getName(), exception());
}
}
]]></code>
</test-code>
</test-data>