-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make LifeCycle implement AutoCloseable #3184
Comments
We certainly can do: public interface LifeCycle
{
...
interface Closeable extends LifeCycle, AutoCloseable
{
@Override
default void close() throws Exception
{
stop();
}
}
} Not sure about making all LifeCycles autocloseable |
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has been a |
This issue has been automatically marked as stale because it has been a |
This issue has been automatically marked as stale because it has been a |
Rather than making LifeCycle AutoCloseable, just implement AutoCloseable in the client components. Update tests to use try-with-resources accordingly. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
I agree that making all I think introducing |
Rather than making LifeCycle AutoCloseable, just implement AutoCloseable in the client components. Update tests to use try-with-resources accordingly. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
It is so handy in tests to be able to create a
LifeCycle
in a test method and use it with try-with-resources.Thoughts?
The text was updated successfully, but these errors were encountered: