summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2005-08-23 15:45:05 +0000
committeraclement <aclement>2005-08-23 15:45:05 +0000
commit9c1f6658a810785d91c865074a945da87124fca4 (patch)
tree55540d70da1d6cadd6a37482982716d177aae4cd /org.aspectj.ajdt.core
parent961f4ca9011d556c45f8bf7d5191b99a8010eeac (diff)
downloadaspectj-9c1f6658a810785d91c865074a945da87124fca4.tar.gz
aspectj-9c1f6658a810785d91c865074a945da87124fca4.zip
@override fix: previous version didnt cope with abstract ITDs (yuck)
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java28
1 files changed, 19 insertions, 9 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
index 7a7f54318..aa4f4db8a 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
@@ -15,6 +15,7 @@
import java.lang.reflect.Modifier;
import java.util.Iterator;
+import java.util.List;
import org.aspectj.ajdt.internal.compiler.ast.PointcutDeclaration;
import org.aspectj.ajdt.internal.compiler.ast.Proceed;
@@ -342,18 +343,27 @@ public class AjProblemReporter extends ProblemReporter {
// ignore ajc$ methods
if (new String(method.selector).startsWith("ajc$")) return;
+ ResolvedMember possiblyErroneousRm = factory.makeResolvedMember(method.binding);
ResolvedType onTypeX = factory.fromEclipse(method.binding.declaringClass);
- for (Iterator i = onTypeX.getInterTypeMungersIncludingSupers().iterator(); i.hasNext(); ) {
- ConcreteTypeMunger m = (ConcreteTypeMunger)i.next();
- ResolvedMember sig = m.getSignature();
- if (ResolvedType.matches(AjcMemberMaker.interMethod(sig,m.getAspectType(),
- sig.getDeclaringType().resolve(factory.getWorld()).isInterface()),
- factory.makeResolvedMember(method.binding))) {
- // match, so dont need to report a problem!
- return;
+ // Can't use 'getInterTypeMungersIncludingSupers()' since that will exclude abstract ITDs
+ // on any super classes - so we have to trawl up ourselves.. I wonder if this problem
+ // affects other code in the problem reporter that looks through ITDs...
+ ResolvedType supertypeToLookAt = onTypeX.getSuperclass();
+ while (supertypeToLookAt!=null) {
+ List itMungers = supertypeToLookAt.getInterTypeMungers();
+ for (Iterator i = itMungers.iterator(); i.hasNext(); ) {
+ ConcreteTypeMunger m = (ConcreteTypeMunger)i.next();
+ ResolvedMember sig = m.getSignature();
+ ResolvedMember rm = AjcMemberMaker.interMethod(sig,m.getAspectType(),
+ sig.getDeclaringType().resolve(factory.getWorld()).isInterface());
+ if (ResolvedType.matches(rm,possiblyErroneousRm)) {
+ // match, so dont need to report a problem!
+ return;
+ }
}
- }
+ supertypeToLookAt = supertypeToLookAt.getSuperclass();
+ }
// report the error...
super.methodMustOverride(method);
}