ClassValue - clarify Javadoc

Roman Leventov leventov.ru at gmail.com
Mon Jan 28 13:14:50 UTC 2019


computeValue() documentation says:

"This method will be invoked within the first thread that accesses the
value with the get method. Normally, this method is invoked at most once
per class, but it may be invoked again if there has been a call to remove."

It sounds exactly like ClassValue prohibits concurrent computeValue calls,
but it doesn't, as could be seen in the documentation of get():

"The actual installation of the value on the class is performed atomically.
At that point, if several racing threads have computed values, one is
chosen, and returned to all the racing threads."


More information about the core-libs-dev mailing list