// two possible reasons for it being null:
// 1. code is broken
// 2. this resolvedmember is an EclipseResolvedMember created up front to represent a privileged'd accessed member
if (tDecl != null) {
if (realBinding instanceof MethodBinding) {
MethodBinding methodBinding = (MethodBinding) realBinding;
AbstractMethodDeclaration methodDecl = tDecl.declarationOf(methodBinding);
if (methodDecl == null) {
// pr284862
// bindings may have been trashed by InterTypeMemberFinder.addInterTypeMethod() - and so we need to take
// a better look. Really this EclipseResolvedMember is broken...
// Grab the set of bindings with matching selector
MethodBinding[] mb = ((MethodBinding) realBinding).declaringClass.getMethods(methodBinding.selector);
if (mb != null) {
for (int m = 0, max = mb.length; m < max; m++) {
MethodBinding candidate = mb[m];
if (candidate instanceof InterTypeMethodBinding) {
if (InterTypeMemberFinder.matches(mb[m], methodBinding)) {
InterTypeMethodBinding intertypeMethodBinding = (InterTypeMethodBinding) candidate;
Annotation[] annos = intertypeMethodBinding.sourceMethod.annotations;
return annos;