Java Cup
Inside Java

News and views from members of the Java team at Oracle

From ThreadLocal to ScopedValue with Loom - JEP Café #16

ThreadLocal variables can help you share sensitive information among the different components of an application, without resorting to method calls. They have drawbacks that are now fixed with ScopedValue variables. Understand how ScopedValue are working and how you can use them as an incubator feature in JDK 20.

Show Notes

Further reading and viewing:

JDK Enhancement Proposals:

Additional Resources

JEP Café explores Java features and JDK Enhancement Proposals through tutorials and practical examples. Watch all episodes in the YouTube playlist. For more Java news, subscribe to our RSS feed and follow @Java on X.

Contact us.