Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable URL connection caching in SPIClassIterator #88586

Merged
merged 2 commits into from Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/changelog/88586.yaml
@@ -0,0 +1,6 @@
pr: 88586
summary: Disable URL connection caching in SPIClassIterator
area: Infra/Plugins
type: bug
issues:
- 88275
Expand Up @@ -26,6 +26,7 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -106,7 +107,9 @@ private boolean loadNextProfile() {
}
final URL url = profilesEnum.nextElement();
try {
final InputStream in = url.openStream();
URLConnection urlc = url.openConnection();
urlc.setUseCaches(false); // prevents retaining a handle to the underlying jar file, when the stream is closed
final InputStream in = urlc.getInputStream();
boolean success = false;
try {
final BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
Expand Down