mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-21 05:51:25 +07:00
Java: Take into account writes to the field done via AtomicFieldUpdater (IDEA-152262)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
||||
|
||||
class Atomics {
|
||||
private volatile int <warning descr="Private field 'num' is never assigned">num</warning>;
|
||||
private static final AtomicIntegerFieldUpdater<Atomics> updater =
|
||||
AtomicIntegerFieldUpdater.newUpdater(Atomics.class, "num");
|
||||
|
||||
public int getInt() {
|
||||
return updater.get(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user