...
Code Block | ||
---|---|---|
| ||
class Unsafe { private volatile int[] arr = new int[20]; // other code... } arr[2] = 10; |
Compliant Solution
...
Code Block | ||
---|---|---|
| ||
class Safe { AtomicIntegerArray aia = new AtomicIntegerArray(5); // otherOther code } aia.set(1, 10); |
Risk Assessment
...