diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodQuickFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodQuickFix.java index 2826cec4c910..cd970279c252 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodQuickFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodQuickFix.java @@ -62,7 +62,7 @@ public class CreateMethodQuickFix implements LocalQuickFix { public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) { if (!CodeInsightUtilBase.preparePsiElementForWrite(myTargetClass.getContainingFile())) return; - PsiMethod method = createMethod(project); + PsiMethod method = createMethod(project); List> arguments = ContainerUtil.map2List(method.getParameterList().getParameters(), new Function>() { public Pair fun(PsiParameter psiParameter) { @@ -76,7 +76,7 @@ public class CreateMethodQuickFix implements LocalQuickFix { private PsiMethod createMethod(Project project) { PsiElementFactory elementFactory = JavaPsiFacade.getInstance(project).getElementFactory(); - String methodText = mySignature + "{" + myBody + "}"; + String methodText = mySignature + (myTargetClass.isInterface() ? ";" : "{" + myBody + "}"); return elementFactory.createMethodFromText(methodText, null); }