DfsInserter#openStream: Suppress resource warning about DfsReader

DfsReader is not opened in a try-with-resource because in the case where
the method returns an ObjectStream.Filter, the DfsReader should only be
closed from within the Filter's close() method.

Suppress the resource warning.

Change-Id: Ifcaf5e4a326bd1d03c6331b476c645ca43943b34
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2018-03-20 11:43:15 +09:00 committed by Matthias Sohn
parent b3a4ace695
commit 84a6318eae
1 changed files with 1 additions and 0 deletions

View File

@ -669,6 +669,7 @@ private class StreamLoader extends ObjectLoader {
@Override
public ObjectStream openStream() throws IOException {
@SuppressWarnings("resource") // Explicitly closed below
final DfsReader ctx = db.newReader();
if (srcPack != packKey) {
try {