mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
[java-inspections] IDEA-360135 Non-constant string concatenation in logging call could be triggered with exception argument
GitOrigin-RevId: b9a08671660f1a3cb27e566e1a9ed6a05cd211d4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0a0b47c9d4
commit
77ec6df673
+12
@@ -0,0 +1,12 @@
|
||||
import org.slf4j.*;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
class SimpleMessageFormat {
|
||||
|
||||
Logger LOG = LoggerFactory.getLogger(SimpleMessageFormat.class);
|
||||
|
||||
void f() {
|
||||
LOG.in<caret>fo("{}, 2 {} {}", 3.0, 2, "1", new Exception());
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import org.slf4j.*;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
class SimpleMessageFormat {
|
||||
|
||||
Logger LOG = LoggerFactory.getLogger(SimpleMessageFormat.class);
|
||||
|
||||
void f() {
|
||||
LOG.in<caret>fo(MessageFormat.format("{2}, 2 {1} {0}", "1", 2, 3.0), new Exception());
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import org.slf4j.*;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
class SimpleStringFormat {
|
||||
|
||||
Logger LOG = LoggerFactory.getLogger(SimpleStringFormat.class);
|
||||
|
||||
void f() {
|
||||
LOG.in<caret>fo("{} something {} {}", "text", true, 1, new RuntimeException());
|
||||
}
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import org.slf4j.*;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
class SimpleStringFormat {
|
||||
|
||||
Logger LOG = LoggerFactory.getLogger(SimpleStringFormat.class);
|
||||
|
||||
void f() {
|
||||
LOG.in<caret>fo(String.format("%s something %b %d", "text", true, 1), new RuntimeException());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user