Created
October 7, 2021 03:16
-
-
Save Maccimo/cc8e2ab121eaeca9a8e891c46a143939 to your computer and use it in GitHub Desktop.
JDK-8273914 bug demo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sample from https://habr.com/ru/post/581576/ article. | |
*/ | |
import java.util.concurrent.atomic.AtomicInteger; | |
public class Disturbed { | |
public static void main(String... args) { | |
AtomicInteger counter = new AtomicInteger(1); | |
System.out.println( | |
"First two positive numbers: " + | |
counter + | |
", " + | |
counter.incrementAndGet() | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment