From: aclement Date: Mon, 1 Dec 2008 19:03:01 +0000 (+0000) Subject: guard on field too X-Git-Tag: V1_6_3rc1~78 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d3e12916475820991d3b57310d0b9990c701a45f;p=aspectj.git guard on field too --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java index e5123c882..365373c5a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java @@ -197,16 +197,15 @@ public class EclipseResolvedMember extends ResolvedMemberImpl { } private Annotation[] getEclipseAnnotations() { - if (realBinding instanceof MethodBinding) { - TypeDeclaration tDecl = getTypeDeclaration(); - if (tDecl == null) { - return null; // if the code is broken then tDecl may be null + TypeDeclaration tDecl = getTypeDeclaration(); + if (tDecl != null) {// if the code is broken then tDecl may be null + if (realBinding instanceof MethodBinding) { + AbstractMethodDeclaration methodDecl = tDecl.declarationOf((MethodBinding) realBinding); + return methodDecl.annotations; + } else if (realBinding instanceof FieldBinding) { + FieldDeclaration fieldDecl = tDecl.declarationOf((FieldBinding) realBinding); + return fieldDecl.annotations; } - AbstractMethodDeclaration methodDecl = tDecl.declarationOf((MethodBinding) realBinding); - return methodDecl.annotations; - } else if (realBinding instanceof FieldBinding) { - FieldDeclaration fieldDecl = getTypeDeclaration().declarationOf((FieldBinding) realBinding); - return fieldDecl.annotations; } return null; }