[java-inspections] IDEA-359749 StringConcatenationArgumentToLogCallInspection could also be triggered by concatenation

GitOrigin-RevId: bb5024a6be79582644fff96b72a8ceeff0fbf15e
This commit is contained in:
Mikhail Pyltsin
2024-10-01 13:32:46 +00:00
committed by intellij-monorepo-bot
parent ba6d180392
commit 3288586fdf
6 changed files with 95 additions and 12 deletions
@@ -0,0 +1,13 @@
import org.slf4j.*;
import java.text.MessageFormat;
class ConcatenationMessageFormat {
Logger LOG = LoggerFactory.getLogger(ConcatenationMessageFormat.class);
void f() {
LOG.in<caret>fo("{}, 2 " +
"""
{} {}""", 3.0, 2, "1");
}
}
@@ -0,0 +1,13 @@
import org.slf4j.*;
import java.text.MessageFormat;
class ConcatenationMessageFormat {
Logger LOG = LoggerFactory.getLogger(ConcatenationMessageFormat.class);
void f() {
LOG.in<caret>fo(MessageFormat.format("{2}, 2 " +
"""
{1} {0}""", "1", 2, 3.0));
}
}
@@ -0,0 +1,12 @@
import org.slf4j.*;
import java.text.MessageFormat;
class ConcatenationStringFormat {
Logger LOG = LoggerFactory.getLogger(ConcatenationStringFormat.class);
void f() {
LOG.in<caret>fo("{} something" + " {} {}", "text", true, 1);
}
}
@@ -0,0 +1,12 @@
import org.slf4j.*;
import java.text.MessageFormat;
class ConcatenationStringFormat {
Logger LOG = LoggerFactory.getLogger(ConcatenationStringFormat.class);
void f() {
LOG.in<caret>fo(String.format("%s something" + " %b %d", "text", true, 1));
}
}