Skip to content

Commit a93304c

Browse files
committed
Merge branch '2.4.x' into 2.5.x
Closes gh-28356
2 parents 467e063 + 7388f2b commit a93304c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ public class JarFile extends AbstractJarFile implements Iterable<java.util.jar.J
9191

9292
private volatile boolean closed;
9393

94+
private volatile JarFileWrapper wrapper;
95+
9496
/**
9597
* Create a new {@link JarFile} backed by the specified file.
9698
* @param file the root jar file
@@ -183,6 +185,15 @@ public void visitEnd() {
183185
};
184186
}
185187

188+
JarFileWrapper getWrapper() throws IOException {
189+
JarFileWrapper wrapper = this.wrapper;
190+
if (wrapper == null) {
191+
wrapper = new JarFileWrapper(this);
192+
this.wrapper = wrapper;
193+
}
194+
return wrapper;
195+
}
196+
186197
@Override
187198
Permission getPermission() {
188199
return new FilePermission(this.rootFile.getFile().getPath(), READ_ACTION);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 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.
@@ -263,7 +263,7 @@ static JarURLConnection get(URL url, JarFile jarFile) throws IOException {
263263
&& !jarFile.containsEntry(jarEntryName.toString())) {
264264
return NOT_FOUND_CONNECTION;
265265
}
266-
return new JarURLConnection(url, new JarFileWrapper(jarFile), jarEntryName);
266+
return new JarURLConnection(url, jarFile.getWrapper(), jarEntryName);
267267
}
268268

269269
private static int indexOfRootSpec(StringSequence file, String pathFromRoot) {

0 commit comments

Comments
 (0)