Neither `ScopedValue.orElse` nor `ScopedValue.orElseThrow` consult the cache when searching for a binding. Neither do they update the cache when a binding is found. While this issue does not affect spec compliance, it is surprising to users that `x.orElse(other)` should be slower than `x.isBound ? x.get() : other`.
------------- Commit messages: - 8361497: Scoped Values: orElse and orElseThrow do not access the cache - Merge branch 'master' into JDK-8361497 - 8361497: Scoped Values: orElse and orElseThrow do not access the cache Changes: https://git.openjdk.org/jdk/pull/26164/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26164&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8361497 Stats: 100 lines in 2 files changed: 85 ins; 0 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/26164.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/26164/head:pull/26164 PR: https://git.openjdk.org/jdk/pull/26164