aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/FloatPrivilegedRoundoff.java
blob: 9859c167c3eca157f7695ffcd98102202887e472 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)++;
    }
}