From: Andy Clement Date: Fri, 21 Jan 2022 00:27:40 +0000 (-0800) Subject: protect against NPE for inheritance and annotation style X-Git-Tag: V1_9_8~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a6697eca3069ba13fea85827b86c6bc98b0df7be;p=aspectj.git protect against NPE for inheritance and annotation style --- diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java index 8ed7a0275..2eac468e1 100644 --- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java +++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java @@ -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));