aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-03-05 16:23:50 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-03-05 16:23:50 +0900
commit88151ed6208db74ac32e3e23a6288565bedbfe9c (patch)
tree6dc2968e2024c13dcde424cfb905f0601ff43735 /org.eclipse.jgit.test
parent50cebd85a832d82349ce4850735b5ba0aee3e98d (diff)
downloadjgit-88151ed6208db74ac32e3e23a6288565bedbfe9c.tar.gz
jgit-88151ed6208db74ac32e3e23a6288565bedbfe9c.zip
RebaseCommandTest: Open BufferedReader in try-with-resource
Change-Id: If8d77431edfdaec4a49a3c4ffe66a99e6d31c682 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
index 3f43c6b1bb..cbccc23928 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RebaseCommandTest.java
@@ -2103,9 +2103,8 @@ public class RebaseCommandTest extends RepositoryTestCase {
private int countPicks() throws IOException {
int count = 0;
File todoFile = getTodoFile();
- BufferedReader br = new BufferedReader(new InputStreamReader(
- new FileInputStream(todoFile), "UTF-8"));
- try {
+ try (BufferedReader br = new BufferedReader(new InputStreamReader(
+ new FileInputStream(todoFile), "UTF-8"))) {
String line = br.readLine();
while (line != null) {
int firstBlank = line.indexOf(' ');
@@ -2123,8 +2122,6 @@ public class RebaseCommandTest extends RepositoryTestCase {
line = br.readLine();
}
return count;
- } finally {
- br.close();
}
}