Add test case for #935
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user