Browse Source

Use try-with-resource to close resources in DirCache

Change-Id: I7dd3fd38784689816a1a8e9d8ccb499ae2138a8a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
tags/v4.0.0.201505050340-m2
Matthias Sohn 9 years ago
parent
commit
b84623ac64
1 changed files with 1 additions and 4 deletions
  1. 1
    4
      org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java

+ 1
- 4
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCache.java View File

@@ -961,9 +961,8 @@ public class DirCache {
* @throws IOException
*/
private void updateSmudgedEntries() throws IOException {
TreeWalk walk = new TreeWalk(repository);
List<String> paths = new ArrayList<String>(128);
try {
try (TreeWalk walk = new TreeWalk(repository)) {
for (int i = 0; i < entryCnt; i++)
if (sortedEntries[i].isSmudged())
paths.add(sortedEntries[i].getPathString());
@@ -989,8 +988,6 @@ public class DirCache {
entry.setLastModified(fIter.getEntryLastModified());
}
}
} finally {
walk.release();
}
}
}

Loading…
Cancel
Save