IntentionAction (PsiAnnotation annotation) { PsiAnnotationOwner owner = annotation.getOwner(); String name = annotation.getQualifiedName(); if (owner == null || name == null) return null; PsiNameValuePair[] attributes = annotation.getParameterList().getAttributes(); if (attributes.length == 0) { return QuickFixFactory.getInstance().createDeleteFix(annotation, JavaAnalysisBundle.message("intention.text.remove.annotation")); } if (attributes.length != 1) return null; PsiNameValuePair attribute = attributes[0]; if (attribute.getValue() == null) return null; PsiMethod annoMethod = findAttributeMethod(attribute); if (annoMethod == null || !(annoMethod.getReturnType() instanceof PsiArrayType)) return null; List<PsiAnnotation> annotations = findCollapsibleAnnotations(annotation, attribute); if (annotations.size() < 2) return null; return new CollapseAnnotationsFix(annotation).asIntention(); }