BindingAnnotationFieldTypePattern btp = (BindingAnnotationFieldTypePattern) annotationTypePattern;
ResolvedType formalType = btp.getFormalType().resolve(shadow.getIWorld());
UnresolvedType annoType = btp.getAnnotationType();
// TODO 2 need to sort out appropriate creation of the AnnotationAccessFieldVar - what happens for
// reflective (ReflectionShadow) access to types?
Var var = shadow.getKindedAnnotationVar(annoType);
if (var == null) {
throw new BCException("Unexpected problem locating annotation at join point '" + shadow + "'");
}
state.set(btp.getFormalIndex(), var.getAccessorForValue(formalType));
} else if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
BindingAnnotationTypePattern btp = (BindingAnnotationTypePattern) annotationTypePattern;
UnresolvedType annotationType = btp.getAnnotationType();
Var var = shadow.getKindedAnnotationVar(annotationType);
// At this point, var *could* be null. The only reason this could happen (if we aren't failing...)
// is if another binding annotation designator elsewhere in the pointcut is going to expose the annotation
// eg. (execution(* a*(..)) && @annotation(foo)) || (execution(* b*(..)) && @this(foo))
// where sometimes @annotation will be providing the value, and sometimes