summaryrefslogtreecommitdiff
path: root/plugins/typeMigration/testData/refactoring/typeMigrationByAtomic/reverseIntArray/before/Test.java
blob: df31528b9d7e50ceb1950038178ca75a350931fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import java.util.concurrent.atomic.AtomicIntegerArray;

class Test {
    AtomicIntegerArray a = new AtomicIntegerArray(new int[1]);


    void foo() {
        a.getAndIncrement(0);
        System.out.println(a.incrementAndGet(0));
        a.getAndDecrement(0);
        if (a.decrementAndGet(0) == 0) {
            a.getAndAdd(0, ((2)));
            a.set(0, a.get(0) * 2);
            if (a.get(0) == 0) {
                System.out.println(a.addAndGet(0, 7));
            }
        }
    }
}