Scoped values cannot be used early in the JDK boot process because of some dependencies on System.getProperty(). This repen dency should be removed in a way that allows scoped values to be created (but not necessarily bound) at any stage during boot.
Also, Scoped Value's constructor has a synchronized block, which limits the use of scoped values at runtime. Constructing a scoped value should be a thread-local operation. ------------- Commit messages: - 8360884: Better scoped values - 8360884: Better scoped values - 8360884: Better scoped values Changes: https://git.openjdk.org/jdk/pull/26019/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26019&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8360884 Stats: 97 lines in 3 files changed: 55 ins; 5 del; 37 mod Patch: https://git.openjdk.org/jdk/pull/26019.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26019/head:pull/26019 PR: https://git.openjdk.org/jdk/pull/26019