void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final PsiElement grandParent = element.getParent().getParent(); if (!(grandParent instanceof PsiMethodCallExpression methodCall)) { return; } final PsiReferenceExpression methodExpression = methodCall.getMethodExpression(); final PsiExpression qualifier = methodExpression.getQualifierExpression(); final PsiExpression strippedQualifier = PsiUtil.skipParenthesizedExprDown(qualifier); if (strippedQualifier == null) { return; } CommentTracker commentTracker = new CommentTracker(); if (strippedQualifier instanceof PsiReferenceExpression referenceExpression) { final PsiElement target = referenceExpression.resolve(); if (target instanceof PsiField field) { final PsiClass containingClass = field.getContainingClass(); if (containingClass == null) { return; } final String classname = containingClass.getQualifiedName(); if (CommonClassNames.JAVA_LANG_BOOLEAN.equals(classname)) { @NonNls final String name = field.getName(); if ("TRUE".equals(name)) { PsiReplacementUtil.replaceExpression(methodCall, "true", commentTracker); return; } else if ("FALSE".equals(name)) { PsiReplacementUtil.replaceExpression(methodCall, "false", commentTracker); return; } } } } final String strippedQualifierText = commentTracker.text(strippedQualifier); PsiReplacementUtil.replaceExpression(methodCall, strippedQualifierText, commentTracker); }