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

ScopedValue doesn't state that an exception thrown by an op is delegated to the caller

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 21
    • core-libs

      For example the following call to method ::run

              ScopedValue.where(ScopedValue.newInstance(), 123)
                      .run(() -> {throw new RuntimeException("Thrown by the op");});

      would result in getting the exact instance of RuntimeException that the op throws.

      Same for other methods of j.l.ScopedValue/Carrier accepting an op

      This exception as-is delegation to the caller deserves to be explicitly mentioned in j.l.ScopedValue+Carrier specs

            alanb Alan Bateman
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: