mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ClsMethod.getNavigationElement() may be not a method anymore
This commit is contained in:
@@ -336,18 +336,23 @@ public class ClsMethodImpl extends ClsRepositoryPsiElement<PsiMethodStub> implem
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiElement getNavigationElement() {
|
||||
public PsiMethod getSourceMirrorMethod() {
|
||||
PsiClass sourceClassMirror = ((ClsClassImpl)getParent()).getSourceMirrorClass();
|
||||
if (sourceClassMirror == null) return this;
|
||||
final PsiMethod[] methodsByName = sourceClassMirror.findMethodsByName(getName(), false);
|
||||
for (PsiMethod sourceMethod : methodsByName) {
|
||||
if (MethodSignatureUtil.areParametersErasureEqual(this, sourceMethod) && sourceMethod != this) {
|
||||
return sourceMethod.getNavigationElement();
|
||||
for (PsiMethod sourceMethod : sourceClassMirror.findMethodsByName(getName(), false)) {
|
||||
if (MethodSignatureUtil.areParametersErasureEqual(this, sourceMethod)) {
|
||||
return sourceMethod;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public PsiElement getNavigationElement() {
|
||||
final PsiMethod method = getSourceMirrorMethod();
|
||||
return method != this ? method.getNavigationElement() : this;
|
||||
}
|
||||
|
||||
public PsiTypeParameterList getTypeParameterList() {
|
||||
return getStub().findChildStubByType(JavaStubElementTypes.TYPE_PARAMETER_LIST).getPsi();
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ClsParameterImpl extends ClsRepositoryPsiElement<PsiParameterStub>
|
||||
}
|
||||
|
||||
ClsMethodImpl method = (ClsMethodImpl)getDeclarationScope();
|
||||
PsiMethod sourceMethod = (PsiMethod)method.getNavigationElement();
|
||||
PsiMethod sourceMethod = method.getSourceMirrorMethod();
|
||||
if (sourceMethod == method) {
|
||||
final PsiParameterStubImpl parameterStub = (PsiParameterStubImpl) getStub();
|
||||
if (!parameterStub.isAutoGeneratedName()) {
|
||||
|
||||
Reference in New Issue
Block a user