This PR fixes it by adding to the CacheRemover interface methods to extract "relevant data" from a cached value V, which is basically everything besides the actual V object. This data can then be (strongly) referenced to from the cache and passed to the CacheRemover when the V is garbage-collected. To make this work, the "relevant data" must be effectively final in V.
This test (
DiskCachedCellImgTest
) fails with Java 11 inimglib2-cache 1.0.0-beta-11
.See this forum post for explanation.
This PR fixes it by adding to the
CacheRemover
interface methods to extract "relevant data" from a cached valueV
, which is basically everything besides the actualV
object. This data can then be (strongly) referenced to from the cache and passed to theCacheRemover
when theV
is garbage-collected. To make this work, the "relevant data" must be effectivelyfinal
inV
.