void (PsiExpression @NotNull [] foundExpr, @NotNull PsiLiteralExpression originalExpression, @NotNull Collection<? super LocalQuickFix> fixes) { for (PsiExpression expr : foundExpr) { if (expr == originalExpression) continue; PsiElement parent = expr.getParent(); if (parent instanceof PsiField field) { if (field.getInitializer() == expr && field.hasModifierProperty(PsiModifier.STATIC)) { final PsiClass containingClass = field.getContainingClass(); if (containingClass == null) continue; boolean isAccessible = JavaPsiFacade.getInstance(field.getProject()).getResolveHelper().isAccessible(field, originalExpression, containingClass); if (!isAccessible && containingClass.getQualifiedName() == null) { continue; } fixes.add(LocalQuickFix.from(new ReplaceFix(field, originalExpression))); } } } }