LocalQuickFix (@NotNull PsiModifierListOwner deprecatedElement, @NotNull PsiElement elementToHighlight) { PsiMethodCallExpression methodCall = getMethodCall(elementToHighlight); if (deprecatedElement instanceof PsiMethod method && methodCall != null) { PsiMethod replacement = findReplacementInJavaDoc(method, methodCall); if (replacement != null) { ModCommandAction action = new ReplaceMethodCallFix((PsiMethodCallExpression)elementToHighlight.getParent().getParent(), replacement); return LocalQuickFix.from(action); } } if (deprecatedElement instanceof PsiField field) { PsiReferenceExpression referenceExpression = getFieldReferenceExpression(elementToHighlight); if (referenceExpression != null) { PsiMember replacement = findReplacementInJavaDoc(field, referenceExpression); if (replacement != null) { ModCommandAction action = new ReplaceFieldReferenceFix(referenceExpression, replacement); return LocalQuickFix.from(action); } } } return null; }