mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
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:
@@ -0,0 +1,11 @@
|
||||
public class Test {
|
||||
void foo(Object o) {
|
||||
if (o instanceof A) {
|
||||
<selection>((A)o).bar();</selection>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class A {
|
||||
void bar(){}
|
||||
}
|
||||
@@ -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(){}
|
||||
}
|
||||
Reference in New Issue
Block a user