Merge "Close input stream after use"

This commit is contained in:
Jonathan Nieder 2016-11-22 15:38:05 -05:00 committed by Gerrit Code Review @ Eclipse.org
commit 4ebe7cc4ca
1 changed files with 11 additions and 7 deletions

View File

@ -881,13 +881,17 @@ else if (tmpIdx.isFile()) {
void downloadPack(final ProgressMonitor monitor) throws IOException {
String name = "pack/" + packName; //$NON-NLS-1$
WalkRemoteObjectDatabase.FileStream s = connection.open(name);
PackParser parser = inserter.newPackParser(s.in);
parser.setAllowThin(false);
parser.setObjectChecker(objCheck);
parser.setLockMessage(lockMessage);
PackLock lock = parser.parse(monitor);
if (lock != null)
packLocks.add(lock);
try {
PackParser parser = inserter.newPackParser(s.in);
parser.setAllowThin(false);
parser.setObjectChecker(objCheck);
parser.setLockMessage(lockMessage);
PackLock lock = parser.parse(monitor);
if (lock != null)
packLocks.add(lock);
} finally {
s.in.close();
}
}
}
}