aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-03-06 17:18:23 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-03-06 17:18:23 +0900
commitd1356bf2380761c0f3926b86aa54812b384b0168 (patch)
tree444bc75f6329f5f87fbf362720f77a411ae78b2d /org.eclipse.jgit
parent03536cc2d04f66e2167e4e9d068aa515c4286ff0 (diff)
downloadjgit-d1356bf2380761c0f3926b86aa54812b384b0168.tar.gz
jgit-d1356bf2380761c0f3926b86aa54812b384b0168.zip
FileRepository: Open FileInputStream in try-with-resource
Change-Id: Ief8aa4834437d76f7e636598bf9861312475e64a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java5
1 files changed, 1 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
index 9e2fb55de0..9b82210e6c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java
@@ -620,11 +620,8 @@ public class FileRepository extends Repository {
static void loadRulesFromFile(AttributesNode r, File attrs)
throws FileNotFoundException, IOException {
if (attrs.exists()) {
- FileInputStream in = new FileInputStream(attrs);
- try {
+ try (FileInputStream in = new FileInputStream(attrs)) {
r.parse(in);
- } finally {
- in.close();
}
}
}