--- /dev/null
+class Test1<E> {
+ public void method1(E...args) {
+ }
+}
+
+public aspect ParameterizedVarArgMatch {
+
+ public static void main(String[] args) {
+ new Test1<String>().method1("a","b","c");
+ }
+
+
+ after(Test1 test1, Object[] arg) returning:
+ execution(* Test1.method1(Object...)) && target(test1) && args(arg) {
+ System.out.println("got here");
+ }
+}
\ No newline at end of file
--- /dev/null
+import java.lang.annotation.*;
+import org.aspectj.lang.annotation.*;
+
+@Aspect
+public class pr107953 {
+
+ @AfterThrowing(pointcut="execution(* Foo.*(..))",throwing="RuntimeException")
+ public void missingBindingOfThrowingFormal() {
+ System.out.println("failure");
+ }
+
+}
+
+class Foo {
+ void bar() {
+ throw new RuntimeException();
+ }
+}
\ No newline at end of file
@Aspect
public class Test019 {
@AfterReturning(value="call(* *..*(..))",returning="f")
- public void itsAFoo(Object f, int x) {
+ public void itsAFoo(int x, Object f) {
}
}
runTest("inner types and type variables");
}
+ public void testAtAfterThrowingWithNoFormal() {
+ runTest("@AfterThrowing with no formal specified");
+ }
+
+ public void testParameterizedVarArgsMatch() {
+ runTest("varargs with type variable");
+ }
+
// helper methods.....
public SyntheticRepository createRepos(File cpentry) {
</compile>
</ajc-test>
+ <ajc-test dir="bugs150" title="varargs with type variable">
+ <compile files="ParameterizedVarArgMatch.aj" options="-1.5">
+ </compile>
+ </ajc-test>
+
+
<ajc-test dir="bugs150" pr="108104" title="multiple anonymous inner classes 2">
<compile files="pr108104.aj" options="-1.5">
</compile>
<compile files="ShapeCommandMap.java" options="-1.5">
</compile>
</ajc-test>
-
+
+ <ajc-test dir="bugs150/" pr="107953" title="@AfterThrowing with no formal specified">
+ <compile files="pr107953.java" options="-1.5">
+ <message kind="error" line="8" text="throwing formal 'RuntimeException' must be declared as the last parameter in the advice signature"></message>
+ </compile>
+ </ajc-test>
+
<ajc-test dir="bugs150/pr106130" pr="106130" title="test weaving with > 256 locals">
<compile files="AroundLotsOfVars.java LotsOfVars.java" options="-preserveAllLocals"/>
<run class="LotsOfVars">
</ajc-test>
<comment>very dirty hack - can't get this location to work properly so added match all error..</comment>
+ <comment>amc - with new checks for binding of returning this was giving a different message, so I
+ tweaked the test slightly by swapping the order of the args</comment>
<ajc-test dir="java5/ataspectj"
pr="" title="@AfterReturning with wrong number of args">
<compile files="ataspectj/misuse/Test019.java" options="-1.5 -Xdev:NoAtAspectJProcessing -Xlint:ignore">
<message kind="error" line="1" text="the parameter x is not bound"/>
- <message kind="error"/>
+ <message kind="error" line="1" text="formal unbound in pointcut"/>
</compile>
</ajc-test>