MayHoldCloseableResource vs AutoCloseable

Paul Benedict pbenedict at apache.org
Mon Jul 8 07:20:12 PDT 2013


What are the semantic differences between these two interfaces? I come away
with no programming difference (i.e., you will always need to close the
stream because it *could* hold a resource); but it's more of a hint to IDEs
not to display a "resource leak" warning if try-with-resources is not used.

Am I correct? The only reason I ask is because it seems this interface can
be done without. I think it would be much more palatable to use just the
annotation only rather than the sub-interface.

Paul


More information about the lambda-dev mailing list