void (final IncorrectOperationException e, final PsiElement element, final Project project) { // may happen if the file or package cannot be renamed. e.g. locked by another application if (ApplicationManager.getApplication().isUnitTestMode()) { throw new RuntimeException(e); //LOG.error(e); //return; } ApplicationManager.getApplication().invokeLater(() -> { final String helpID = RenamePsiElementProcessorBase.forPsiElement(element).getHelpID(element); String message = e.getMessage(); if (StringUtil.isEmpty(message)) { message = RefactoringBundle.message("rename.not.supported"); } CommonRefactoringUtil.showErrorMessage(RefactoringBundle.message("rename.title"), message, helpID, project); }); }