mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
convert to anonymous: strip type args array symbols (cherry picked from commit 1d10ccb)
This commit is contained in:
+7
-2
@@ -24,6 +24,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.codeStyle.JavaCodeStyleManager;
|
||||
import com.intellij.psi.codeStyle.VariableKind;
|
||||
import com.intellij.psi.util.TypeConversionUtil;
|
||||
import com.intellij.refactoring.HelpID;
|
||||
import com.intellij.refactoring.RefactoringBundle;
|
||||
import com.intellij.refactoring.ui.NameSuggestionsField;
|
||||
@@ -86,10 +87,14 @@ class AnonymousToInnerDialog extends DialogWrapper{
|
||||
if (typeParameters.length > 0) {
|
||||
names = new String[]{StringUtil.join(typeParameters, new Function<PsiType, String>() {
|
||||
public String fun(PsiType psiType) {
|
||||
PsiType type = psiType;
|
||||
if (psiType instanceof PsiClassType) {
|
||||
return ((PsiClassType)psiType).rawType().getPresentableText();
|
||||
type = TypeConversionUtil.erasure(psiType);
|
||||
}
|
||||
return psiType.getPresentableText();
|
||||
if (type instanceof PsiArrayType) {
|
||||
type = type.getDeepComponentType();
|
||||
}
|
||||
return type.getPresentableText();
|
||||
}
|
||||
}, "") + name, "My" + name};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user