LocalQuickFix (@NotNull IntentionAction action) { if (action instanceof LocalQuickFix) { return (LocalQuickFix)action; } return new LocalQuickFix() { @Override public @NotNull String getName() { return action.getText(); } @Override public @NotNull String getFamilyName() { return action.getFamilyName(); } @Override public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { PsiFile psiFile = descriptor.getPsiElement().getContainingFile(); try { action.invoke(project, new LazyEditor(psiFile), psiFile); } catch (IncorrectOperationException e) { LOG.error(e); } } }; }