mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
IDEA-38591 (Can't use "Create Local Var from instanceof" intention on multiple 'instanceof' with &&)
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@
|
||||
class C {
|
||||
void f(Object o) {
|
||||
if (o instanceof String) {
|
||||
String s = (String) o;
|
||||
String o1 = (String) o;
|
||||
<caret>
|
||||
o = "";
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Insert '(String)o' declaration" "true"
|
||||
class C {
|
||||
void f(Object o, Object f) {
|
||||
if (o instanceof String) {
|
||||
Float s = 1f;
|
||||
String o1 = (String) o;
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@ import java.io.IOException;
|
||||
class C {
|
||||
void f(Object o) {
|
||||
if (o instanceof IOException) {
|
||||
IOException ioException = (IOException) o;
|
||||
IOException o1 = (IOException) o;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
public abstract class A {
|
||||
public void getNodeElements(Object parent) {
|
||||
if (!(parent instanceof NodeInfo)) return;
|
||||
NodeInfo nodeInfo = (NodeInfo) parent;
|
||||
NodeInfo parent1 = (NodeInfo) parent;
|
||||
<caret>
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
class C {
|
||||
void f(Object o, Object f) {
|
||||
if (o instanceof String && f == null) {
|
||||
String s = (String) o;
|
||||
String o1 = (String) o;
|
||||
<caret>
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ class C {
|
||||
void f(Object o, Object f) {
|
||||
if (o instanceof String) {//todo comment
|
||||
|
||||
String s = (String) o;
|
||||
String o1 = (String) o;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Insert '(String)f' declaration" "true"
|
||||
class C {
|
||||
void f(Object o, Object f) {
|
||||
if (o instanceof String && f instanceof String) {
|
||||
String s = (String) o;
|
||||
String f1 = (String) f;
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
class C {
|
||||
void f(Object o) {
|
||||
if (o instanceof Runnable) {
|
||||
Runnable runnable = (Runnable) o;
|
||||
Runnable o1 = (Runnable) o;
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Insert '(String)o' declaration" "true"
|
||||
class C {
|
||||
void f(Object o, Object f) {
|
||||
if (<caret>o instanceof String) {
|
||||
Float s = 1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Insert '(String)f' declaration" "true"
|
||||
class C {
|
||||
void f(Object o, Object f) {
|
||||
if (o instanceof String && f<caret> instanceof String) {
|
||||
String s = (String) o;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user