ModCommand (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiElement element = descriptor.getPsiElement(); final PsiMethodCallExpression methodCallExpression = PsiTreeUtil.getParentOfType(element, PsiMethodCallExpression.class); if (methodCallExpression == null) { return ModCommand.nop(); } return ModCommand.updateOption(element, AutoCloseableResourceInspection.this, insp -> insp.myMethodMatcher.add(methodCallExpression)); }