...
This does not prevent either thread from observing an inconsistent value of counter
because the increment operation on volatile fields is not atomic in the absence of proper synchronization (see CON01CON02-J. Ensure that compound operations on shared variables are atomic).
...