UploadPack: Suppress resource warning about PackWriter

PackWriter is auto-closeable and should be opened in try-with-resource,
but this is not possible since the variable is being referenced in the
finally block before being explicitly closed there.

Suppress the warning and add an explanatory comment.

Change-Id: I161923f35142132234fd951c0146d3cb30920b7b
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2018-03-14 09:39:48 +09:00
parent ed9ede3446
commit 67df4986ce
1 changed files with 2 additions and 0 deletions

View File

@ -1541,6 +1541,8 @@ private void sendPack(final boolean sideband,
PackConfig cfg = packConfig;
if (cfg == null)
cfg = new PackConfig(db);
@SuppressWarnings("resource") // PackWriter is referenced in the finally
// block, and is closed there
final PackWriter pw = new PackWriter(cfg, walk.getObjectReader(),
accumulator);
try {