diff options
author | Jonathan Nieder <jrn@google.com> | 2016-11-22 15:38:05 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2016-11-22 15:38:08 -0500 |
commit | 4ebe7cc4cadc60f54e0721d78b45aba8ea3cb93b (patch) | |
tree | 495e18e15eded294ccfbcc977e1feb85ca2846f4 | |
parent | ca2183a403b986d5ed2a2562b614a3dd4f36ffad (diff) | |
parent | 5af3f9bd638318a26cd0192097481169cfc2dfc1 (diff) | |
download | jgit-4ebe7cc4cadc60f54e0721d78b45aba8ea3cb93b.tar.gz jgit-4ebe7cc4cadc60f54e0721d78b45aba8ea3cb93b.zip |
Merge "Close input stream after use"
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java index c90cadf7b6..13d4a24b02 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java @@ -881,13 +881,17 @@ class WalkFetchConnection extends BaseFetchConnection { 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(); + } } } } |