mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[uast-inspection] IDEA-331308 Create inspection highlighting non-distinguishable logging sites in a single class
- skip error log levels with stacktrace GitOrigin-RevId: 5662e1f1a5e43fdb371d6597693c0ab875040204
This commit is contained in:
committed by
intellij-monorepo-bot
parent
06f55eb8cd
commit
dcc38e5eb7
@@ -16,11 +16,15 @@ class JavaLoggingSimilarMessageInspectionTest : LoggingSimilarMessageInspectionT
|
||||
private static void request1(String i) {
|
||||
String msg = "log messages: " + i;
|
||||
<weak_warning descr="Similar log messages">L<caret>OG.info(msg)</weak_warning>;
|
||||
<weak_warning descr="Similar log messages">LOG.error(msg)</weak_warning>;
|
||||
LOG.error(msg, new RuntimeException());
|
||||
}
|
||||
|
||||
private static void request2(int i) {
|
||||
String msg = "log messages: " + i;
|
||||
<weak_warning descr="Similar log messages">LOG.info(msg)</weak_warning>;
|
||||
<weak_warning descr="Similar log messages">LOG.error(msg)</weak_warning>;
|
||||
LOG.error(msg, new RuntimeException());
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
@@ -35,11 +39,15 @@ class JavaLoggingSimilarMessageInspectionTest : LoggingSimilarMessageInspectionT
|
||||
private static void request1(String i) {
|
||||
String msg = "log messages: " + i;
|
||||
LOG.info(msg);
|
||||
LOG.error(msg);
|
||||
LOG.error(msg, new RuntimeException());
|
||||
}
|
||||
|
||||
private static void request2(int i) {
|
||||
String msg = "log messages: " + i;
|
||||
<selection><caret>LOG.info(msg)</selection>;
|
||||
LOG.error(msg);
|
||||
LOG.error(msg, new RuntimeException());
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
@@ -151,11 +159,15 @@ class JavaLoggingSimilarMessageInspectionTest : LoggingSimilarMessageInspectionT
|
||||
private static void request1(String i) {
|
||||
String msg = "log messages: " + i;
|
||||
<weak_warning descr="Similar log messages">LOG.info(msg)</weak_warning>;
|
||||
<weak_warning descr="Similar log messages">LOG.error(msg)</weak_warning>;
|
||||
LOG.error(msg, new RuntimeException());
|
||||
}
|
||||
|
||||
private static void request2(int i) {
|
||||
String msg = "log messages: " + i;
|
||||
<weak_warning descr="Similar log messages">LOG.info(msg)</weak_warning>;
|
||||
<weak_warning descr="Similar log messages">LOG.error(msg)</weak_warning>;
|
||||
LOG.error(msg, new RuntimeException());
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
@@ -170,12 +182,14 @@ class JavaLoggingSimilarMessageInspectionTest : LoggingSimilarMessageInspectionT
|
||||
|
||||
private static void request1(String i) {
|
||||
String msg = "log messages: " + i;
|
||||
<weak_warning descr="Similar log messages">LOG.info(msg)</weak_warning>;
|
||||
<weak_warning descr="Similar log messages">LOG.atInfo().setMessage(msg).log()</weak_warning>;
|
||||
LOG.atInfo().setCause(new RuntimeException("1234")).setMessage(msg).log();
|
||||
}
|
||||
|
||||
private static void request2(int i) {
|
||||
String msg = "log messages: " + i;
|
||||
<weak_warning descr="Similar log messages">LOG.info(msg)</weak_warning>;
|
||||
<weak_warning descr="Similar log messages">LOG.atInfo().setMessage(msg).log()</weak_warning>;
|
||||
LOG.atInfo().setCause(new RuntimeException("1234")).setMessage(msg).log();
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
@@ -529,11 +543,13 @@ class JavaLoggingSimilarMessageInspectionTest : LoggingSimilarMessageInspectionT
|
||||
private static void request1(String i) {
|
||||
String msg = "log messages: " + i;
|
||||
<weak_warning descr="Similar log messages">L<caret>OG.info(msg)</weak_warning>;
|
||||
LOG.error(msg);
|
||||
}
|
||||
|
||||
private static void request2(int i) {
|
||||
String msg = "log messages: " + i;
|
||||
<weak_warning descr="Similar log messages">LOG.info(msg)</weak_warning>;
|
||||
<weak_warning descr="Similar log messages">L<caret>OG.info(msg)</weak_warning>;
|
||||
LOG.error(msg);
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
|
||||
Reference in New Issue
Block a user