cleanup
authorMaxim.Medvedev <maxim.medvedev@jetbrains.com>
Tue, 31 Jan 2012 15:15:56 +0000 (19:15 +0400)
committerMaxim.Medvedev <maxim.medvedev@jetbrains.com>
Wed, 1 Feb 2012 12:00:20 +0000 (16:00 +0400)
18 files changed:
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/DynamicManager.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/DynamicManagerImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/DynamicToolWindowWrapper.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/MyPair.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/elements/DClassElement.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/elements/DItemElement.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/elements/DMethodElement.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/elements/DNamedElement.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/elements/DPropertyElement.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/elements/DTypedElement.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicDialog.form
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicDialog.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicMethodDialog.form [deleted file]
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicMethodDialog.java
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicPropertyDialog.form [deleted file]
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicPropertyDialog.java
plugins/groovy/src/org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle.properties
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/GroovyPsiElementFactory.java

index 06296cd5eae4798f525e082976dabb461ad91516..885efe18347e6c580b1d03d9229028d7ef85ece2 100644 (file)
@@ -78,8 +78,10 @@ public abstract class DynamicManager implements ProjectComponent, PersistentStat
   @Nullable
   public abstract String getPropertyType(String className, String propertyName);
 
+  @Nullable
   public abstract String replaceDynamicPropertyName(String className, String oldPropertyName, String newPropertyName);
 
+  @Nullable
   public abstract String replaceDynamicPropertyType(String className, String propertyName, String oldPropertyType, String newPropertyType);
 
   @Nullable
index 5750b5ede6f1162de1ee79d0e0c329385da0b7cd..81a6c6e6af241a08607328e435dcb3b55e2b3cbd 100644 (file)
@@ -238,6 +238,7 @@ public class DynamicManagerImpl extends DynamicManager {
     return myRootElement;
   }
 
