### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: model/org/eclipse/jdt/internal/core/ClassFileInfo.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java,v retrieving revision 1.44 diff -u -r1.44 ClassFileInfo.java --- model/org/eclipse/jdt/internal/core/ClassFileInfo.java 7 Mar 2009 01:08:08 -0000 1.44 +++ model/org/eclipse/jdt/internal/core/ClassFileInfo.java 8 Apr 2009 16:05:33 -0000 @@ -57,12 +57,24 @@ private void generateAnnotationInfo(JavaElement parent, HashMap newElements, IBinaryAnnotation annotationInfo) { char[] typeName = org.eclipse.jdt.core.Signature.toCharArray(CharOperation.replaceOnCopy(annotationInfo.getTypeName(), '/', '.')); Annotation annotation = new Annotation(parent, new String(typeName)); + while (newElements.containsKey(annotation)) { + annotation.occurrenceCount++; + } newElements.put(annotation, annotationInfo); IBinaryElementValuePair[] pairs = annotationInfo.getElementValuePairs(); for (int i = 0, length = pairs.length; i < length; i++) { Object value = pairs[i].getValue(); if (value instanceof IBinaryAnnotation) { generateAnnotationInfo(annotation, newElements, (IBinaryAnnotation) value); + } else if (value instanceof Object[]) { + // if the value is an array, it can have no more than 1 dimension - no need to recurse + Object[] valueArray = (Object[]) value; + for (int j = 0, valueArrayLength = valueArray.length; j < valueArrayLength; j++) { + Object nestedValue = valueArray[j]; + if (nestedValue instanceof IBinaryAnnotation) { + generateAnnotationInfo(annotation, newElements, (IBinaryAnnotation) nestedValue); + } + } } } } Index: model/org/eclipse/jdt/internal/core/util/Util.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java,v retrieving revision 1.129 diff -u -r1.129 Util.java --- model/org/eclipse/jdt/internal/core/util/Util.java 7 Mar 2009 00:58:54 -0000 1.129 +++ model/org/eclipse/jdt/internal/core/util/Util.java 8 Apr 2009 16:05:35 -0000 @@ -3098,6 +3098,14 @@ // values are heterogeneous, value kind is thus unknown memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN; } + if (value instanceof Annotation) { + Annotation annotation = (Annotation) value; + for (int j = 0; j < i; j++) { + if (annotation.equals(values[j])) { + annotation.occurrenceCount++; + } + } + } values[i] = value; } if (memberValuePair.valueKind == -1)