mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-97548 NPE while change signature of groovy constructor
This commit is contained in:
+3
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -100,6 +100,8 @@ public abstract class ChangeSignatureDialogBase<
|
||||
private final Alarm myUpdateSignatureAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
|
||||
|
||||
protected VisibilityPanelBase<Visibility> myVisibilityPanel;
|
||||
|
||||
@Nullable
|
||||
protected PsiCodeFragment myReturnTypeCodeFragment;
|
||||
private DelegationPanel myDelegationPanel;
|
||||
protected AnActionButton myPropagateParamChangesButton;
|
||||
|
||||
+5
-3
@@ -156,7 +156,9 @@ public class GrChangeSignatureDialog extends ChangeSignatureDialogBase<GrParamet
|
||||
private CanonicalTypes.Type getReturnType() {
|
||||
PsiType returnType = null;
|
||||
try {
|
||||
returnType = ((PsiTypeCodeFragment)myReturnTypeCodeFragment).getType();
|
||||
if (myReturnTypeCodeFragment != null) {
|
||||
returnType = ((PsiTypeCodeFragment)myReturnTypeCodeFragment).getType();
|
||||
}
|
||||
}
|
||||
catch (PsiTypeCodeFragment.TypeSyntaxException ignored) {
|
||||
}
|
||||
@@ -211,7 +213,7 @@ public class GrChangeSignatureDialog extends ChangeSignatureDialogBase<GrParamet
|
||||
return message("name.is.wrong", getMethodName());
|
||||
}
|
||||
|
||||
if (!checkType((PsiTypeCodeFragment)myReturnTypeCodeFragment, true)) {
|
||||
if (myReturnTypeCodeFragment != null && !checkType((PsiTypeCodeFragment)myReturnTypeCodeFragment, true)) {
|
||||
return message("return.type.is.wrong");
|
||||
}
|
||||
|
||||
@@ -296,7 +298,7 @@ public class GrChangeSignatureDialog extends ChangeSignatureDialogBase<GrParamet
|
||||
@Override
|
||||
protected String calculateSignature() {
|
||||
String name = getMethodName();
|
||||
String type = myReturnTypeCodeFragment.getText().trim();
|
||||
String type = myReturnTypeCodeFragment != null ? myReturnTypeCodeFragment.getText().trim() : "";
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(myVisibilityPanel.getVisibility()).append(' ');
|
||||
|
||||
Reference in New Issue
Block a user