DaveAKing / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Here: 
http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/cache/C
acheBuilder.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).

Original issue reported on code.google.com by shtra...@gmail.com on 6 Mar 2014 at 8:45

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:09

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07