If variable of type int (integer) is inherently atomic in Java as per Effective Java's excerpt below, then why do we see inconsistent state of integer value in example: https://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html
The language specification guarantees that reading or writing a variable is atomic unless the variable is of type long or double [JLS, 17.4.7]. In other words, reading a variable other than a long or double is guaranteed to return a value that was stored into that variable by some thread, even if multiple threads modify the variable concurrently and without synchronization.
Above items are contradicting to me.