Skip to content

Commit 56e3025

Browse files
committed
Merge branch '2.2.x'
2 parents 2d19751 + b7e250e commit 56e3025

File tree

1 file changed

+7
-6
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar

1 file changed

+7
-6
lines changed

spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarFileTests.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -595,11 +595,12 @@ void jarFileEntryWithEpochTimeOfZeroShouldNotFail() throws Exception {
595595
jarOutputStream.write(new byte[] { (byte) 1 });
596596
jarOutputStream.closeEntry();
597597
}
598-
JarFile jarFile = new JarFile(file);
599-
Enumeration<java.util.jar.JarEntry> entries = jarFile.entries();
600-
JarEntry entry = entries.nextElement();
601-
assertThat(entry.getLastModifiedTime().toInstant()).isEqualTo(Instant.EPOCH);
602-
assertThat(entry.getName()).isEqualTo("1.dat");
598+
try (JarFile jar = new JarFile(file)) {
599+
Enumeration<java.util.jar.JarEntry> entries = jar.entries();
600+
JarEntry entry = entries.nextElement();
601+
assertThat(entry.getLastModifiedTime().toInstant()).isEqualTo(Instant.EPOCH);
602+
assertThat(entry.getName()).isEqualTo("1.dat");
603+
}
603604
}
604605

605606
private int getJavaVersion() {

0 commit comments

Comments
 (0)