From a6697eca3069ba13fea85827b86c6bc98b0df7be Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Thu, 20 Jan 2022 16:27:40 -0800 Subject: [PATCH] protect against NPE for inheritance and annotation style --- .../ajdt/internal/compiler/lookup/EclipseSourceType.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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)); -- 2.39.5