diff options
author | aclement <aclement> | 2010-07-14 21:06:33 +0000 |
---|---|---|
committer | aclement <aclement> | 2010-07-14 21:06:33 +0000 |
commit | c718506cc647c311d3956c2408402a09a627509c (patch) | |
tree | dac8889e8c2108250c09dc31412df0f303ddfb70 /org.aspectj.ajdt.core | |
parent | 401f693bf9fbdd504c081d6e1f93b3ecf8fa79a8 (diff) | |
download | aspectj-c718506cc647c311d3956c2408402a09a627509c.tar.gz aspectj-c718506cc647c311d3956c2408402a09a627509c.zip |
possible changes for intertype inner types
Diffstat (limited to 'org.aspectj.ajdt.core')
2 files changed, 32 insertions, 19 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 cd8c0175d..7a1410405 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 @@ -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); } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java index 0bcac22d2..5ba0229dc 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/IntertypeMemberTypeFinder.java @@ -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) { |