guava icon indicating copy to clipboard operation
guava copied to clipboard

Fix confusing Javadoc of memoizeWithExpiration

Open MartinSpiessl opened this issue 4 years ago • 3 comments

The previous wording could be read such that the cache is cleared in the background once the expiration time is reached. However this is not the case, so we simply remove the following part of the Javadoc: "and removes the cached value after the specified time has passed" The rest of the Javadoc already accurately describes the behavior, though the part with "After the expiration time" could again be misinterpreted, so we rewrite this to clarify that things only happen once the "get" method is called.

MartinSpiessl avatar Dec 06 '21 10:12 MartinSpiessl

Sure, submitted my Contributor License Agreement a minute ago.

MartinSpiessl avatar Dec 06 '21 10:12 MartinSpiessl

It says I should request a rescan regarding CLA from a repository manager. I assume the person who does the releases is for sure one of the a repository managers, so that would be @cpovirk.

MartinSpiessl avatar Dec 06 '21 10:12 MartinSpiessl

This is indeed a common cause of confusion.

It would still be good for the first sentence to say something about the expiration. Maybe use the original phrasing but with "removes" changed to "invalidates?" But even that may be misleading, given that Cache.invalidate uses that word for immediate removal (I think). Other ideas?

cpovirk avatar Dec 06 '21 14:12 cpovirk