Runnable jcstress + JUnit companion for the ankurm.com post on the Java Memory Model, double-checked locking, and the volatile fix.
20 lines
915 B
Plaintext
20 lines
915 B
Plaintext
$ javac -cp jcstress-core.jar -d out -s gen PlainPublicationTest.java Payload.java # JDK 21.0.10, no -processorpath
|
|
|
|
Note: Annotation processing is enabled because one or more processors were found
|
|
on the class path. A future release of javac may disable annotation processing
|
|
unless at least one processor is specified by name (-processor), or a search
|
|
path is specified (--processor-path, --processor-module-path), or annotation
|
|
processing is enabled explicitly (-proc:only, -proc:full).
|
|
Use -Xlint:-options to suppress this message.
|
|
Use -proc:none to disable annotation processing.
|
|
|
|
$ find gen -type f
|
|
gen/com/ankurm/jmm/PlainPublicationTest_jcstress.java
|
|
|
|
$ javac -cp jcstress-core.jar -d out -s gen PlainPublicationTest.java Payload.java # JDK 25.0.4.1+1, no -processorpath
|
|
|
|
(no output at all - exit code 0)
|
|
|
|
$ find gen -type f
|
|
(nothing - the processor was never invoked, no error, no warning)
|