From: jhugunin Date: Fri, 3 Jan 2003 19:17:41 +0000 (+0000) Subject: making inter-type decls work with incremental mode X-Git-Tag: V_1_1_b5~171 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ef5c2cbf024c8f221ec4f76b12fa16c478e8e5f2;p=aspectj.git making inter-type decls work with incremental mode (partially there) --- 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; }