Browse Source

FileRepository: Open FileInputStream in try-with-resource

Change-Id: Ief8aa4834437d76f7e636598bf9861312475e64a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-4.11
David Pursehouse 7 years ago
parent
commit
d1356bf238
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileRepository.java

5
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) static void loadRulesFromFile(AttributesNode r, File attrs)
throws FileNotFoundException, IOException { throws FileNotFoundException, IOException {
if (attrs.exists()) { if (attrs.exists()) {
FileInputStream in = new FileInputStream(attrs); try (FileInputStream in = new FileInputStream(attrs)) {
try {
r.parse(in); r.parse(in);
} finally {
in.close();
} }
} }
} }

Loading…
Cancel
Save