summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authorAndy Clement <andrew.clement@gmail.com>2012-09-20 13:38:35 -0700
committerAndy Clement <andrew.clement@gmail.com>2012-09-20 13:38:35 -0700
commitb8ebdc33c75aa081ac3bf9b1a45f79e4177467a6 (patch)
treef60813031e53c2e0962fd4e93e2393dd79273ad0 /org.aspectj.ajdt.core
parent2fa04b8a04b3527c5111918d8dda23121928473f (diff)
downloadaspectj-b8ebdc33c75aa081ac3bf9b1a45f79e4177467a6.tar.gz
aspectj-b8ebdc33c75aa081ac3bf9b1a45f79e4177467a6.zip
389456: avoid checking if the target is a binary type binding (probably already added the ITD on previous build)
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
index e77c20a23..f1dea7300 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java
@@ -19,6 +19,7 @@ import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
@@ -140,9 +141,16 @@ public class EclipseTypeMunger extends ConcreteTypeMunger {
if (onType == existingMember.getDeclaringType() && Modifier.isFinal(munger.getSignature().getModifiers())) {
// final modifier on default implementation is taken to mean that
// no-one else can provide an implementation
- MethodBinding offendingBinding = sourceType.getExactMethod(binding.selector, binding.parameters,
- sourceType.scope.compilationUnitScope());
- sourceType.scope.problemReporter().finalMethodCannotBeOverridden(offendingBinding, binding);
+ if (!(sourceType instanceof BinaryTypeBinding)) {
+ // If sourceType is a BinaryTypeBinding, this can indicate we are re-applying the ITDs to the target
+ // as we 'pull it in' to resolve something. This means the clash here is with itself ! So if the ITD
+ // was final when initially added to the target this error logic will trigger. We can't easily
+ // identify it was added via ITD, so I'm going to make this quick change to say avoid this error for
+ // BinaryTypeBindings
+ CompilationUnitScope cuScope = sourceType.scope.compilationUnitScope();
+ MethodBinding offendingBinding = sourceType.getExactMethod(binding.selector, binding.parameters, cuScope);
+ sourceType.scope.problemReporter().finalMethodCannotBeOverridden(offendingBinding, binding);
+ }
}
// so that we find methods from our superinterfaces later on...
findOrCreateInterTypeMemberFinder(sourceType);