Index: src/org/aspectj/systemtest/ajc151/Ajc151Tests.java
===================================================================
RCS file: /home/technology/org.aspectj/modules/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java,v
retrieving revision 1.30
diff -u -r1.30 Ajc151Tests.java
--- src/org/aspectj/systemtest/ajc151/Ajc151Tests.java 16 Mar 2006 11:01:55 -0000 1.30
+++ src/org/aspectj/systemtest/ajc151/Ajc151Tests.java 16 Mar 2006 11:39:01 -0000
@@ -112,6 +112,42 @@
runTest("no ClassCastException with generic aspect and unknown type");
}
+ public void testStructureModelForGenericITD_pr131932() {
+ //AsmManager.setReporting("c:/debug.txt",true,true,true,true);
+ runTest("structure model for generic itd");
+ IHierarchy top = AsmManager.getDefault().getHierarchy();
+
+ // get the IProgramElements corresponding to the ITD method statement
+ // and the class it matches.
+ IProgramElement itd = top.findElementForLabel(top.getRoot(),
+ IProgramElement.Kind.INTER_TYPE_METHOD,"Bar.getFirst()");
+ assertNotNull("Couldn't find 'Bar.getFirst()' element in the tree",itd);
+ IProgramElement bar = top.findElementForLabel(top.getRoot(),
+ IProgramElement.Kind.CLASS,"Bar");
+ assertNotNull("Couldn't find Bar element in the tree",bar);
+
+ // check that the relationship map has 'itd declared on bar'
+ List matches = AsmManager.getDefault().getRelationshipMap().get(itd);
+ assertNotNull("itd Bar.getFirst() should have some relationships but does not",matches);
+ assertTrue("itd should have one relationship but has " + matches.size(), matches.size() == 1);
+ List matchesTargets = ((Relationship)matches.get(0)).getTargets();
+ assertTrue("itd Bar.getFirst() should have one target but has " + matches.size(),matchesTargets.size() == 1);
+ IProgramElement target = AsmManager.getDefault().getHierarchy().findElementForHandle((String)matchesTargets.get(0));
+ assertEquals("target of relationship should be the Bar class but is IPE with label "
+ + target.toLabelString(),bar,target);
+
+ // check that the relationship map has 'bar aspect declarations itd'
+ matches = AsmManager.getDefault().getRelationshipMap().get(bar);
+ assertNotNull("Bar should have some relationships but does not",matches);
+ assertTrue("Bar should have one relationship but has " + matches.size(), matches.size() == 1);
+ matchesTargets = ((Relationship)matches.get(0)).getTargets();
+ assertTrue("Bar should have one target but has " + matches.size(),matchesTargets.size() == 1);
+ target = AsmManager.getDefault().getHierarchy().findElementForHandle((String)matchesTargets.get(0));
+ assertEquals("target of relationship should be the itd Bar.getFirst() but is IPE with label "
+ + target.toLabelString(),itd,target);
+
+ }
+
/*
* @AspectJ bugs and enhancements
*/
Index: src/org/aspectj/systemtest/ajc151/ajc151.xml
===================================================================
RCS file: /home/technology/org.aspectj/modules/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml,v
retrieving revision 1.28
diff -u -r1.28 ajc151.xml
--- src/org/aspectj/systemtest/ajc151/ajc151.xml 16 Mar 2006 11:01:55 -0000 1.28
+++ src/org/aspectj/systemtest/ajc151/ajc151.xml 16 Mar 2006 11:39:02 -0000
@@ -252,6 +252,9 @@
+
+
+
Index: bugs151/pr131932.aj
===================================================================
RCS file: bugs151/pr131932.aj
diff -N bugs151/pr131932.aj
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ bugs151/pr131932.aj 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,12 @@
+import java.util.List;
+
+aspect Slide74 {
+
+ public X Bar.getFirst() {
+ return lts.get(0);
+ }
+
+ static class Bar {
+ List lts;
+ }
+}