mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Java: Don't delete class cast when deleting unused variable (IDEA-181346)
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Remove variable 'c'" "true"
|
||||
class C {
|
||||
String s;
|
||||
|
||||
void foo(Object o) {
|
||||
if (o instanceof C) {
|
||||
String t = ((C) o).s;
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Remove variable 'n'" "true"
|
||||
class C {
|
||||
void foo(Object o) {
|
||||
if (o instanceof Integer) {
|
||||
int i = (Integer) o + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Remove variable 'c'" "true"
|
||||
class C {
|
||||
String s;
|
||||
|
||||
void foo(Object o) {
|
||||
if (o instanceof C) {
|
||||
C c<caret>;
|
||||
String t = (c = (C) o).s;
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// "Remove variable 'n'" "true"
|
||||
class C {
|
||||
void foo(Object o) {
|
||||
if (o instanceof Integer) {
|
||||
Integer n<caret>;
|
||||
int i = (n = (Integer) o) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user