// in it - see the other checks on BcelObjectType in this class.
if (realBinding instanceof MethodBinding) {
AbstractMethodDeclaration methodDecl = getTypeDeclaration().declarationOf((MethodBinding) realBinding);
if (methodDecl instanceof AnnotationMethodDeclaration) {
AnnotationMethodDeclaration annoMethodDecl = (AnnotationMethodDeclaration) methodDecl;
Expression e = annoMethodDecl.defaultValue;
if (e.resolvedType == null) {
e.resolve(methodDecl.scope);
}
// TODO does not cope with many cases...
if (e instanceof QualifiedNameReference) {
QualifiedNameReference qnr = (QualifiedNameReference) e;
if (qnr.binding instanceof FieldBinding) {
FieldBinding fb = (FieldBinding) qnr.binding;
StringBuffer sb = new StringBuffer();
sb.append(fb.declaringClass.signature());
sb.append(fb.name);
return sb.toString();
}
} else if (e instanceof TrueLiteral) {
return "true";
} else if (e instanceof FalseLiteral) {
return "false";
} else if (e instanceof StringLiteral) {
return new String(((StringLiteral) e).source());
} else if (e instanceof IntLiteral) {
return Integer.toString(((IntConstant) e.constant).intValue());
} else {
throw new BCException("EclipseResolvedMember.getAnnotationDefaultValue() not implemented for value of type '"
+ e.getClass() + "' - raise an AspectJ bug !");
}
}
}
return null;
}