--- /dev/null
+public aspect RawTypeMatching {
+
+ // tests that references to a generic or parameterized type are
+ // always matched by a type pattern refering to the raw type form
+
+ void someCode() {
+ ConcreteImplementingClass cic = new ConcreteImplementingClass();
+ cic.asInt(5.0d);
+ GenericImplementingClass<Long> gic = new GenericImplementingClass<Long>();
+ gic.asInt(55L);
+ }
+
+ declare warning :
+ execution(* GenericInterface.*(..)) :
+ "execution(* GenericInterface.*(..))";
+
+}
\ No newline at end of file
<compile files="PR94086.aj" options="-1.5"/>
</ajc-test>
- // generic bugs
+ <!-- generic bugs -->
<ajc-test dir="java5/generics/bugs" title="ITD method with generic arg">
<compile files="PR97763.aj" options="-1.5"/>
<run class="pr100260"/>
</ajc-test>
- // end of generic bugs
+ <!-- end of generic bugs -->
- // generic aspects
+ <!-- generic aspects -->
<ajc-test dir="java5/generics/genericaspects" title="generic aspects - 1">
<compile files="GenericAspect1.aj" options="-1.5"/>
</run>
</ajc-test>
- // end of generic aspects
-
- // generic ITDs
+ <!-- end of generic aspects -->
+ <!-- generic ITDs -->
+
<ajc-test dir="java5/generics/itds" title="ITDs on generic type">
<compile files="Parse5.java" options="-1.5">
<message kind="error" line="9"/>
<compile files="Parse4.java" options="-1.5"/>
</ajc-test>
- // end of generic ITDs
+ <!-- end of generic ITDs -->
- // generic decps
+ <!-- generic decps -->
<ajc-test dir="java5/generics/decp" title="generic decp - simple">
<compile files="Basic.aj" options="-1.5"/>
<message kind="error" line="11" text="Cannot declare parent I<java.lang.Integer> onto type Basic2 since it already has I<java.lang.String> in its hierarchy"/>
</compile>
</ajc-test>
-
+
<ajc-test dir="java5/generics/decp" title="generic decp - implementing two variants #2">
<compile files="Basic2b.aj" options="-1.5">
<message kind="error" line="10" text="Cannot declare parent I<java.lang.Integer> onto type Basic2b since it already has I in its hierarchy"/>
<!-- -->
- <ajc-test dir="java5/generics/decp" title="generic decp - incorrect number of type parameters">
+ <ajc-test dir="java5/generics/decp" title="generic decp - incorrect number of type parameters">
<compile files="Basic3.aj" options="-1.5"/>
<run class="Basic3"/>
</ajc-test>
<!--ajc-test dir="java5/generics/decp" title="illegal generic decp">
<compile files="Basic2.aj" options="-1.5"/>
</ajc-test-->
+
+ <!-- end of generic decps -->
+
+ <!-- generics and pointcuts -->
+
+ <ajc-test dir="java5/generics/pointcuts" title="execution pcd with raw type matching">
+ <compile files="GenericInterface.java,ConcreteImplementingClass.java,GenericImplementingClass.java,RawTypeMatching.aj" options="-1.5">
+ <message kind="warning" line="4" text="execution(* GenericInterface.*(..))"/>
+ <message kind="warning" line="5" text="execution(* GenericInterface.*(..))"/>
+ </compile>
+ </ajc-test>
+
+ <!-- end of generics and pointcuts tests -->
- // end of generic decps
<!-- ============================================================== -->
<!-- End of generics tests -->
<!-- ============================================================== -->