--- /dev/null
+public class DemoUsage {\r
+ public static void main(String[] args) {\r
+ StringClass sc = new StringClass();\r
+ sc.getStrings().add("AspectJ");\r
+ for(String s : sc.getStrings()) {\r
+ System.out.println(s);\r
+ }\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+import java.util.*;\r
+\r
+public aspect StringAspect {\r
+ public Collection<String> StringClass.getStrings() {\r
+ return new ArrayList<String>();\r
+ }\r
+}\r
--- /dev/null
+public class StringClass {}
\ No newline at end of file
--- /dev/null
+
+public class HasMethodSemantics {
+ public static void main(String []argv) {
+ System.out.println("Implements Marker? "+(new HasMethodSemantics() instanceof Marker?"yes":"no"));
+ }
+}
+
+interface Marker {}
+
+aspect X {
+ declare parents: HasMethodSemantics && hasmethod(String toString(..)) implements Marker;
+}
\ No newline at end of file
*/
public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+// public void testHasMethodSemantics() { runTest("hasmethod semantics"); }
public void testBoundsCheckShouldFail_pr219298() { runTest("bounds check failure");}
public void testBoundsCheckShouldFail_pr219298_2() { runTest("bounds check failure - 2");}
public void testGenericMethodMatching_pr204505_1() { runTest("generics method matching - 1");}
public void testDecpRepetition_pr214559_3() { runTest("decp repetition problem - 3");} // across multiple files
public void testISEAnnotations_pr209831() { runTest("illegal state exception with annotations");}
public void testISEAnnotations_pr209831_2() { runTest("illegal state exception with annotations - 2");}
-
- /////////////////////////////////////////
+// public void testITDLostGenerics_pr211146() { runTest("itd lost generic signature");}
+// public void testITDLostGenerics_pr211146_2() { runTest("itd lost generic signature - field");}
+
+ /////////////////////////////////////////
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Ajc160Tests.class);
}
<!-- AspectJ v1.6.0 Tests -->
<suite>
+ <ajc-test dir="bugs160/various" title="hasmethod semantics">
+ <compile options="-1.5 -XhasMember -Xlint:ignore" files="HasMethodSemantics.java"/>
+ <run class="HasMethodSemantics">
+ <stdout>
+ <line text="Implements Marker? no"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
<ajc-test dir="bugs160/pr204505" title="generics method matching - 1">
<compile options="-1.5 -showWeaveInfo" files="Bug.java">
<message kind="weave" text="execution(void C.save(java.lang.Object))"/>
<run class="Test2"/>
</ajc-test>
+ <ajc-test dir="bugs160/pr211146" title="itd lost generic signature">
+ <compile options=" -1.5" files="StringAspect.aj,StringClass.java" outjar="foo.jar"/>
+ <compile options=" -1.5" files="DemoUsage.java" classpath="foo.jar"/>
+ </ajc-test>
+
</suite>
\ No newline at end of file