mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java convert to atomic intention: assignment conversion fix IDEA-161639
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user