mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-17 19:49:44 +07:00
ea-26321
This commit is contained in:
+4
-1
@@ -139,7 +139,10 @@ public class CreateConstructorParameterFromFieldFix implements IntentionAction {
|
||||
|
||||
// do not introduce assignment in chanined constructor
|
||||
if (HighlightControlFlowUtil.getChainedConstructors(constructor) == null) {
|
||||
AssignFieldFromParameterAction.addFieldAssignmentStatement(project, getField(), parameter, editor);
|
||||
PsiField field = getField();
|
||||
if (field != null) {
|
||||
AssignFieldFromParameterAction.addFieldAssignmentStatement(project, field, parameter, editor);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
+4
-4
@@ -87,10 +87,10 @@ public class AssignFieldFromParameterAction extends BaseIntentionAction {
|
||||
}
|
||||
}
|
||||
|
||||
public static void addFieldAssignmentStatement(final Project project,
|
||||
final PsiField field,
|
||||
final PsiParameter parameter,
|
||||
final Editor editor) throws IncorrectOperationException {
|
||||
public static void addFieldAssignmentStatement(@NotNull Project project,
|
||||
@NotNull PsiField field,
|
||||
@NotNull PsiParameter parameter,
|
||||
@NotNull Editor editor) throws IncorrectOperationException {
|
||||
final PsiMethod method = (PsiMethod)parameter.getDeclarationScope();
|
||||
PsiCodeBlock methodBody = method.getBody();
|
||||
if (methodBody == null) return;
|
||||
|
||||
Reference in New Issue
Block a user