mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-39830 - IOE: GroovyPsiElementFactoryImpl.createMethodFromText
This commit is contained in:
+7
-5
@@ -18,6 +18,7 @@ package org.jetbrains.plugins.groovy.refactoring.extract;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiPrimitiveType;
|
||||
@@ -361,20 +362,21 @@ public class ExtractUtil {
|
||||
PsiType type = helper.getOutputType();
|
||||
final PsiPrimitiveType outUnboxed = PsiPrimitiveType.getUnboxedType(type);
|
||||
if (outUnboxed != null) type = outUnboxed;
|
||||
|
||||
String typeText = forPresentation ? type.getPresentableText() : type.getCanonicalText();
|
||||
String returnType = typeText == null || !helper.specifyType() ? "" : typeText;
|
||||
if (returnType.length() == 0) {
|
||||
|
||||
if (StringUtil.isEmptyOrSpaces(returnType) || "null".equals(returnType)) {
|
||||
if (modifier.length() == 0) {
|
||||
typeText = "def ";
|
||||
return "def ";
|
||||
}
|
||||
else {
|
||||
typeText = "";
|
||||
return "";
|
||||
}
|
||||
}
|
||||
else {
|
||||
typeText = returnType + " ";
|
||||
return returnType + " ";
|
||||
}
|
||||
return typeText;
|
||||
}
|
||||
|
||||
public static boolean isSingleExpression(GrStatement[] statements) {
|
||||
|
||||
Reference in New Issue
Block a user