Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency in CacheBuilder.weigher() and maximumWeight() javadoc #1690

Open
gissuebot opened this issue Oct 31, 2014 · 0 comments
Open

Inconsistency in CacheBuilder.weigher() and maximumWeight() javadoc #1690

gissuebot opened this issue Oct 31, 2014 · 0 comments

Comments

@gissuebot
Copy link

Original issue created by shtratos on 2014-03-06 at 08:45 AM


Here: https://google.github.io/guava/apidocs/com/google/common/cache/CacheBuilder.html#weigher(com.google.common.cache.Weigher)

maximumWeight() javadoc says:
... When weight is zero, elements will be evicted immediately after being loaded into cache.

Note that weight is only used to determine whether the cache is over capacity; it has no effect on selecting which entry should be evicted next. ...

Which contradicts to weigher() javadoc:
... Entry weight is taken into consideration by maximumWeight(long) when determining which entries to evict, ...

When the weight of an entry is zero it will not be considered for size-based eviction (though it still may be evicted by other means).

@cgdecker cgdecker removed the migrated label Nov 1, 2014
@kevinb9n kevinb9n added the type=api-docs Change/add API documentation label Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants