diff options
author | Andy Clement <aclement@gopivotal.com> | 2014-09-17 10:53:29 -0700 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2014-09-17 10:53:29 -0700 |
commit | d0b8c7a1bfbc2b2f92b22bcf63598ab2442781b6 (patch) | |
tree | d013dd8b1e8b3c86091b483726697a66de9c795a /org.aspectj.ajdt.core | |
parent | d929114a6659d64d71c47f7bf8f70e9973e5c857 (diff) | |
download | aspectj-d0b8c7a1bfbc2b2f92b22bcf63598ab2442781b6.tar.gz aspectj-d0b8c7a1bfbc2b2f92b22bcf63598ab2442781b6.zip |
Fix for 444398: annotation style abstract aspect extends class error
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java index 12ffdc9fc..d24ff7a3c 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java @@ -1031,6 +1031,10 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { PerClause.Kind getPerClauseForTypeDeclaration(TypeDeclaration typeDeclaration) { Annotation[] annotations = typeDeclaration.annotations; + if (annotations == null) { + // Can happen if an aspect is extending a regular class + return null; + } for (int i = 0; i < annotations.length; i++) { Annotation annotation = annotations[i]; if (annotation != null && annotation.resolvedType != null @@ -1055,15 +1059,8 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { // safe // ? return determinePerClause(typeDeclaration, clause); - } else if (annotation instanceof NormalAnnotation) { // this - // kind - // if it - // was - // added - // by - // the - // visitor - // ! + } else if (annotation instanceof NormalAnnotation) { + // this kind if it was added by the visitor! // it is an @Aspect(...something...) NormalAnnotation theAnnotation = (NormalAnnotation) annotation; if (theAnnotation.memberValuePairs == null || theAnnotation.memberValuePairs.length < 1) { @@ -1080,8 +1077,7 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { "@Aspect annotation is expected to be SingleMemberAnnotation with 'String value()' as unique element", new EclipseSourceLocation(typeDeclaration.compilationResult, typeDeclaration.sourceStart, typeDeclaration.sourceEnd), null); - return PerClause.SINGLETON;// fallback strategy just to - // avoid NPE + return PerClause.SINGLETON;// fallback strategy just to avoid NPE } } } |