void (@NotNull PsiModifierList modifierList, @NotNull final Set<String> modifiers) { if (modifiers.contains(PsiModifier.STATIC) && modifierList.getParent() instanceof PsiField) { return; // skip static fields } final PsiModifierListOwner parentElement = PsiTreeUtil.getParentOfType(modifierList, PsiModifierListOwner.class, false); if (null != parentElement) { // FINAL if (!PsiAnnotationSearchUtil.isAnnotatedWith(parentElement, LombokClassNames.NON_FINAL)) { modifiers.add(PsiModifier.FINAL); } // PRIVATE if (modifierList.getParent() instanceof PsiField && // Visibility is only changed for package private fields hasPackagePrivateModifier(modifierList) && // except they are annotated with @PackagePrivate !PsiAnnotationSearchUtil.isAnnotatedWith(parentElement, LombokClassNames.PACKAGE_PRIVATE)) { modifiers.add(PsiModifier.PRIVATE); // IDEA _right now_ checks if other modifiers are set, and ignores PACKAGE_LOCAL but may as well clean it up modifiers.remove(PsiModifier.PACKAGE_LOCAL); } } }