import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.aspectj.ajde.core.ICompilerConfiguration;
import org.aspectj.asm.IProgramElement;
import org.aspectj.asm.IRelationship;
import org.aspectj.asm.IRelationshipMap;
+import org.aspectj.asm.internal.ProgramElement;
import org.aspectj.asm.internal.Relationship;
import org.aspectj.bridge.IMessage;
import org.aspectj.tools.ajc.Ajc;
checkCompileWeaveCount("Annos", 3, 3);
}
+
+ // package a.b.c;
+ //
+ // public class A {
+ // }
+ //
+ // aspect X {
+ // B A.foo(C c) { return null; }
+ // declare parents: A implements java.io.Serializable;
+ // }
+ //
+ // class B {}
+ // class C {}
+ public void testITDFQNames_pr252702() {
+ String p = "itdfq";
+ AjdeInteractionTestbed.VERBOSE = true;
+ initialiseProject(p);
+ build(p);
+ AsmManager model = getModelFor(p);
+ dumptree(model.getHierarchy().getRoot(), 0);
+ IProgramElement root = model.getHierarchy().getRoot();
+ ProgramElement theITD = (ProgramElement) findElementAtLine(root, 7);
+ Map m = theITD.kvpairs;
+ for (Iterator iterator = m.keySet().iterator(); iterator.hasNext();) {
+ String type = (String) iterator.next();
+ System.out.println(type + " = " + m.get(type));
+ }
+ // return type of the ITD
+ assertEquals("a.b.c.B", theITD.getCorrespondingType(true));
+ List ptypes = theITD.getParameterTypes();
+ for (Iterator iterator = ptypes.iterator(); iterator.hasNext();) {
+ char[] object = (char[]) iterator.next();
+ System.out.println("p = " + new String(object));
+ }
+ ProgramElement decp = (ProgramElement) findElementAtLine(root, 8);
+ m = decp.kvpairs;
+ for (Iterator iterator = m.keySet().iterator(); iterator.hasNext();) {
+ String type = (String) iterator.next();
+ System.out.println(type + " = " + m.get(type));
+ }
+ List l = decp.getParentTypes();
+ assertEquals("java.io.Serializable", (String) l.get(0));
+ ProgramElement ctorDecp = (ProgramElement) findElementAtLine(root, 16);
+ String ctordecphandle = ctorDecp.getHandleIdentifier();
+ assertEquals("=itdfq<a.b.c{A.java}XX)B.B_new)QString;", ctordecphandle); // 252702, comment 7
+ }
+
+ public void testItdProgramElement_pr252702() {
+ String p = "itdpe";
+ AjdeInteractionTestbed.VERBOSE = true;
+ initialiseProject(p);
+ build(p);
+ AsmManager model = getModelFor(p);
+ dumptree(model.getHierarchy().getRoot(), 0);
+ IProgramElement root = model.getHierarchy().getRoot();
+ ProgramElement theITD = (ProgramElement) findElementAtLine(root, 7);
+ Map m = theITD.kvpairs;
+ for (Iterator iterator = m.keySet().iterator(); iterator.hasNext();) {
+ String type = (String) iterator.next();
+ System.out.println(type + " = " + m.get(type));
+ }
+ // return type of the ITD
+ assertEquals("a.b.c.B", theITD.getCorrespondingType(true));
+ List ptypes = theITD.getParameterTypes();
+ for (Iterator iterator = ptypes.iterator(); iterator.hasNext();) {
+ char[] object = (char[]) iterator.next();
+ System.out.println("p = " + new String(object));
+ }
+ ProgramElement decp = (ProgramElement) findElementAtLine(root, 8);
+ m = decp.kvpairs;
+ for (Iterator iterator = m.keySet().iterator(); iterator.hasNext();) {
+ String type = (String) iterator.next();
+ System.out.println(type + " = " + m.get(type));
+ }
+ List l = decp.getParentTypes();
+ assertEquals("java.io.Serializable", (String) l.get(0));
+
+ //
+ }
+
public void testBrokenHandles_pr247742() {
String p = "BrokenHandles";
initialiseProject(p);