]> source.dussan.org Git - aspectj.git/commitdiff
it itds
authoraclement <aclement>
Mon, 6 Dec 2010 17:42:06 +0000 (17:42 +0000)
committeraclement <aclement>
Mon, 6 Dec 2010 17:42:06 +0000 (17:42 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java

index 0cae2ec1c4fe8358c0f46c8a7967f31eb5e83b17..105c6830cede44850bb8e0f9467122b7e326c0c7 100644 (file)
@@ -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);
        }