mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
JavaMethodDescriptor: prefer exact type element text when there are no top-level annotations (IDEA-232690)
GitOrigin-RevId: 5d5bf157f18f979b802bbe98c19bd5f6e057b93c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d40e543cea
commit
4c20010c0e
+9
-5
@@ -1,10 +1,7 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.refactoring.changeSignature;
|
||||
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiMethod;
|
||||
import com.intellij.psi.PsiParameter;
|
||||
import com.intellij.psi.PsiTypeElement;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.util.AccessModifier;
|
||||
import com.intellij.psi.util.JavaPsiRecordUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
@@ -58,7 +55,14 @@ public class JavaMethodDescriptor implements MethodDescriptor<ParameterInfoImpl,
|
||||
@Nullable
|
||||
public String getReturnTypeText() {
|
||||
final PsiTypeElement typeElement = myMethod.getReturnTypeElement();
|
||||
return typeElement != null ? typeElement.getType().getPresentableText(true) : null;
|
||||
if (typeElement != null) {
|
||||
PsiType type = typeElement.getType();
|
||||
if (type.getAnnotations().length > 0) {
|
||||
return type.getPresentableText(true);
|
||||
}
|
||||
return typeElement.getText();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user