void (PsiModifierListOwner owner, List<String> toRemove, String toAdd, List<String> toKeep) { AddAnnotationPsiFix.removePhysicalAnnotations(owner, ArrayUtilRt.toStringArray(toRemove)); PsiModifierList modifierList = owner.getModifierList(); if (modifierList != null && !AnnotationUtil.isAnnotated(owner, toKeep, CHECK_TYPE)) { PsiAnnotation annotation = AddAnnotationPsiFix.addPhysicalAnnotationIfAbsent(toAdd, PsiNameValuePair.EMPTY_ARRAY, modifierList); if (annotation != null) { JavaCodeStyleManager.getInstance(myProject).shortenClassReferences(annotation); } } }