void (@NotNull ActionContext context, @NotNull PsiAnnotation annotation, @NotNull ModPsiUpdater updater) { final PsiNameValuePair attribute = AnnotationUtil.findDeclaredAttribute(annotation, myName); if (myNewValue != null) { final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(context.project()); final PsiAnnotation dummyAnnotation = elementFactory.createAnnotationFromText("@A" + "(" + myName + "=" + myNewValue + ")", null); annotation.setDeclaredAttributeValue(myName, dummyAnnotation.getParameterList().getAttributes()[0].getValue()); } else if (attribute != null) { new CommentTracker().deleteAndRestoreComments(attribute); } }