]> source.dussan.org Git - jgit.git/commit
DfsGarbageCollector: avoid closing idx and bitmap streams twice 16/76916/1
authorJonathan Nieder <jrn@google.com>
Thu, 7 Jul 2016 23:08:02 +0000 (16:08 -0700)
committerJonathan Nieder <jrn@google.com>
Thu, 7 Jul 2016 23:08:02 +0000 (16:08 -0700)
commitca2052a8c1e317927d27efef91b3368f147bf9af
tree9ee50dd96e0871a199db27338e36514aa6ee9063
parent450c0af42fe71f58677330f6982164187dcde5c3
DfsGarbageCollector: avoid closing idx and bitmap streams twice

These try-with-resources blocks close the underlying output stream
twice: once when closing the CountingOutputStream wrapper, then again
when closing the DfsOutputStream out.

Simplify by only closing the CountingOutputStream.

In practice this shouldn't matter because the close() method of a
Closable is required to be idempotent, but avoiding the redundant
extra close makes the code simpler to read and understand.

Change-Id: I1778c4fc8ba075a2c6cd2129528bb272cb3a1af7
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java