+  @Nullable
   public String replaceDynamicPropertyName(String className, String oldPropertyName, String newPropertyName) {
     final DClassElement classElement = findClassElement(getRootElement(), className);
     if (classElement == null) return null;
@@ -253,6 +254,7 @@ public class DynamicManagerImpl extends DynamicManager {
     return newPropertyName;
   }
 
+  @Nullable
   public String replaceDynamicPropertyType(String className, String propertyName, String oldPropertyType, String newPropertyType) {
     final DPropertyElement property = findConcreteDynamicProperty(className, propertyName);
 
@@ -268,8 +270,11 @@ public class DynamicManagerImpl extends DynamicManager {
   */
 
   @Nullable
-  public DMethodElement findConcreteDynamicMethod(DRootElement rootElement, String conatainingClassName, String methodName, String[] parametersTypes) {
-    DClassElement classElement = findClassElement(rootElement, conatainingClassName);
+  private static DMethodElement findConcreteDynamicMethod(DRootElement rootElement,
+                                                          String containingClassName,
+                                                          String methodName,
+                                                          String[] parametersTypes) {
+    DClassElement classElement = findClassElement(rootElement, containingClassName);
     if (classElement == null) return null;
 
     return classElement.getMethod(methodName, parametersTypes);
@@ -277,8 +282,8 @@ public class DynamicManagerImpl extends DynamicManager {
 
   //  @Nullable
 
-  public DMethodElement findConcreteDynamicMethod(String conatainingClassName, String name, String[] parameterTypes) {
-    return findConcreteDynamicMethod(getRootElement(), conatainingClassName, name, parameterTypes);
+  public DMethodElement findConcreteDynamicMethod(String containingClassName, String name, String[] parameterTypes) {
+    return findConcreteDynamicMethod(getRootElement(), containingClassName, name, parameterTypes);
   }
 
   private void removeMethodElement(DMethodElement methodElement) {
@@ -385,8 +390,8 @@ public class DynamicManagerImpl extends DynamicManager {
   }
 
   @Nullable
-  public DPropertyElement findConcreteDynamicProperty(final String conatainingClassName, final String propertyName) {
-    return findConcreteDynamicProperty(getRootElement(), conatainingClassName, propertyName);
+  public DPropertyElement findConcreteDynamicProperty(final String containingClassName, final String propertyName) {
+    return findConcreteDynamicProperty(getRootElement(), containingClassName, propertyName);
   }
 
   @Nullable
index 9b7bfa5b85010e47d327c465bf034b5d5ab239b6..29d5ef151c1677282ca344ab07dc076b9922cf59 100644 (file)
@@ -63,7 +63,10 @@ import javax.swing.*;
 import javax.swing.event.CellEditorListener;
 import javax.swing.event.ChangeEvent;
 import javax.swing.table.TableCellRenderer;
-import javax.swing.tree.*;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.MutableTreeNode;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
 import java.awt.*;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -362,7 +365,7 @@ public class DynamicToolWindowWrapper {
       }
     }, KeyStroke.getKeyStroke(KeyEvent.VK_F2, InputEvent.CTRL_MASK), JComponent.WHEN_FOCUSED);
 
-    // todo use "myTreeTable.setAutoCreateRowSorter(true);" since 1.6
+    myTreeTable.setAutoCreateRowSorter(true);
 
     myTreeTable.getTree().setShowsRootHandles(true);
     myTreeTable.getTableHeader().setReorderingAllowed(false);
@@ -371,10 +374,10 @@ public class DynamicToolWindowWrapper {
     myTreeTable.getColumn(myColumnNames[CLASS_OR_ELEMENT_NAME_COLUMN]).setPreferredWidth(200);
     myTreeTable.getColumn(myColumnNames[TYPE_COLUMN]).setPreferredWidth(160);
 
-    JScrollPane scrollpane = ScrollPaneFactory.createScrollPane(myTreeTable);
+    JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTreeTable);
 
-    scrollpane.setPreferredSize(new Dimension(600, 400));
-    return scrollpane;
+    scrollPane.setPreferredSize(new Dimension(600, 400));
+    return scrollPane;
   }
 
   private void deleteRow() {
@@ -568,7 +571,7 @@ public class DynamicToolWindowWrapper {
 
           filterText = getFilter();
           if (filterText == null || filterText.isEmpty()) {
-            ((DItemElement)childObject).setHightlightedText("");
+            ((DItemElement)childObject).setHighlightedText("");
 
             dynamicNodes.add(dynamicNode);
             dynamicNode = (DefaultMutableTreeNode)classNode.getChildAfter(dynamicNode);
@@ -578,7 +581,7 @@ public class DynamicToolWindowWrapper {
           final String name = (((DItemElement)childObject)).getName();
 
           if (name.contains(filterText)) {
-            ((DItemElement)childObject).setHightlightedText(filterText);
+            ((DItemElement)childObject).setHighlightedText(filterText);
             dynamicNodes.add(dynamicNode);
           }
 
@@ -641,7 +644,7 @@ public class DynamicToolWindowWrapper {
 
       if (value instanceof DItemElement) {
         final DItemElement itemElement = ((DItemElement)value);
-        final String substringToHighlight = itemElement.getHightlightedText();
+        final String substringToHighlight = itemElement.getHighlightedText();
         final String name = itemElement.getName();
 
         if (substringToHighlight != null) {
index 0ba1562ee935000e745d6e2f68df944ad5f22fad..6b6a81a8e846e0ae55f8a1b9d8dd3c67f85bc3c7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 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.
  */
 package org.jetbrains.plugins.groovy.annotator.intentions.dynamic;
 
-import java.util.Arrays;
-
 /**
  * User: Dmitry.Krasilschikov
  * Date: 29.02.2008
  */
-public class MyPair  {
+public class MyPair {
   public String first = null;
   public String second = null;
 
-  public MyPair() {
-  }
+  public MyPair() {}
 
   public MyPair(String first, String second) {
     this.first = first;
@@ -36,7 +33,7 @@ public class MyPair  {
   public void setFirst(String first) {
     this.first = first;
   }
-  
+
   public void setSecond(String second) {
     this.second = second;
   }
@@ -44,18 +41,14 @@ public class MyPair  {
   public final int hashCode() {
     int hashCode = 0;
     if (first != null) {
-      hashCode += hashCode(first);
+      hashCode += first.hashCode();
     }
     if (second != null) {
-      hashCode += hashCode(second);
+      hashCode += second.hashCode();
     }
     return hashCode;
   }
 
-  private static int hashCode(final Object o) {
-    return (o instanceof Object[]) ? Arrays.hashCode((Object[]) o) : o.hashCode();
-  }
-
   public String toString() {
     return "<" + first + "," + second + ">";
   }
index 82bb77dd0840084a2c07cc5c405311460142e2ff..11674b169d07aeb844bf1e8a9a0f9c293ad5d956 100644 (file)
@@ -31,16 +31,10 @@ public class DClassElement implements DNamedElement {
   public String myName;
   public Set<DPropertyElement> myProperties = new HashSet<DPropertyElement>();
   public Set<DMethodElement> myMethods = new HashSet<DMethodElement>();
-  private Project myProject;
-
-  public DClassElement() {
-  }
 
   public DClassElement(Project project, String name) {
-    myProject = project;
     myName = name;
-
-    DynamicManager.getInstance(myProject).getRootElement().mergeAddClass(this);
+    DynamicManager.getInstance(project).getRootElement().mergeAddClass(this);
   }
 
   public void addMethod(DMethodElement methodElement) {
@@ -61,6 +55,7 @@ public class DClassElement implements DNamedElement {
     }
   }
 
+  @Nullable
   public DPropertyElement getPropertyByName(String propertyName) {
     for (final DPropertyElement property : myProperties) {
       if (propertyName.equals(property.getName())) {
index 98c98b5315de91ac8507b59fd9fc0e71c5804a4a..36bacdd4016956215d388b0093fd87c32cd2d7e1 100644 (file)
@@ -18,6 +18,7 @@ package org.jetbrains.plugins.groovy.annotator.intentions.dynamic.elements;
 import com.intellij.psi.PsiManager;
 import com.intellij.psi.PsiNamedElement;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * User: Dmitry.Krasilschikov
@@ -34,20 +35,20 @@ public abstract class DItemElement implements DNamedElement, DTypedElement, Comp
   public String myName = null;
 
 //  @NotNull
-  public String myHightlightedText = null;
+  public String myHighlightedText = null;
 
-  public DItemElement(Boolean isStatic, String name, String type) {
+  public DItemElement(@Nullable Boolean isStatic, @Nullable String name, @Nullable String type) {
     myStatic = isStatic;
     myName = name;
     myType = type;
   }
 
-  public String getHightlightedText() {
-    return myHightlightedText;
+  public String getHighlightedText() {
+    return myHighlightedText;
   }
 
-  public void setHightlightedText(String hightlightedText) {
-    myHightlightedText = hightlightedText;
+  public void setHighlightedText(String highlightedText) {
+    myHighlightedText = highlightedText;
   }
 
   public boolean equals(Object o) {
index 2b07b647b2cf8463d72e73cd2f341a534730cc93..1b69996d5746ee3eead134378c972a1d82d25c72 100644 (file)
@@ -39,6 +39,7 @@ public class DMethodElement extends DItemElement {
   public List<MyPair> myPairs = new ArrayList<MyPair>();
   private PsiMethod myImplicitMethod;
 
+  @SuppressWarnings("UnusedDeclaration") //for serialization
   public DMethodElement() {
     super(null, null, null);
   }
@@ -71,8 +72,8 @@ public class DMethodElement extends DItemElement {
     }
 
     final String[] argumentsTypes = QuickfixUtil.getArgumentsTypes(myPairs);
-    final GrMethod method = GroovyPsiElementFactory.getInstance(manager.getProject())
-        .createMethodFromText(staticModifier, getName(), type, argumentsTypes, null);
+    final GroovyPsiElementFactory factory = GroovyPsiElementFactory.getInstance(manager.getProject());
+    final GrMethod method = factory.createMethodFromText(staticModifier, getName(), type, argumentsTypes, null);
 
     myImplicitMethod = new GrDynamicImplicitMethod(manager, method, containingClassName) {
       @Override
index 4a6a8fdab4eab50e9894263ae1e7b24ad8db9993..aacff848fd71b3d99fcf970adb2546c2c1e08aa0 100644 (file)
@@ -20,7 +20,7 @@ package org.jetbrains.plugins.groovy.annotator.intentions.dynamic.elements;
  * Date: 04.03.2008
  */
 public interface DNamedElement {
-  public String getName();
+  String getName();
 
-  public void setName(String name);
+  void setName(String name);
 }
index 05b8bee7e9e033325e3e6da54655c503d675e32f..eb3489d2ae170c71205c016cbc7c61f3d3a969d3 100644 (file)
@@ -29,6 +29,7 @@ public class DPropertyElement extends DItemElement {
   private GrDynamicImplicitProperty myPsi;
 
   //Do not use directly! Persistence component uses default constructor for deserializable
+  @SuppressWarnings("UnusedDeclaration")
   public DPropertyElement() {
     super(null, null, null);
   }
index eb463a012c023f6d123f0f47f9323953236564c4..7bed7111c3426ece18bb6b8cdd88e49478756418 100644 (file)
@@ -20,7 +20,7 @@ package org.jetbrains.plugins.groovy.annotator.intentions.dynamic.elements;
  * Date: 04.03.2008
  */
 public interface DTypedElement {
-  public String getType();
+  String getType();
 
-  public void setType(String type);
+  void setType(String type);
 }
index 036bae47b0ed6ddccaa25ea6ed99b750efbe3693..33a7a8bb7748e3ed00d5b47b784f01c8320c0d37 100644 (file)
@@ -3,7 +3,7 @@
   <grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="8" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
     <margin top="0" left="0" bottom="0" right="0"/>
     <constraints>
-      <xy x="20" y="20" width="348" height="227"/>
+      <xy x="20" y="20" width="348" height="254"/>
     </constraints>
     <properties/>
     <border type="none"/>
@@ -19,6 +19,7 @@
           <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
         </constraints>
         <properties>
+          <labelFor value="397c0"/>
           <text resource-bundle="org/jetbrains/plugins/groovy/intentions/GroovyIntentionsBundle" key="dynamic.property.dialog.class"/>
         </properties>
       </component>
@@ -27,7 +28,8 @@
           <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
         </constraints>
         <properties>
-          <text value="type"/>
+          <labelFor value="1d610"/>
+          <text value="&amp;Type:"/>
         </properties>
       </component>
       <component id="1d610" class="javax.swing.JComboBox" binding="myTypeComboBox">
@@ -81,7 +83,7 @@
           <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
         </constraints>
         <properties>
-          <text value="Static"/>
+          <text value="&amp;Static"/>
         </properties>
       </component>
     </children>
index 2d6746084924c2101345c09efd558cc5ae4080ef..7773766b80b5a61ef2e40bd02b0b1bcd7365327f 100644 (file)
@@ -33,6 +33,7 @@ import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.ProjectScope;
 import com.intellij.ui.EditorComboBoxEditor;
 import com.intellij.ui.EditorTextField;
+import com.intellij.ui.components.JBScrollPane;
 import com.intellij.util.IncorrectOperationException;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.plugins.groovy.GroovyBundle;
@@ -73,6 +74,7 @@ public abstract class DynamicDialog extends DialogWrapper {
   private JTable myParametersTable;
   private JLabel myTableLabel;
   private JCheckBox myStaticCheckBox;
+  private JBScrollPane myTablePane;
   private final DynamicManager myDynamicManager;
   private final Project myProject;
   private final EventListenerList myListenerList = new EventListenerList();
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicMethodDialog.form b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicMethodDialog.form
deleted file mode 100644 (file)
index 77b57b7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.plugins.groovy.annotator.intentions.dynamic.ui.DynamicMethodDialog">
-  <grid id="27dc6" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
-    <margin top="0" left="0" bottom="0" right="0"/>
-    <constraints>
-      <xy x="20" y="20" width="316" height="262"/>
-    </constraints>
-    <properties/>
-    <border type="none"/>
-    <children/>
-  </grid>
-</form>
index 0054c8f3f08ca8a262d7620d757e4e7a944c4999..23f4687d6b607714ff96817ad806161ea2dec11a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 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.
@@ -43,11 +43,9 @@ import java.util.List;
  * Date: 18.02.2008
  */
 public class DynamicMethodDialog extends DynamicDialog {
-  private final GrReferenceExpression myReferenceExpression;
 
   public DynamicMethodDialog(GrReferenceExpression referenceExpression) {
     super(referenceExpression, QuickfixUtil.createSettings(referenceExpression), GroovyExpectedTypesProvider.calculateTypeConstraints((GrExpression)referenceExpression.getParent()));
-    myReferenceExpression = referenceExpression;
     assert getSettings().isMethod();
 
     final List<MyPair> pairs = getSettings().getPairs();
diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicPropertyDialog.form b/plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/intentions/dynamic/ui/DynamicPropertyDialog.form
deleted file mode 100644 (file)
index 12d2daa..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.plugins.groovy.annotator.intentions.dynamic.ui.DynamicPropertyDialog">
-  <grid id="27dc6" row-count="1" column-count="1" layout-manager="GridLayoutManager">
-    <margin top="0" left="0" bottom="0" right="0"/>
-    <constraints>
-      <xy x="20" y="20" width="500" height="400"/>
-      <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
-    </constraints>
-    <properties/>
-    <border type="none"/>
-    <children/>
-  </grid>
-</form>
index 98c3dd49e7defda435819e54e199aec177b4f250..949e59cc5419c1f118ce47ad3ac7e8c888f90807 100644 (file)
@@ -28,20 +28,16 @@ import org.jetbrains.plugins.groovy.lang.psi.expectedTypes.SupertypeConstraint;
  * Date: 18.02.2008
  */
 public class DynamicPropertyDialog extends DynamicDialog {
-  private final GrReferenceExpression myReferenceExpression;
-  private final GrArgumentLabel myLabel;
 
   public DynamicPropertyDialog(GrReferenceExpression referenceExpression) {
-    super(referenceExpression, QuickfixUtil.createSettings(referenceExpression), GroovyExpectedTypesProvider.calculateTypeConstraints(referenceExpression));
-    myReferenceExpression = referenceExpression;
-    myLabel = null;
+    super(referenceExpression, QuickfixUtil.createSettings(referenceExpression),
+          GroovyExpectedTypesProvider.calculateTypeConstraints(referenceExpression));
     setTitle(GroovyBundle.message("add.dynamic.property", referenceExpression.getReferenceName()));
     setUpTypeLabel(GroovyBundle.message("dynamic.method.property.type"));
   }
 
   public DynamicPropertyDialog(GrArgumentLabel label, PsiClass targetClass) {
-    super(label, QuickfixUtil.createSettings(label, targetClass), new SupertypeConstraint[]{SupertypeConstraint.create(label.getNamedArgument().getExpression().getType())});
-    myLabel = label;
-    myReferenceExpression = null;
+    super(label, QuickfixUtil.createSettings(label, targetClass),
+          new SupertypeConstraint[]{SupertypeConstraint.create(label.getNamedArgument().getExpression().getType())});
   }
 }
index 14e5bb9b7906b2ea75a2fa2684d2d7a63845cc86..bf35a9407a0e637274325a701dcb29a172dd94a2 100644 (file)
@@ -59,7 +59,7 @@ indexing.method.conversion.intention.name=Convert to [] form
 indexing.method.conversion.intention.family.name=Convert Indexing Method To [] Form
 indexed.expression.conversion.intention.name=Convert [] access to method form
 indexed.expression.conversion.intention.family.name=Convert [] Form To Index Method
-dynamic.property.dialog.class=&Class
+dynamic.property.dialog.class=&Class\:
 dynamic.property.dialog.type=&Type of property
 remove.parentheses.from.method.call.intention.family.name=Remove Unnecessary Parentheses from Method Call
 remove.parentheses.from.method.call.intention.name=Remove Unnecessary Parentheses
index b88c3b12613c82a245e34341e182e001a7df20f5..6c2582f762cb7ba3bb590766e9920a78e605fb4e 100644 (file)
@@ -199,7 +199,7 @@ public abstract class GroovyPsiElementFactory implements JVMElementFactory {
 
   public abstract GroovyFile createGroovyFile(String text, boolean isPhysical, @Nullable PsiElement context);
 
-  public abstract GrMethod createMethodFromText(String modifier, String name, String type, String[] paramTypes, PsiElement context);
+  public abstract GrMethod createMethodFromText(String modifier, String name, String type, String[] paramTypes, @Nullable PsiElement context);
 
   public abstract GrMethod createConstructorFromText(@NotNull String constructorName,
                                                      String[] paramTypes,