mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-08 02:09:06 +00:00
Use try with resources instead of try-finally
See gh-39259
This commit is contained in:
committed by
Phillip Webb
parent
cb26c31dd6
commit
316b415e95
+1
-4
@@ -413,7 +413,7 @@ class NestedJarFileTests {
|
||||
}
|
||||
|
||||
private List<String> collectComments(JarFile jarFile) throws IOException {
|
||||
try {
|
||||
try (jarFile) {
|
||||
List<String> comments = new ArrayList<>();
|
||||
Enumeration<JarEntry> entries = jarFile.entries();
|
||||
while (entries.hasMoreElements()) {
|
||||
@@ -424,9 +424,6 @@ class NestedJarFileTests {
|
||||
}
|
||||
return comments;
|
||||
}
|
||||
finally {
|
||||
jarFile.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user