if (annotations == null) {
return;
}
for (Annotation a : annotations) {
JAnnotation annotation;
ReferenceBinding binding = (ReferenceBinding) a.resolvedType;
String name = CharOperation.toString(binding.compoundName);
boolean record = false;
for (String prefix : JProgram.RECORDED_ANNOTATION_PACKAGES) {
if (name.startsWith(prefix + ".")) {
record = true;
break;
}
}
if (!record) {
continue;
}
JInterfaceType annotationType = (JInterfaceType) typeMap.tryGet(binding);
if (annotationType != null) {
annotation = new JAnnotation(x.getSourceInfo(), annotationType);
} else {
// Indicates a binary-only annotation type
JInterfaceType externalType = getOrCreateExternalType(
x.getSourceInfo(), binding.compoundName);
annotation = new JAnnotation(x.getSourceInfo(), externalType);
}
processAnnotationProperties(x.getSourceInfo(), annotation,
a.computeElementValuePairs());
x.addAnnotation(annotation);
}