mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
[jvm] Fix false-positive UrlHashCodeInspection
Previously, this inspection highlighted the cases like `url.equals(null)` or `url == null`. This commit fixes this behavior ^IDEA-332645 fixed GitOrigin-RevId: 7448489db08e5bbf75dfc1582788bc1f78f923f2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ae2e9b0b34
commit
6233b72cb6
@@ -83,4 +83,20 @@ class JavaUrlHashCodeInspectionTest : UrlHashCodeInspectionTestBase() {
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
fun `test URL doesn't highlight when comparing with null`() {
|
||||
myFixture.testHighlighting(JvmLanguage.JAVA, """
|
||||
import java.net.URL;
|
||||
|
||||
class Foo {
|
||||
static {
|
||||
try {
|
||||
var url = new URL("");
|
||||
if (url.equals(null)) {
|
||||
}
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user