From eccb4e5b719b387d853e9f42442a0519f2cfa434 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 6 Dec 2010 17:42:06 +0000 Subject: [PATCH] it itds --- .../compiler/ast/AspectDeclaration.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 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 0cae2ec1c..105c6830c 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 @@ -712,8 +712,7 @@ public class AspectDeclaration extends TypeDeclaration { AjcMemberMaker.perTypeWithinGetWithinTypeNameMethod(world.fromBinding(binding), world.getWorld().isInJava5Mode()), new BodyGenerator() { public void generate(CodeStream codeStream) { - ExceptionLabel exc = new ExceptionLabel(codeStream, world - .makeTypeBinding(UnresolvedType.JL_EXCEPTION)); + ExceptionLabel exc = new ExceptionLabel(codeStream, world.makeTypeBinding(UnresolvedType.JL_EXCEPTION)); exc.placeStart(); codeStream.aload_0(); codeStream.getfield(world.makeFieldBinding(AjcMemberMaker.perTypeWithinWithinTypeField(typeX, typeX))); @@ -1146,23 +1145,26 @@ public class AspectDeclaration extends TypeDeclaration { // TODO deal with itd of it onto an interface SourceTypeBinding targetSourceTypeBinding = (SourceTypeBinding) world.makeTypeBinding(munger.getTargetType()); - ReferenceBinding[] existingMemberTypes = targetSourceTypeBinding.memberTypes(); - for (int i = 0; i < existingMemberTypes.length; i++) { - char[] compounded = CharOperation.concatWith(existingMemberTypes[i].compoundName, '.'); - if (CharOperation.endsWith(compounded, mungerMemberTypeName)) { - scope.problemReporter().signalError(sourceStart(), sourceEnd(), - "target type already declares a member type with the name '" + munger.getMemberTypeName() + "'"); - return; + + // if it is a binary type binding it is likely to be something we ITD'd on before + // TODO should probably avoid putting it onto BTBs at all (since already there) + if (!(targetSourceTypeBinding instanceof BinaryTypeBinding)) { + ReferenceBinding[] existingMemberTypes = targetSourceTypeBinding.memberTypes(); + for (int i = 0; i < existingMemberTypes.length; i++) { + char[] compounded = CharOperation.concatWith(existingMemberTypes[i].compoundName, '.'); + if (CharOperation.endsWith(compounded, mungerMemberTypeName)) { + scope.problemReporter().signalError(sourceStart(), sourceEnd(), + "target type already declares a member type with the name '" + munger.getMemberTypeName() + "'"); + return; + } } } /* - char[][] className = CharOperation.deepCopy(targetSourceTypeBinding.compoundName); - className[className.length - 1] = CharOperation.concat(className[className.length - 1], munger.getMemberTypeName() - .toCharArray(), '$'); - // ReferenceBinding existingType = packageBinding.getType0(className[className.length - 1]); - innerTypeBinding.compoundName = className; - innerTypeBinding.fPackage = targetSourceTypeBinding.fPackage; - */ + * char[][] className = CharOperation.deepCopy(targetSourceTypeBinding.compoundName); className[className.length - 1] = + * CharOperation.concat(className[className.length - 1], munger.getMemberTypeName() .toCharArray(), '$'); // + * ReferenceBinding existingType = packageBinding.getType0(className[className.length - 1]); innerTypeBinding.compoundName = + * className; innerTypeBinding.fPackage = targetSourceTypeBinding.fPackage; + */ findOrCreateInterTypeMemberClassFinder(targetSourceTypeBinding).addInterTypeMemberType(innerTypeBinding); } -- 2.39.5