Browse Source

PathSuffixFilterTest: Open TreeWalk in try-with-resource

Change-Id: If0ee71f09a5464e27f0496dac364f8f9bb015eb6
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
stable-4.2
David Pursehouse 9 years ago
parent
commit
f7a3643fb8
  1. 3
      org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java

3
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTest.java

@ -113,7 +113,7 @@ public class PathSuffixFilterTest extends RepositoryTestCase {
private List<String> getMatchingPaths(String suffixFilter, private List<String> getMatchingPaths(String suffixFilter,
final ObjectId treeId, boolean recursiveWalk) throws IOException { final ObjectId treeId, boolean recursiveWalk) throws IOException {
final TreeWalk tw = new TreeWalk(db); try (final TreeWalk tw = new TreeWalk(db)) {
tw.setFilter(PathSuffixFilter.create(suffixFilter)); tw.setFilter(PathSuffixFilter.create(suffixFilter));
tw.setRecursive(recursiveWalk); tw.setRecursive(recursiveWalk);
tw.addTree(treeId); tw.addTree(treeId);
@ -123,5 +123,6 @@ public class PathSuffixFilterTest extends RepositoryTestCase {
paths.add(tw.getPathString()); paths.add(tw.getPathString());
return paths; return paths;
} }
}
} }

Loading…
Cancel
Save