]> source.dussan.org Git - aspectj.git/commitdiff
protect against NPE for inheritance and annotation style
authorAndy Clement <aclement@pivotal.io>
Fri, 21 Jan 2022 00:27:40 +0000 (16:27 -0800)
committerAndy Clement <aclement@pivotal.io>
Fri, 21 Jan 2022 00:27:40 +0000 (16:27 -0800)
org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java

index 8ed7a0275a47204c56812e7a33eaae53e1b6fc03..2eac468e129920321b16034f732657b3d0811c58 100644 (file)
@@ -1147,13 +1147,12 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate {
                        } else {
                                kind = null;
                        }
-               } else if (binding instanceof SourceTypeBinding) {
+               } else if (binding instanceof SourceTypeBinding && ((SourceTypeBinding)binding).scope != null) {
                        SourceTypeBinding sourceSc = (SourceTypeBinding) binding;
                        if (sourceSc.scope.referenceContext instanceof AspectDeclaration) {
                                // code style
                                kind = ((AspectDeclaration) sourceSc.scope.referenceContext).perClause.getKind();
-                       } else { // if (sourceSc.scope.referenceContext instanceof
-                               // TypeDeclaration) {
+                       } else { // if (sourceSc.scope.referenceContext instanceof TypeDeclaration) {
                                // if @Aspect: perFromSuper, else if @Aspect(..) get from anno
                                // value, else null
                                kind = getPerClauseForTypeDeclaration((sourceSc.scope.referenceContext));