diff options
author | aclement <aclement> | 2010-06-11 19:10:54 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-06-11 19:10:54 +0000 |
commit | 263a678094115922af081cad32aa059fd62cb8d1 (patch) | |
tree | edc8ca02b877bb5f9c08bdb042d0ea8f5c31fbdc | |
parent | 81019060126ce96cc33509b49e7fc0115e7e8f43 (diff) | |
download | aspectj-263a678094115922af081cad32aa059fd62cb8d1.tar.gz aspectj-263a678094115922af081cad32aa059fd62cb8d1.zip |
itd inners
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseTypeMunger.java | 31 |
1 files changed, 20 insertions, 11 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 e2bab6b73..55bfe470f 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 @@ -14,16 +14,18 @@ package org.aspectj.ajdt.internal.compiler.lookup; import java.lang.reflect.Modifier; import java.util.Map; -import org.aspectj.asm.internal.CharOperation; import org.aspectj.bridge.ISourceLocation; +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.FieldBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding; +import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding; import org.aspectj.weaver.ConcreteTypeMunger; import org.aspectj.weaver.NewConstructorTypeMunger; import org.aspectj.weaver.NewFieldTypeMunger; @@ -165,22 +167,29 @@ public class EclipseTypeMunger extends ConcreteTypeMunger { private boolean mungeNewInnerClass(SourceTypeBinding sourceType, ResolvedType onType, NewMemberClassTypeMunger munger, boolean isExactTargetType) { - ReferenceBinding binding = new InterTypeMemberClassBinding(world, munger, aspectType, onType, munger.getMemberTypeName(), - sourceType); - SourceTypeBinding stb = (SourceTypeBinding) world.makeTypeBinding(aspectType); - // ReferenceBinding found = null; - for (int i = 0; i < stb.memberTypes.length; i++) { - ReferenceBinding rb = stb.memberTypes[i]; - char[] sn = rb.sourceName; - if (CharOperation.equals(munger.getMemberTypeName().toCharArray(), sn)) { - binding = rb; + SourceTypeBinding aspectTypeBinding = (SourceTypeBinding) world.makeTypeBinding(aspectType); + + char[] mungerMemberTypeName = ("$" + munger.getMemberTypeName()).toCharArray(); + ReferenceBinding innerTypeBinding = null; + for (ReferenceBinding innerType : aspectTypeBinding.memberTypes) { + char[] compounded = CharOperation.concatWith(innerType.compoundName, '.'); + if (org.aspectj.org.eclipse.jdt.core.compiler.CharOperation.endsWith(compounded, mungerMemberTypeName)) { + innerTypeBinding = innerType; + break; } } + // may be unresolved if the aspect type binding was a BinaryTypeBinding + if (innerTypeBinding instanceof UnresolvedReferenceBinding) { + innerTypeBinding = BinaryTypeBinding.resolveType(innerTypeBinding, world.getLookupEnvironment(), true); + } + // rb = new InterTypeMemberClassBinding(world, munger, aspectType, aspectTypeBinding, onType, munger.getMemberTypeName(), + // sourceType); + // TODO adjust modifier? // TODO deal with itd of it onto an interface - findOrCreateInterTypeMemberClassFinder(sourceType).addInterTypeMemberType(binding); + findOrCreateInterTypeMemberClassFinder(sourceType).addInterTypeMemberType(innerTypeBinding); return true; } |