We now avoid provisioning if the binding is not AutoCloseable.
@ -12,11 +12,11 @@ public class CloseableInjector(
continue
}
val o = binding.provider.get()
if (!AutoCloseable::class.java.isAssignableFrom(binding.key.typeLiteral.rawType)) {
if (o !is AutoCloseable) {
val o = binding.provider.get() as AutoCloseable
o.close()