Implementation changes for 4th preview of Scoped Values. The API is proposed to continue as a preview API in this release.
We have tried a few ways to bind a scoped value, and currently have two ways to do it. These are
ScopedValue.runWhere(aScopedValue, aValue, aRunnable);
and
ScopedValue.where(aScopedValue, aValue).run(aRunnable);
The latter has the advantage that it can be chained thusly:
ScopedValue.where(aScopedValue, aValue).where(anotherScopedValue, anotherValue).run(aRunnable);
We can make the scoped value 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.
We have tried a few ways to bind a scoped value, and currently have two ways to do it. These are
ScopedValue.runWhere(aScopedValue, aValue, aRunnable);
and
ScopedValue.where(aScopedValue, aValue).run(aRunnable);
The latter has the advantage that it can be chained thusly:
ScopedValue.where(aScopedValue, aValue).where(anotherScopedValue, anotherValue).run(aRunnable);
We can make the scoped value 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.
- csr for
-
JDK-8342205 Implementation of Scoped Values (Fourth Preview)
-
- Closed
-
- relates to
-
JDK-8338456 JEP 487: Scoped Values (Fourth Preview)
-
- Closed
-
- links to
-
Commit(master) openjdk/jdk/3fab8e37
-
Review(master) openjdk/jdk/21456