Add test for #5152

This commit is contained in:
Juan Martín Sotuyo Dodero
2024-08-18 19:29:39 -03:00
parent 0837be674e
commit 176fae39d2

View File

@ -595,8 +595,28 @@ public class GuardLogStatementTest {
public void test() {
LOG.info(
"Some message here : foo={}",
GuardLogStatementTest.MY_CONSTANT
"Some message here : foo={}",
GuardLogStatementTest.MY_CONSTANT
);
}
}
]]></code>
</test-code>
<test-code>
<description>#5152 "this" do not require guards</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
public class GuardLogStatementTest {
private static final Logger LOG = LogManager.getLogger(GuardLogStatementTest.class);
public void test() {
LOG.info(
"Some message here : foo={}",
this
);
}
}