Skip to content

Commit

Permalink
[WELD-2800] Don't use jar cache in ServiceLoader.loadServiceFile
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangHG authored and manovotn committed Nov 5, 2024
1 parent 54d5769 commit a414fe2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion impl/src/main/java/org/jboss/weld/util/ServiceLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.io.InputStreamReader;
import java.lang.reflect.Constructor;
import java.net.URL;
import java.net.URLConnection;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
Expand Down Expand Up @@ -173,7 +174,10 @@ private List<URL> loadServiceFiles() {
private void loadServiceFile(URL serviceFile) {
InputStream is = null;
try {
is = serviceFile.openStream();
URLConnection jarConnection = serviceFile.openConnection();
//Don't cache the file (avoids file leaks on GlassFish).
jarConnection.setUseCaches(false);
is = jarConnection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
String serviceClassName = null;
int i = 0;
Expand Down

0 comments on commit a414fe2

Please sign in to comment.