From ef5c2cbf024c8f221ec4f76b12fa16c478e8e5f2 Mon Sep 17 00:00:00 2001 From: jhugunin Date: Fri, 3 Jan 2003 19:17:41 +0000 Subject: [PATCH] making inter-type decls work with incremental mode (partially there) --- .../compiler/ast/AspectDeclaration.java | 2 +- .../compiler/lookup/EclipseObjectType.java | 1 + .../compiler/lookup/InterTypeScope.java | 23 ++++++++++++------- 3 files changed, 17 insertions(+), 9 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 a52d3cad1..cf9740180 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 @@ -561,7 +561,7 @@ public class AspectDeclaration extends MemberTypeDeclaration { private PerClause.Kind lookupPerClauseKind(ReferenceBinding binding) { - if (binding instanceof SourceTypeBinding) { + if (binding instanceof SourceTypeBinding && !(binding instanceof BinaryTypeBinding)) { SourceTypeBinding sourceSc = (SourceTypeBinding)binding; if (sourceSc.scope.referenceContext instanceof AspectDeclaration) { PerClause perClause = ((AspectDeclaration)sourceSc.scope.referenceContext).perClause; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseObjectType.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseObjectType.java index 6939d8580..4167cecaa 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseObjectType.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseObjectType.java @@ -43,6 +43,7 @@ public class EclipseObjectType extends ResolvedTypeX.Name { public boolean isAspect() { + if (binding instanceof BinaryTypeBinding) return false; if (!(binding instanceof SourceTypeBinding)) return false; //XXX assume SourceBinding throughout return ((SourceTypeBinding)binding).scope.referenceContext instanceof AspectDeclaration; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java index 05bddbd58..2a70e641e 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/InterTypeScope.java @@ -17,16 +17,19 @@ import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.lookup.*; public class InterTypeScope extends ClassScope { + ReferenceBinding onType; - public InterTypeScope(Scope parent, TypeBinding onType) { + public InterTypeScope(Scope parent, ReferenceBinding onType) { super(parent, null); - if (onType instanceof SourceTypeBinding) { - referenceContext = new TypeDeclaration(null); - referenceContext.binding = ((SourceTypeBinding)onType); - } else { - throw new RuntimeException("unimplemented"); - } - //System.out.println("encolsingSource: " + this.enclosingSourceType()); + referenceContext = new TypeDeclaration(null); + referenceContext.binding = makeSourceTypeBinding(onType); + this.onType = onType; + } + + private SourceTypeBinding makeSourceTypeBinding(ReferenceBinding onType) { + if (onType instanceof SourceTypeBinding) return (SourceTypeBinding)onType; + else throw new RuntimeException("can't handle: " + onType); + //return new FakeSourceTypeBinding(onType); } public FieldBinding findField( @@ -42,6 +45,10 @@ public class InterTypeScope extends ClassScope { return parent.enclosingSourceType(); } + public ReferenceBinding effectiveThisType() { + return onType; + } + public int addDepth() { return 0; } -- 2.39.5