type migration: disable refactoring on inappropriate contexts
authoranna <Anna.Kozlova@jetbrains.com>
Wed, 18 Jan 2012 14:14:56 +0000 (15:14 +0100)
committeranna <Anna.Kozlova@jetbrains.com>
Thu, 19 Jan 2012 14:59:57 +0000 (15:59 +0100)
java/java-impl/src/com/intellij/refactoring/typeMigration/actions/ChangeTypeSignatureAction.java

index 9ee56f95a60a31a31dd0be66a37c094182daf28b..4518059de4114f5bb6e8693084062c62374dd5e4 100644 (file)
@@ -55,7 +55,7 @@ public class ChangeTypeSignatureAction extends BaseRefactoringAction {
     if (referenceParameterList != null) {
       return referenceParameterList.getTypeArguments().length > 0;
     }
-    return true;
+    return PsiTreeUtil.getParentOfType(psiElement, PsiTypeElement.class) != null;
   }
 
   public RefactoringActionHandler getHandler(DataContext dataContext) {