aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2006-02-01 16:16:16 +0000
committeraclement <aclement>2006-02-01 16:16:16 +0000
commit7a96a40ab7d5418309c4742bdb0225cd0dfb88ff (patch)
tree7f929c6aaded9dee0fabe166f155e47704ca251a
parentc5678d506d3d1ea2b18049d898c9c4fff4a2d1dc (diff)
downloadaspectj-7a96a40ab7d5418309c4742bdb0225cd0dfb88ff.tar.gz
aspectj-7a96a40ab7d5418309c4742bdb0225cd0dfb88ff.zip
thats better.
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java29
-rw-r--r--tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java8
2 files changed, 19 insertions, 18 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
index 8409b0e58..fa492d9c2 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java
@@ -421,7 +421,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
}
}
- if (hasPointcuts || dec instanceof AspectDeclaration || isAnnotationStyleAspectDeclaration(dec)) {
+ if (hasPointcuts || dec instanceof AspectDeclaration || couldBeAnnotationStyleAspectDeclaration(dec)) {
ReferenceType name = (ReferenceType)factory.fromEclipse(sourceType);
EclipseSourceType eclipseSourceType = (EclipseSourceType)name.getDelegate();
eclipseSourceType.checkPointcutDeclarations();
@@ -434,20 +434,21 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
}
/**
- * Return true if the declaration has @Aspect annotation
+ * Return true if the declaration has @Aspect annotation. Called 'couldBe' rather than
+ * 'is' because someone else may have defined an annotation called Aspect - we can't
+ * verify the full name (including package name) because it may not have been resolved
+ * just yet and rather going through expensive resolution when we dont have to, this
+ * gives us a cheap check that tells us whether to bother.
*/
- private boolean isAnnotationStyleAspectDeclaration(TypeDeclaration dec) {
- return false;
-// Annotation[] annotations = dec.annotations;
-// boolean isAtAspect = false;
-// if (annotations != null) {
-// for (int i = 0; i < annotations.length && !isAtAspect; i++) {
-// if (annotations[i].resolvedType.debugName().equals("org.aspectj.lang.annotation.Aspect")) {
-// isAtAspect = true;
-// }
-// }
-// }
-// return isAtAspect;
+ private boolean couldBeAnnotationStyleAspectDeclaration(TypeDeclaration dec) {
+ Annotation[] annotations = dec.annotations;
+ boolean couldBeAtAspect = false;
+ if (annotations != null) {
+ for (int i = 0; i < annotations.length && !couldBeAtAspect; i++) {
+ if (annotations[i].toString().equals("@Aspect")) couldBeAtAspect=true;
+ }
+ }
+ return couldBeAtAspect;
}
private void buildInterTypeAndPerClause(ClassScope s) {
diff --git a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
index a6a1d54f5..d47e36d8f 100644
--- a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
@@ -77,10 +77,10 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// public void testAtAspectInheritsAdviceWithTJPAndThis_pr125699 () {
// runTest("inherit adivce with this() and thisJoinPoint");
// }
-//
-// public void testAtAspectInheritsAbstractPointcut_pr125810 () {
-// runTest("warning when inherited pointcut not made concrete");
-// }
+
+ public void testAtAspectInheritsAbstractPointcut_pr125810 () {
+ runTest("warning when inherited pointcut not made concrete");
+ }
/*
* Load-time weaving bugs and enhancements