org.aspectj/tests/new/AroundNumericCastCE.java
2002-12-16 18:51:06 +00:00

27 lines
732 B
Java

import org.aspectj.testing.Tester;
/** @testcase PR#838 checking around join point for advice return type - numeric */
public class AroundNumericCastCE {
public static double doubleMethod(int total){
return (double) total;
}
public static int intMethod(int total){
return total;
}
public static aspect Selector{
// expect CE "illegal return value" from execution(int intMethod(int))
double around(int i) : execution(* *Method(int)) && args(i) { // CE 17
return proceed(i);
}
}
public static void main(String[] args){
double result = doubleMethod(1000);
Tester.check(result != 0, "calculatePayment(1000)");
}
}