mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-74565 Groovy: SpinAllocator$AllocatorExhaustedException at GroovyPsiElementFactoryImpl.createMethod() after invoking "Generate Getter and Setter" action several times
This commit is contained in:
+11
-6
@@ -760,14 +760,19 @@ public class GroovyPsiElementFactoryImpl extends GroovyPsiElementFactory {
|
||||
@Override
|
||||
public GrMethod createMethod(@NotNull @NonNls String name, @Nullable PsiType returnType) throws IncorrectOperationException {
|
||||
StringBuilder builder = StringBuilderSpinAllocator.alloc();
|
||||
if (returnType != null) {
|
||||
builder.append(returnType.getCanonicalText());
|
||||
try {
|
||||
if (returnType != null) {
|
||||
builder.append(returnType.getCanonicalText());
|
||||
}
|
||||
else {
|
||||
builder.append("def");
|
||||
}
|
||||
builder.append(' ').append(name).append("(){}");
|
||||
return createMethodFromText(builder.toString());
|
||||
}
|
||||
else {
|
||||
builder.append("def");
|
||||
finally {
|
||||
StringBuilderSpinAllocator.dispose(builder);
|
||||
}
|
||||
builder.append(' ').append(name).append("(){}");
|
||||
return createMethodFromText(builder.toString());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user