News and views from members of the Java team at Oracle
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.
Further reading and viewing:
JDK Enhancement Proposals:
dev.java: the destination for Java developers
OpenJDK: the place to collaborate on the Java Platform and related projects
Oracle Java: the #1 programming language and development platform
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.