Skip to content

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

@gissuebot

Description

@gissuebot

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions