Browse Source

Merge branch '2.1.x' into 2.2.x

pull/23445/head
Phillip Webb 5 years ago
parent
commit
195def0ec3
  1. 3
      spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java
  2. 3
      spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarFileTests.java

3
spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/jar/JarFileEntries.java

@ -353,11 +353,12 @@ class JarFileEntries implements CentralDirectoryVisitor, Iterable<JarEntry> { @@ -353,11 +353,12 @@ class JarFileEntries implements CentralDirectoryVisitor, Iterable<JarEntry> {
try (JarInputStream certifiedJarStream = new JarInputStream(this.jarFile.getData().getInputStream())) {
java.util.jar.JarEntry certifiedEntry = null;
while ((certifiedEntry = certifiedJarStream.getNextJarEntry()) != null) {
// Entry must be closed to trigger a read and set entry certificates
certifiedJarStream.closeEntry();
int index = getEntryIndex(certifiedEntry.getName());
if (index != -1) {
certifications[index] = JarEntryCertification.from(certifiedEntry);
}
certifiedJarStream.closeEntry();
}
}
this.certifications = certifications;

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

@ -407,11 +407,14 @@ class JarFileTests { @@ -407,11 +407,14 @@ class JarFileTests {
while (actualEntries.hasMoreElements()) {
JarEntry actualEntry = actualEntries.nextElement();
java.util.jar.JarEntry expectedEntry = expected.getJarEntry(actualEntry.getName());
StreamUtils.drain(expected.getInputStream(expectedEntry));
if (!actualEntry.getName().equals("META-INF/MANIFEST.MF")) {
assertThat(actualEntry.getCertificates()).as(actualEntry.getName())
.isEqualTo(expectedEntry.getCertificates());
assertThat(actualEntry.getCodeSigners()).as(actualEntry.getName())
.isEqualTo(expectedEntry.getCodeSigners());
}
}
assertThat(stopWatch.getTotalTimeSeconds()).isLessThan(3.0);
}
}

Loading…
Cancel
Save