private static void invokeOnElement(Project project, @Nullable Editor editor, PsiElement element) {
    if (element instanceof PsiMethod && ((PsiMethod)element).getNameIdentifier() != null) {
      invoke((PsiMethod) element, project, editor);
    }
    else if (element instanceof PsiClass) {
      invoke((PsiClass) element, editor);
    }
    else {
      String message = RefactoringBundle.getCannotRefactorMessage(RefactoringBundle.message("error.wrong.caret.position.method.or.class.name"));
      CommonRefactoringUtil.showErrorHint(project, editor, message, RefactoringBundle.message("changeSignature.refactoring.name"), HelpID.CHANGE_SIGNATURE);
    }
  }
private static void invokeOnElement(Project project, @Nullable Editor editor, PsiElement element)