> 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)) {
> Anyway, this PR looks good to me and if you @demobox agree, I think it can be
> merged once the isOpen() comment is addressed,
> and we can open the try/catch thing as a separate issue.
+1 for tackling the `try...catch` piece as a separate improvement.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/32/files#r4723964