Module java.base
Package java.lang

# Class ScopedValue.Carrier

≠
public static final class Carrier
extends java.lang.Object

## Methods

- ≠
  public <R, X> R call(java.lang.ScopedValue.CallableOp<? extends R, X> arg0) throws X
  Comparing jdk and sv

  ### call

  public <R, X extends Throwable> R call (ScopedValue.CallableOpPREVIEW <? extends R, X> op) throws X
  Calls a value-returning operation with each scoped value in this mapping bound to its value in the current thread. When the operation completes (normally or with an exception), each scoped value in the mapping will revert to being unbound, or revert to its previous value when previously bound, in the current thread. If `op` completes with an exception then it propagated by this method.

  Scoped values are intended to be used in a structured manner . If code invoked directly or indirectly by the operation creates a `StructuredTaskScope` PREVIEW but does not closePREVIEW it, then it is detected as a structure violation when the operation completes (normally or with an exception). In that case, the underlying construct of the `StructuredTaskScope` is closed and `StructureViolationException` PREVIEW is thrown.

  Type Parameters:
    `R` - the type of the result of the operation
    `X` - type of the exception thrown by the operation
  Parameters:
    `op` - the operation to run
  Returns:
    the result
  Throws:
    `StructureViolationExceptionPREVIEW` - if a structure violation is detected
    `X` - if `op` completes with an exception
  Since:
    23
  See Also:
  Moved out of a definition list with class notes.Moved out of a definition.Moved out of an unordered list with class tag-list-long.
- `ScopedValue.callWhere(ScopedValue, Object, CallableOp)` PREVIEW

- =
  public <T> T get(java.lang.ScopedValue<T> arg0)
- ≠
  public void run(java.lang.Runnable arg0)
  Comparing jdk and sv

  ### run

  public void run (Runnable op)
  Runs an operation with each scoped value in this mapping bound to its value in the current thread. When the operation completes (normally or with an exception), each scoped value in the mapping will revert to being unbound, or revert to its previous value when previously bound, in the current thread. If `op` completes with an exception then it propagated by this method.

  Scoped values are intended to be used in a structured manner . If code invoked directly or indirectly by the operation creates a `StructuredTaskScope` PREVIEW but does not closePREVIEW it, then it is detected as a structure violation when the operation completes (normally or with an exception). In that case, the underlying construct of the `StructuredTaskScope` is closed and `StructureViolationException` PREVIEW is thrown.

  Parameters:
    `op` - the operation to run
  Throws:
    `StructureViolationExceptionPREVIEW` - if a structure violation is detected
  See Also:
  Moved out of a definition list with class notes.Moved out of a definition.Moved out of an unordered list with class tag-list-long.
- `ScopedValue.runWhere(ScopedValue, Object, Runnable)` PREVIEW
- =
  public <T> java.lang.ScopedValue.Carrier where(java.lang.ScopedValue<T> arg0, T arg1)

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
call(ScopedValue.CallableOp) |  |  |  |  |  |  |  | 1 | 3 | 4
run(Runnable) |  |  |  |  |  |  |  | 1 | 3 | 4
Total |  |  |  |  |  |  |  | 2 | 6 | 8