extract method parameters suggester: change method copy context so calls inside method body could be resolved (aClass..getTypeParameterList() passed inside MethodElement.copyElement && aClass.processDeclarations implementations together cause that method calls to same class members can't be resolved); teach DuplicatesFinder to work on non-physical elements with correct context

This commit is contained in:
Anna Kozlova
2015-01-12 21:13:33 +01:00
parent 6d8569cba7
commit fb9a5e8ff7
5 changed files with 48 additions and 12 deletions
@@ -0,0 +1,12 @@
class B {
void readFile(String s, Class c) {}
{
<selection>
readFile("foo", B.class);
this.readFile("foo", B.class);
</selection>
readFile("bar", B.class);
this.readFile("bar", B.class);
}
}
@@ -0,0 +1,15 @@
class B {
void readFile(String s, Class c) {}
{
newMethod("foo");
newMethod("bar");
}
private void newMethod(String foo) {
readFile(foo, B.class);
this.readFile(foo, B.class);
}
}