mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
[uast-inspection] IDEA-350483 New inspection LoggingGuardedByConditionInspection also deletes comments
- support comments GitOrigin-RevId: b5add2dcbe56eaca7d8c90319734bacda3e68923
This commit is contained in:
committed by
intellij-monorepo-bot
parent
992e3b7bdc
commit
e84bc31482
@@ -188,4 +188,43 @@ class JavaLoggingGuardedByConditionInspectionTest : LoggingGuardedByConditionIns
|
||||
hint = JvmAnalysisBundle.message("jvm.inspection.log.guarded.fix.family.name")
|
||||
)
|
||||
}
|
||||
|
||||
fun `test slf4j with comment fix`() {
|
||||
myFixture.testQuickFix(
|
||||
testPreview = true,
|
||||
lang = JvmLanguage.JAVA,
|
||||
before = """
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
class X {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(X.class);
|
||||
void n(String arg) {
|
||||
if(<caret>LOG.isDebugEnabled()) {//comment1
|
||||
//comment2
|
||||
LOG.debug("test" + arg);
|
||||
//comment3
|
||||
|
||||
//comment4
|
||||
}
|
||||
}
|
||||
}
|
||||
""".trimIndent(),
|
||||
after = """
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
class X {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(X.class);
|
||||
void n(String arg) {
|
||||
//comment1
|
||||
//comment2
|
||||
LOG.debug("test" + arg);
|
||||
//comment3
|
||||
|
||||
//comment4
|
||||
}
|
||||
}
|
||||
""".trimIndent(),
|
||||
hint = JvmAnalysisBundle.message("jvm.inspection.log.guarded.fix.family.name")
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user