mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-190727 Replace instanceof with null-check could automatically eliminate double negation
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with a null check" "true"
|
||||
class Test {
|
||||
void test(String s) {
|
||||
Object obj = s;
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
System.out.println("always");
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with a null check" "true"
|
||||
class Test {
|
||||
void test(String s) {
|
||||
Object obj = s;
|
||||
if (!(obj inst<caret>anceof String)) {
|
||||
return;
|
||||
}
|
||||
System.out.println("always");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user