Closed buko closed 6 years ago
The same is true of ServiceHandle. It's not the end of the world either way but it would be nice to be able to write:
try (ServiceHandle<A> a = findA()) {
...
}
Rather than the more verbose form of initializing a to null and then using try/finally to ensure the ServiceHandle is always destroyed.
What do people think?
AutoCloseable now exists on Android so it shouldn't affect Android devs. It does require Java 7 to work.
Closing this as this issue is migrated to https://github.com/eclipse-ee4j/glassfish-hk2/issues/369
Would be nice to simplify the Operation API a bit to something like:
This would allow users to pass in the OperationData when the Operation is created and also ensure the Operation will always be closed.