java convert to atomic intention: assignment conversion fix IDEA-161639

This commit is contained in:
Dmitry Batkovich
2016-09-23 15:22:26 +03:00
parent b1ff2b019e
commit 23731ae9ad
4 changed files with 85 additions and 14 deletions
@@ -0,0 +1,18 @@
import java.util.concurrent.atomic.AtomicLong;
// "Convert to atomic" "true"
class A {
final AtomicLong x = new AtomicLong(0);
public void testAtomicLong() {
x.getAndIncrement();
x.getAndDecrement();
x.addAndGet(2);
x.addAndGet(-2);
x.updateAndGet(v -> v * 3);
x.updateAndGet(v -> v / 3);
x.updateAndGet(v -> v % 3);
x.updateAndGet(v -> v & 3);
x.updateAndGet(v -> v | 3);
}
}
@@ -0,0 +1,16 @@
// "Convert to atomic" "true"
class A {
long <caret>x = 0;
public void testAtomicLong() {
x++;
x--;
x+=2;
x-=2;
x*=3;
x/=3;
x%=3;
x&=3;
x|=3;
}
}