aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2010-11-24 22:45:53 +0000
committeraclement <aclement>2010-11-24 22:45:53 +0000
commitfb6b9b16f800be2d534d7205a287fbf422f07df1 (patch)
tree248a0269003592b672bd0fe3a25d0c888d44a702 /org.aspectj.ajdt.core
parent1f657dbb00884ad4e0cbb4e1a1c8f1a837862196 (diff)
downloadaspectj-fb6b9b16f800be2d534d7205a287fbf422f07df1.tar.gz
aspectj-fb6b9b16f800be2d534d7205a287fbf422f07df1.zip
intertype inner types
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/IntertypeMemberClassDeclaration.java37
1 files changed, 36 insertions, 1 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/IntertypeMemberClassDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/IntertypeMemberClassDeclaration.java
index 8ee80bdc2..8cda7e0d0 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/IntertypeMemberClassDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/IntertypeMemberClassDeclaration.java
@@ -11,6 +11,7 @@
* ******************************************************************/
package org.aspectj.ajdt.internal.compiler.ast;
+import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Collections;
@@ -18,14 +19,18 @@ import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceLocation;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseTypeMunger;
import org.aspectj.ajdt.internal.compiler.lookup.InterTypeScope;
+import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ClassFile;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ASTNode;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.NestedTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
+import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.weaver.AjAttribute;
import org.aspectj.weaver.NewMemberClassTypeMunger;
import org.aspectj.weaver.ResolvedType;
@@ -62,7 +67,28 @@ public class IntertypeMemberClassDeclaration extends TypeDeclaration {
ensureScopeSetup();
super.resolve(aspectScope);
}
-
+ /**
+ * Bytecode generation for a member inner type
+ */
+ /*
+ public void generateCode(ClassScope classScope, ClassFile enclosingClassFile) {
+ if ((this.bits & ASTNode.HasBeenGenerated) != 0) {
+ return;
+ }
+ try {
+ Field f = ReferenceBinding.class.getDeclaredField("constantPoolName");
+ char[] name = CharOperation.concat(onTypeResolvedBinding.constantPoolName(), binding.sourceName, '$');
+ f.setAccessible(true);
+ f.set(this.binding, name);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ if (this.binding != null) {
+ ((NestedTypeBinding) this.binding).computeSyntheticArgumentSlotSizes();
+ }
+ generateCode(enclosingClassFile);
+ }
+*/
@Override
public void resolve() {
super.resolve();
@@ -207,6 +233,11 @@ public class IntertypeMemberClassDeclaration extends TypeDeclaration {
if (!onTypeResolvedBinding.isValidBinding()) {
cuScope.problemReporter().invalidType(onType, onTypeResolvedBinding);
ignoreFurtherInvestigation = true;
+ } else {
+ // fix up the ITD'd type?
+ ((NestedTypeBinding) this.binding).enclosingType = (SourceTypeBinding) onTypeResolvedBinding;
+ // this done at build type for the nested type now:
+ // ((NestedTypeBinding) this.binding).compoundName = CharOperation.splitOn('.', "Basic$_".toCharArray());
}
}
@@ -250,4 +281,8 @@ public class IntertypeMemberClassDeclaration extends TypeDeclaration {
ResolvedType aspectType = world.fromEclipse(classScope.referenceContext.binding);
return new EclipseTypeMunger(world, newMemberClassTypeMunger, aspectType, null);
}
+
+ public char[] alternativeName() {
+ return onType.getLastToken();
+ }
}