do not suggest child type if instanceof inside selected block; if child type suggested then insert cast in method call

This commit is contained in:
anna
2010-11-10 22:35:01 +03:00
parent 46314ea90a
commit 0f0adb32b7
7 changed files with 52 additions and 5 deletions

View File

@@ -0,0 +1,11 @@
public class Test {
void foo(Object o) {
if (o instanceof A) {
<selection>((A)o).bar();</selection>
}
}
}
class A {
void bar(){}
}

View File

@@ -0,0 +1,15 @@
public class Test {
void foo(Object o) {
if (o instanceof A) {
newMethod((Object) o);
}
}
private void newMethod(A o) {
((A)o).bar();
}
}
class A {
void bar(){}
}