--- /dev/null
+import java.util.*;
+
+public aspect CodeFour {
+
+ static final class FinalSet<T> extends HashSet<T> {}
+
+ before(): execution(* *(..)) && args(List<?>) {}
+
+ public void m(FinalSet<String> ss) {
+ // List<?> l = (List<?>)ss; // cannot write this (FinalSet is final) so pointcut should not match
+ }
+
+}
</ajc-test>
<ajc-test dir="java5/generics/pointcuts" title="args with generic wildcard">
- <compile files="ArgsListOfSomething.aj" options="-1.5">
+ <compile files="ArgsListOfSomething.aj" options="-1.5 -Xlint:ignore">
</compile>
<run class="ArgsListOfSomething">
<stdout>
<ajc-test dir="java5/generics/afterAdvice" title="after returning with generic wildcard">
<compile files="AfterReturningListOfSomething.aj" options="-1.5">
+ <!-- warning is unchecked match of List<?> from line 28 onto line 15. -->
+ <!-- some sets may be lists unless the set is final, so as a cast is allowed, the match is allowed -->
+ <message kind="warning" line="28"/>
</compile>
<run class="AfterReturningListOfSomething">
<stdout>
import org.aspectj.testing.XMLBasedAjcTestCase;
public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
-/*
+
public void testGenericPointcuts_1() {
runTest("generic pointcuts - 1");
}
public void testGenericPointcuts_3() {
runTest("generic pointcuts - 3");
}
-*/
+
+ public void testGenericPointcuts_4() {
+ runTest("generic pointcuts - 4");
+ }
+
// public void testBrokenLVT_pr194314_1() throws Exception {
// runTest("broken lvt - 1");
// JavaClass jc = Utils.getClassFrom(ajc.getSandboxDirectory().getAbsolutePath(), "Service");
<message kind="warning" line="9" text="unchecked"/>
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs163/pr253109" title="generic pointcuts - 4">
+ <compile files="CodeFour.java" options="-1.5">
+ <message kind="warning" text="has not been applied"/>
+ </compile>
+ </ajc-test>
<ajc-test dir="bugs163/pr194314" title="broken lvt - 1">
<compile files="Service.java IService.java Main.java ServiceInterceptor.java" options="-1.5"/>