aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-01-07 13:10:07 +0000
committeracolyer <acolyer>2004-01-07 13:10:07 +0000
commitc517e8507cbc0be482d3eb1be2694e3f6486a4e3 (patch)
treebf367565a440bb3007b85213648e475eb0abfd59 /org.aspectj.ajdt.core
parent6cded1d30cf1e59ee133ac08f44dabb7859b4fed (diff)
downloadaspectj-c517e8507cbc0be482d3eb1be2694e3f6486a4e3.tar.gz
aspectj-c517e8507cbc0be482d3eb1be2694e3f6486a4e3.zip
fix for bug 49457 - test for duplicate pointcut definitions in classes
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java2
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java11
2 files changed, 9 insertions, 4 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
index 90ac38a84..e30a1fa16 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
@@ -68,8 +68,6 @@ public class AspectDeclaration extends MemberTypeDeclaration {
return;
}
- if (concreteName != null) concreteName.checkPointcutDeclarations();
-
super.resolve();
}
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 711eb25fc..2969cc649 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
@@ -176,12 +176,13 @@ public class AjLookupEnvironment extends LookupEnvironment {
private void resolvePointcutDeclarations(ClassScope s) {
TypeDeclaration dec = s.referenceContext;
SourceTypeBinding sourceType = s.referenceContext.binding;
-
+ boolean hasPointcuts = false;
AbstractMethodDeclaration[] methods = dec.methods;
boolean initializedMethods = false;
if (methods != null) {
for (int i=0; i < methods.length; i++) {
if (methods[i] instanceof PointcutDeclaration) {
+ hasPointcuts = true;
if (!initializedMethods) {
sourceType.methods(); //force initialization
initializedMethods = true;
@@ -190,7 +191,13 @@ public class AjLookupEnvironment extends LookupEnvironment {
}
}
}
-
+
+ if (hasPointcuts || dec instanceof AspectDeclaration) {
+ ResolvedTypeX.Name name = (ResolvedTypeX.Name)factory.fromEclipse(sourceType);
+ EclipseSourceType eclipseSourceType = (EclipseSourceType)name.getDelegate();
+ eclipseSourceType.checkPointcutDeclarations();
+ }
+
ReferenceBinding[] memberTypes = sourceType.memberTypes;
for (int i = 0, length = memberTypes.length; i < length; i++) {
resolvePointcutDeclarations(((SourceTypeBinding) memberTypes[i]).scope);