Some Classes with a public void close() don't implement AutoCloseable

Florian Weimer fw at deneb.enyo.de
Fri Apr 17 16:35:07 UTC 2020


* forax:

> - until lambdas are retrofitted as inline types, i'm worry people
> will use forceTryable with a ReentrantLock, try(var __ =
> forceTryable(lock::unlock)) { ... }  because most of the time, the
> lambda will not be allocated but not always, sometimes it may still
> be found escaping by the JITs.

The JDK itself routinely does something very similar when registering
cleaners.  Is this lack of robustness in the presence of OOMEs a
quality-of-implementation issue?  Or less or more important?


More information about the discuss mailing list