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

Scoped Values: orElse and orElseThrow do not access the cache

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 26
    • core-libs
    • None
    • 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:
            2 Start watching this issue

              Created:
              Updated: