RFR 8160439: Replace asserts in VarHandle.AccessMode with tests
Paul Sandoz
paul.sandoz at oracle.com
Tue Jun 28 10:50:46 UTC 2016
Hi,
Please review:
http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8160439-vh-access-mode-remove-assert/webrev/ <http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8160439-vh-access-mode-remove-assert/webrev/>
This removes an assert that can load dependent locale-based classes too early in the startup process when say AtomicInteger is modified to use VarHandle (in a 166 webrev Martin has prepared). This appears to kibosh locale-behaviour which was thankfully caught in a test (java/util/Locale/Bug4152725.java).
The removed assert has been replaced with a test.
—
Separately there might be a more principled way to ensure VarHandle and dependent classes are loaded/initialized at a well defined point. Although in this case it would not have helped, it would help define a clearer barrier before which a VarHandle cannot be used.
Paul.
More information about the core-libs-dev
mailing list