ModCommand (@NotNull ActionContext context, @NotNull PsiElement element) { final Set<PsiClassType> exceptions = new HashSet<>(); final PsiMethod targetMethod = collectExceptions(exceptions, element); if (targetMethod == null) return ModCommand.nop(); ModCommand command = addExceptionsToThrowsList(context.project(), targetMethod, exceptions, myProcessHierarchy); if (command == null) { return new ModChooseAction(QuickFixBundle.message("add.exception.to.throws.header", exceptions.size()), List.of( new AddExceptionToThrowsFix(element, ThreeState.YES), new AddExceptionToThrowsFix(element, ThreeState.NO))); } return command; }