Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8361497

Scoped Values: orElse and orElseThrow do not access the cache

XMLWordPrintable

    • b08
    • generic
    • generic

        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.

              aph Andrew Haley
              aph Andrew Haley
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: