mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[uast-inspection] IDEA-347890 Similar logs inspection. Skip warning if they are in the same codeblock
GitOrigin-RevId: 7b481eebc5196909c648b46051bfeb46feab6d59
This commit is contained in:
committed by
intellij-monorepo-bot
parent
165bbb3559
commit
1da47e479f
@@ -207,7 +207,10 @@ class JavaLoggingSimilarMessageInspectionTest : LoggingSimilarMessageInspectionT
|
||||
<weak_warning descr="Similar log messages">logger.atError()
|
||||
.setMessage("aaaaa {}")
|
||||
.log()</weak_warning>;
|
||||
|
||||
}
|
||||
void foo2() {
|
||||
Logger logger = LoggerFactory.getLogger(X.class);
|
||||
|
||||
<weak_warning descr="Similar log messages">logger.atError()
|
||||
.setMessage("aaaaa 2{}")
|
||||
.log()</weak_warning>;
|
||||
@@ -575,5 +578,24 @@ class JavaLoggingSimilarMessageInspectionTest : LoggingSimilarMessageInspectionT
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
|
||||
fun `test sequence`() {
|
||||
myFixture.testHighlighting(JvmLanguage.JAVA, """
|
||||
import org.apache.logging.log4j.*;
|
||||
class Logging {
|
||||
private static final Logger LOG = LogManager.getLogger();
|
||||
|
||||
private static void request1(String i) {
|
||||
LOG.info("testtesttest");
|
||||
LOG.info("testtesttest");
|
||||
if(LOG.isInfoEnabled()){
|
||||
LOG.info("testtesttest");
|
||||
}
|
||||
if(LOG.isInfoEnabled()) LOG.info("testtesttest");
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user