private static void doRefactoring(@NotNull Project project, @NotNull ExtractMethodProcessor processor) {
    try {
      final RefactoringEventData beforeData = new RefactoringEventData();
      beforeData.addElements(processor.myElements);
      project.getMessageBus().syncPublisher(
        RefactoringEventListener.REFACTORING_EVENT_TOPIC).refactoringStarted("refactoring.extract.method", beforeData);

      processor.doRefactoring();

      final RefactoringEventData data = new RefactoringEventData();
      data.addElement(processor.getExtractedMethod());
      project.getMessageBus().syncPublisher(RefactoringEventListener.REFACTORING_EVENT_TOPIC)
        .refactoringDone("refactoring.extract.method", data);
    }
    catch (IncorrectOperationException e) {
      LOG.error(e);
    }
  }
private static void doRefactoring(@NotNull Project project, @NotNull ExtractMethodProcessor processor)