void (@NotNull PsiModifierList modifierList, @NotNull Map<String, Map<String, PsiNameValuePair>> annotations) { PsiAnnotation[] rawAnnotations = modifierList instanceof GrModifierList ? ((GrModifierList)modifierList).getRawAnnotations() : modifierList.getAnnotations(); for (PsiAnnotation annotation : rawAnnotations) { final String qname = annotation.getQualifiedName(); if (qname == null || qname.equals(GROOVY_TRANSFORM_ANNOTATION_COLLECTOR) || qname.startsWith("java.lang.annotation")) continue; final PsiNameValuePair[] attributes = annotation.getParameterList().getAttributes(); for (PsiNameValuePair pair : attributes) { Map<String, PsiNameValuePair> map = annotations.get(qname); if (map == null) { map = new LinkedHashMap<>(); annotations.put(qname, map); } map.put(pair.getName() != null ? pair.getName() : "value", pair); } if (attributes.length == 0 && !annotations.containsKey(qname)) { annotations.put(qname, new LinkedHashMap<>()); } } }