aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/test4/CodeConv2.java
blob: 3a4ce036268a153e59438838fd1b12175fc1e772 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package test4;

public class CodeConv2 {
    int field = 3;
    static int sf = 1;

    public int run() {
        field = 7;
        sf = 8;
        switch (field) {
        case 0:
            field = 1;
            break;
        default:
        }
        int r = field * 10000 + sf;
        switch (field) {
        case 0:
            field = 1;
            break;
        default:
        }
        return r;
    }

    public static void write(Object target, int value) {
        if (target == null)
            sf = value * 2;
        else
            ((CodeConv2)target).field = value * 2;
    }

    public static int read(Object target) {
        if (target == null)
            return sf * 100;
        else
            return ((CodeConv2)target).field * 100;
    }
}