mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 06:39:38 +07:00
create method from usage: do not qualify already qualified ref (IDEA-91041)
This commit is contained in:
@@ -167,7 +167,7 @@ public class CreateMethodFromUsageFix extends CreateFromUsageBaseFix {
|
||||
}
|
||||
|
||||
if (enclosingContext instanceof PsiMethod && methodName.equals(enclosingContext.getName()) &&
|
||||
PsiTreeUtil.isAncestor(targetClass, parentClass, true)) {
|
||||
PsiTreeUtil.isAncestor(targetClass, parentClass, true) && !ref.isQualified()) {
|
||||
FieldConflictsResolver.qualifyReference(ref, method, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// "Create Method 'run'" "true"
|
||||
class Bug {
|
||||
|
||||
interface Foo<X> {
|
||||
void run(X x);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Foo<Bug>() {
|
||||
@Override
|
||||
public void run(Bug o) {
|
||||
o.run();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void run() {
|
||||
<selection>//To change body of created methods use File | Settings | File Templates.</selection>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Create Method 'run'" "true"
|
||||
class Bug {
|
||||
|
||||
interface Foo<X> {
|
||||
void run(X x);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Foo<Bug>() {
|
||||
@Override
|
||||
public void run(Bug o) {
|
||||
o.ru<caret>n();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user