}
}
private void findAnnotationChanges(IAnnotation[] oldAnnotations, IAnnotation[] newAnnotations, IJavaElement parent) {
ArrayList annotationDeltas = null;
for (int i = 0, length = newAnnotations.length; i < length; i++) {
IAnnotation newAnnotation = newAnnotations[i];
Object oldInfo = this.annotationInfos.remove(newAnnotation);
if (oldInfo == null) {
JavaElementDelta annotationDelta = new JavaElementDelta(newAnnotation);
annotationDelta.added();
if (annotationDeltas == null) annotationDeltas = new ArrayList();
annotationDeltas.add(annotationDelta);
continue;
} else {
AnnotationInfo newInfo = null;
try {
newInfo = (AnnotationInfo) ((JavaElement) newAnnotation).getElementInfo();
} catch (JavaModelException npe) {
return;
}
if (!Util.equalArraysOrNull(((AnnotationInfo) oldInfo).members, newInfo.members)) {
JavaElementDelta annotationDelta = new JavaElementDelta(newAnnotation);
annotationDelta.changed(IJavaElementDelta.F_CONTENT);
if (annotationDeltas == null) annotationDeltas = new ArrayList();
annotationDeltas.add(annotationDelta);
}
}
}
for (int i = 0, length = oldAnnotations.length; i < length; i++) {
IAnnotation oldAnnotation = oldAnnotations[i];
if (this.annotationInfos.remove(oldAnnotation) != null) {
JavaElementDelta annotationDelta = new JavaElementDelta(oldAnnotation);
annotationDelta.removed();
if (annotationDeltas == null) annotationDeltas = new ArrayList();
annotationDeltas.add(annotationDelta); }