openslide / openslide-java

Java bindings to OpenSlide
https://openslide.org/
GNU Lesser General Public License v2.1
41 stars 24 forks source link

Support OpenSlide cache management API #76

Closed bgilbert closed 7 months ago

bgilbert commented 7 months ago

Use the same semantics as the OpenSlide API.

The OpenSlide class implements java.io.Closeable, which is documented to be for a source or destination of data that can be closed. OpenSlideCache is technically a source or destination of data, but not at the Java API level, and the only reason it needs to be closeable is to release the underlying resource in the C API. Its superinterface java.lang.AutoCloseable is documented to be for an object that may hold resources [...] until it is closed; implement that instead.

OpenSlide has a legacy dispose() method which is an alias for close(). Don't add a similar method to OpenSlideCache.

Closes: https://github.com/openslide/openslide-java/issues/36

openslide-bot commented 7 months ago

DCO signed off :heavy_check_mark:

All commits have been signed off. You have certified to the terms of the Developer Certificate of Origin, version 1.1. In particular, you certify that this contribution has not been developed using information obtained under a non-disclosure agreement or other license terms that forbid you from contributing it under the GNU Lesser General Public License, version 2.1.