org.aspectj/tests/new/FloatPrivilegedRoundoff.java

17 lines
388 B
Java
Raw Normal View History

2002-12-16 19:51:06 +01:00
import org.aspectj.testing.Tester;
public class FloatPrivilegedRoundoff {
private static float f = 0.3f;
public static void main(String[] args) {
Tester.check(A.foo() == 0.3f, "didn't return original");
Tester.check(f == 0.3f + 1, "didn't increment");
}
}
privileged aspect A {
static float foo() {
return (FloatPrivilegedRoundoff.f)++;
}
}