DirCache: Suppress resource warning related to TemporaryBuffer
In #writeTo, the TemporaryBuffer can't be opened in try-with-resource because it's referenced in the finally block. Instead it is explicitly closed within the try block. Suppress the warning with an explanatory comment. Change-Id: I02009f77f9630d5d55afc34eb86d304ff103b8b0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
3e1066d0a4
commit
7bd2a4a7c6
|
@ -702,6 +702,8 @@ void writeTo(File dir, final OutputStream os) throws IOException {
|
|||
}
|
||||
|
||||
if (writeTree) {
|
||||
@SuppressWarnings("resource") // Explicitly closed in try block, and
|
||||
// destroyed in finally
|
||||
TemporaryBuffer bb = new TemporaryBuffer.LocalFile(dir, 5 << 20);
|
||||
try {
|
||||
tree.write(tmp, bb);
|
||||
|
|
Loading…
Reference in New Issue