imglib / imglib2-cache

Cache interfaces and java.lang.ref based implementation.
Other
6 stars 4 forks source link

Fix java 11 #11

Closed tpietzsch closed 5 years ago

tpietzsch commented 5 years ago

This test (DiskCachedCellImgTest) fails with Java 11 in imglib2-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 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.