void (@NotNull PsiModifierList modifierList, @NotNull final Set<String> modifiers) { if (modifiers.contains(PsiModifier.STATIC) || UtilityClassModifierProcessor.isModifierListSupported(modifierList)) { return; // skip static fields } final PsiClass searchableClass = PsiTreeUtil.getParentOfType(modifierList, PsiClass.class, true); if (searchableClass == null) { return; // Should not get here, but safer to check } @Nullable final PsiAnnotation fieldDefaultsAnnotation = PsiAnnotationSearchUtil.findAnnotation(searchableClass, LombokClassNames.FIELD_DEFAULTS); final boolean isConfigDefaultFinal = isConfigDefaultFinal(searchableClass); final boolean isConfigDefaultPrivate = isConfigDefaultPrivate(searchableClass); final PsiField parentField = (PsiField) modifierList.getParent(); // FINAL if (shouldMakeFinal(parentField, fieldDefaultsAnnotation, isConfigDefaultFinal)) { modifiers.add(PsiModifier.FINAL); } // VISIBILITY if (canChangeVisibility(parentField, modifierList)) { final String defaultAccessLevel = detectDefaultAccessLevel(fieldDefaultsAnnotation, isConfigDefaultPrivate); if (PsiModifier.PRIVATE.equals(defaultAccessLevel)) { modifiers.add(PsiModifier.PRIVATE); modifiers.remove(PsiModifier.PACKAGE_LOCAL); } else if (PsiModifier.PROTECTED.equals(defaultAccessLevel)) { modifiers.add(PsiModifier.PROTECTED); modifiers.remove(PsiModifier.PACKAGE_LOCAL); } else if (PsiModifier.PUBLIC.equals(defaultAccessLevel)) { modifiers.add(PsiModifier.PUBLIC); modifiers.remove(PsiModifier.PACKAGE_LOCAL); } } }