Fix 'PsiElement.getReference()' contract for Kotlin PSI (KT-52822)
As stated in JavaDoc for 'PsiElement' (formatting is slightly changed): Returns the reference from this PSI element to another PSI element (or elements), if one exists. If the element has multiple associated references, returns the first associated reference.
This commit is contained in:
@@ -104,8 +104,7 @@ public class KtElementImplStub<T extends StubElement<?>> extends StubBasedPsiEle
|
||||
@SuppressWarnings("deprecation")
|
||||
public PsiReference getReference() {
|
||||
PsiReference[] references = getReferences();
|
||||
if (references.length == 1) return references[0];
|
||||
else return null;
|
||||
return (references.length > 0) ? references[0] : null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user