I've been searching how to raise a warning in Java if a specific object from a class that has a close() function in it doesn't at some point call that close() function (as for example for the BufferedReader class).
In searching through this, I found the Closeable and AutoCloseable interfaces and how they work.
But I still face the issue that when the object in question is created through a function, it is not supposed that it hasn't been closed.
Is it possible to get a Closeable object from a function with it still being considered unclosed ?
Thanks !