]> source.dussan.org Git - aspectj.git/commitdiff
possible changes for intertype inner types
authoraclement <aclement>
Wed, 14 Jul 2010 21:06:33 +0000 (21:06 +0000)
committeraclement <aclement>
Wed, 14 Jul 2010 21:06:33 +0000 (21:06 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java

index cd8c0175d8b4f20bf5b51245c3428dc091dd00bd..7a1410405e64c1238d9dd44e1c50723250575a7f 100644 (file)
@@ -708,16 +708,18 @@ public class AspectDeclaration extends TypeDeclaration {
                /*
                 * Code: Stack=1, Locals=1, Args_size=1 0: aload_0 1: getfield #14; //Field ajc$withinType:Ljava/lang/String; 4: areturn
                 */
-               generateMethod(classFile, AjcMemberMaker.perTypeWithinGetWithinTypeNameMethod(world.fromBinding(binding), world.getWorld()
-                               .isInJava5Mode()), new BodyGenerator() {
-                       public void generate(CodeStream codeStream) {
-                               ExceptionLabel exc = new ExceptionLabel(codeStream, world.makeTypeBinding(UnresolvedType.JAVA_LANG_EXCEPTION));
-                               exc.placeStart();
-                               codeStream.aload_0();
-                               codeStream.getfield(world.makeFieldBinding(AjcMemberMaker.perTypeWithinWithinTypeField(typeX, typeX)));
-                               codeStream.areturn();
-                       }
-               });
+               generateMethod(classFile,
+                               AjcMemberMaker.perTypeWithinGetWithinTypeNameMethod(world.fromBinding(binding), world.getWorld().isInJava5Mode()),
+                               new BodyGenerator() {
+                                       public void generate(CodeStream codeStream) {
+                                               ExceptionLabel exc = new ExceptionLabel(codeStream, world
+                                                               .makeTypeBinding(UnresolvedType.JAVA_LANG_EXCEPTION));
+                                               exc.placeStart();
+                                               codeStream.aload_0();
+                                               codeStream.getfield(world.makeFieldBinding(AjcMemberMaker.perTypeWithinWithinTypeField(typeX, typeX)));
+                                               codeStream.areturn();
+                                       }
+                               });
        }
 
        // PTWIMPL Generate getInstance method
@@ -739,12 +741,10 @@ public class AspectDeclaration extends TypeDeclaration {
                                codeStream.aload_1();
                                codeStream.aconst_null();
                                codeStream.aconst_null();
-                               codeStream
-                                               .invokevirtual(new MethodBinding(0, "invoke".toCharArray(), world.makeTypeBinding(UnresolvedType.OBJECT),
-                                                               new TypeBinding[] { world.makeTypeBinding(UnresolvedType.OBJECT),
-                                                                               world.makeTypeBinding(UnresolvedType.forSignature("[Ljava/lang/Object;")) },
-                                                               new ReferenceBinding[0], (ReferenceBinding) world
-                                                                               .makeTypeBinding(UnresolvedType.JAVA_LANG_REFLECT_METHOD)));
+                               codeStream.invokevirtual(new MethodBinding(0, "invoke".toCharArray(), world.makeTypeBinding(UnresolvedType.OBJECT),
+                                               new TypeBinding[] { world.makeTypeBinding(UnresolvedType.OBJECT),
+                                                               world.makeTypeBinding(UnresolvedType.forSignature("[Ljava/lang/Object;")) },
+                                               new ReferenceBinding[0], (ReferenceBinding) world.makeTypeBinding(UnresolvedType.JAVA_LANG_REFLECT_METHOD)));
                                codeStream.checkcast(world.makeTypeBinding(typeX));
                                codeStream.astore_2();
                                codeStream.aload_2();
@@ -792,7 +792,7 @@ public class AspectDeclaration extends TypeDeclaration {
                                // codeStream.ifnull(isNull);
                                // codeStream.areturn();
                                // isNull.place();
-                               //                              
+                               //
                                // codeStream.incrStackSize(+1); // the dup trick above confuses the stack counter
                                // codeStream.new_(world.makeTypeBinding(AjcMemberMaker.NO_ASPECT_BOUND_EXCEPTION));
                                // codeStream.dup();
@@ -1086,7 +1086,7 @@ public class AspectDeclaration extends TypeDeclaration {
        // public String toStringBody(int tab) {
        //
        //              String s = " {"; //$NON-NLS-1$
-       //              
+       //
        //
        // if (memberTypes != null) {
        // for (int i = 0; i < memberTypes.length; i++) {
@@ -1155,7 +1155,14 @@ public class AspectDeclaration extends TypeDeclaration {
                                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;
+               */
                findOrCreateInterTypeMemberClassFinder(targetSourceTypeBinding).addInterTypeMemberType(innerTypeBinding);
        }
 
index 0bcac22d2f4087c85d93b1caa49624a2adee7936..5ba0229dc7aa2d289cef6ea5f6f802d40b7605e2 100644 (file)
@@ -36,6 +36,12 @@ public class IntertypeMemberTypeFinder implements ITypeFinder {
 
        public void addInterTypeMemberType(ReferenceBinding binding) {
                intertypeMemberTypes.add(binding);
+               // ReferenceBinding[] rbs = targetTypeBinding.memberTypes();
+               // ReferenceBinding[] newRbs = new ReferenceBinding[rbs.length + 1];
+               // System.arraycopy(rbs, 0, newRbs, 1, rbs.length);
+               // newRbs[0] = binding;
+               // (targetTypeBinding).memberTypes = newRbs;
+
        }
 
        public ReferenceBinding getMemberType(char[] memberTypeName) {