From bded310f3eef4718ac642c35bf758ee88843ccc0 Mon Sep 17 00:00:00 2001 From: Jack Zhou Date: Tue, 9 Apr 2013 22:23:43 -0400 Subject: [PATCH] Create from usage: Changed setupFunctionBody to static. --- .../jet/plugin/quickfix/CreateMethodFromUsageFix.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/CreateMethodFromUsageFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/CreateMethodFromUsageFix.java index 724634fc054..2b08d9b7c72 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/CreateMethodFromUsageFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/CreateMethodFromUsageFix.java @@ -476,7 +476,7 @@ public class CreateMethodFromUsageFix extends CreateFromUsageFixBase { ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { - setupFunctionBody(project, func, isUnit, ownerTypeDescriptor); + setupFunctionBody(project, func, methodName, isUnit, ownerTypeDescriptor); } }); @@ -485,7 +485,11 @@ public class CreateMethodFromUsageFix extends CreateFromUsageFixBase { }); } - private void setupFunctionBody(@NotNull Project project, @NotNull JetNamedFunction func, boolean isUnit, + private static void setupFunctionBody( + @NotNull Project project, + @NotNull JetNamedFunction func, + @NotNull String funcName, + boolean isUnit, @NotNull ClassifierDescriptor ownerTypeDescriptor ) { FileTemplate fileTemplate = FileTemplateManager.getInstance().getCodeTemplate(TEMPLATE_FROM_USAGE_METHOD_BODY); @@ -499,7 +503,7 @@ public class CreateMethodFromUsageFix extends CreateFromUsageFixBase { } properties.setProperty(FileTemplate.ATTRIBUTE_CLASS_NAME, DescriptorUtils.getFQName(ownerTypeDescriptor).getFqName()); properties.setProperty(FileTemplate.ATTRIBUTE_SIMPLE_CLASS_NAME, ownerTypeDescriptor.getName().getName()); - properties.setProperty(FileTemplate.ATTRIBUTE_METHOD_NAME, methodName); + properties.setProperty(FileTemplate.ATTRIBUTE_METHOD_NAME, funcName); @NonNls String bodyText; try {