diff options
author | aclement <aclement> | 2005-08-24 14:59:02 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-08-24 14:59:02 +0000 |
commit | a2978254819c3dffc226f3b644741bdaa0fee335 (patch) | |
tree | 8d7cc3710a7810015647808d436d6a269df9aeef /org.aspectj.ajdt.core | |
parent | 4fbd49aac473de47e08f2dc64b9617fd804a20ae (diff) | |
download | aspectj-a2978254819c3dffc226f3b644741bdaa0fee335.tar.gz aspectj-a2978254819c3dffc226f3b644741bdaa0fee335.zip |
with the fix to ensure the methodverifier in the compiler retrieves any inherited ITD methods correctly, had to change two error message handlers - so that they don't accidentally report something (because we will report it later with a better message)
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java | 24 |
1 files changed, 20 insertions, 4 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 aa4f4db8a..8615a2eef 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 @@ -130,7 +130,11 @@ public class AjProblemReporter extends ProblemReporter { private boolean isPointcutDeclaration(MethodBinding binding) { return CharOperation.prefixEquals(PointcutDeclaration.mangledPrefix, binding.selector); } - + + private boolean isIntertypeDeclaration(MethodBinding binding) { + return (binding instanceof InterTypeMethodBinding); + } + public void abstractMethodCannotBeOverridden( SourceTypeBinding type, MethodBinding concreteMethod) @@ -186,9 +190,9 @@ public class AjProblemReporter extends ProblemReporter { MethodBinding abstractMethod) { // if this is a PointcutDeclaration then there is no error - if (isPointcutDeclaration(abstractMethod)) { - return; - } + if (isPointcutDeclaration(abstractMethod)) return; + + if (isIntertypeDeclaration(abstractMethod)) return; // when there is a problem with an ITD not being implemented, it will be reported elsewhere if (CharOperation.prefixEquals("ajc$interField".toCharArray(), abstractMethod.selector)) { //??? think through how this could go wrong @@ -382,5 +386,17 @@ public class AjProblemReporter extends ProblemReporter { } return buffer.toString(); } + + public void visibilityConflict(MethodBinding currentMethod, MethodBinding inheritedMethod) { + // Not quite sure if the conditions on this test are right - basically I'm saying + // DONT WORRY if its ITDs since the error will be reported another way... + if (isIntertypeDeclaration(currentMethod) && + isIntertypeDeclaration(inheritedMethod) && + Modifier.isPrivate(currentMethod.modifiers) && + Modifier.isPrivate(inheritedMethod.modifiers)) { + return; + } + super.visibilityConflict(currentMethod,inheritedMethod); + } } |