mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-14 02:10:40 +02:00
17 lines
388 B
Java
17 lines
388 B
Java
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)++;
|
|
}
|
|
}
|