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:
parent
ed9ede3446
commit
67df4986ce
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue