Skip to content

Commit 7e718cd

Browse files
committed
Remove redundant hash from path of unpacked nested library
Closes gh-4124
1 parent d55c001 commit 7e718cd

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,11 @@ protected Archive getNestedArchive(Entry entry) throws IOException {
114114
}
115115

116116
private Archive getUnpackedNestedArchive(JarEntryData data) throws IOException {
117-
AsciiBytes hash = data.getComment().substring(UNPACK_MARKER.length());
118117
String name = data.getName().toString();
119118
if (name.lastIndexOf("/") != -1) {
120119
name = name.substring(name.lastIndexOf("/") + 1);
121120
}
122-
File file = new File(getTempUnpackFolder(), hash.toString() + "-" + name);
121+
File file = new File(getTempUnpackFolder(), name);
123122
if (!file.exists() || file.length() != data.getSize()) {
124123
unpack(data, file);
125124
}

spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/JarFileArchiveTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void getNestedUnpackedArchive() throws Exception {
9797
Entry entry = getEntriesMap(this.archive).get("nested.jar");
9898
Archive nested = this.archive.getNestedArchive(entry);
9999
assertThat(nested.getUrl().toString(), startsWith("file:"));
100-
assertThat(nested.getUrl().toString(), endsWith(".jar"));
100+
assertThat(nested.getUrl().toString(), endsWith("/nested.jar"));
101101
}
102102

103103
@Test

0 commit comments

Comments
 (0)