> public void addToClose(Closeable toClose) {
> methodsToClose.add(toClose);
> }
>
> public void close() throws IOException {
> - Collections.reverse(methodsToClose);
> - for (Closeable toClose : methodsToClose) {
> - toClose.close();
> + if (state.compareAndSet(State.OPEN, State.CLOSING)) {
This is now a change in logic...`close` will only be called **once** now.
Previously, it was possible to call `close` multiple times, and the closer
would run multiple times too.
I think the new logic is _nicer_ but I think we should try to verify whether
this might impact users...
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/32/files#r4714168