ModCommand (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { return ModCommand.psiUpdate(descriptor.getStartElement(), (element, updater) -> { final PsiJavaCodeReferenceElement referenceElement; if (descriptor.getHighlightType() == ProblemHighlightType.INFORMATION) { referenceElement = (PsiJavaCodeReferenceElement)element; } else { referenceElement = (PsiJavaCodeReferenceElement)element.getParent(); } applyFix(referenceElement, updater); }); }