Summary
Remove the old java.lang.ScopedValue
"convenience methods" runWhere
and callWhere,
leaving only the "fluent" API.
Problem
There are currently two ways to bind a scoped value:
ScopedValue.runWhere(aScopedValue, aValue, aRunnable);
and
ScopedValue.where(aScopedValue, aValue).run(aRunnable);
The latter has the advantage that it can be chained;
ScopedValue.where(aScopedValue, aValue).where(anotherScopedValue, anotherValue).run(aRunnable);
We can make the ScopedValue API smaller and simpler, as well as making code using scoped values easier to read, by only retaining the latter of the two ways to do it.
Solution
Remove ScopedValue.runWhere(ScopedValue, Object, Runnable)
and ScopedValue.callWhere(ScopedValue, Object, CallableOp)
.
Specification
See the attached apidiff.
- csr of
-
JDK-8341903 Implementation of Scoped Values (Fourth Preview)
-
- Resolved
-
- relates to
-
JDK-8338456 JEP 487: Scoped Values (Fourth Preview)
-
- Closed
-