]> source.dussan.org Git - javassist.git/commitdiff
stops a potential leak in JarClassPath openClassfile(). Issues #222.
authorchibash <chiba@javassist.org>
Sat, 15 Sep 2018 03:06:25 +0000 (12:06 +0900)
committerchibash <chiba@javassist.org>
Sat, 15 Sep 2018 03:06:25 +0000 (12:06 +0900)
src/main/javassist/ClassPoolTail.java

index 2ab8ee467dc3fb5a189a921c9d335ff6d18bcef2..965d72fb02afc4f9b4211211fc447a2cae25adf8 100644 (file)
@@ -159,7 +159,9 @@ final class JarClassPath implements ClassPath {
         URL jarURL = find(classname);
         if (null != jarURL)
             try {
-                return jarURL.openConnection().getInputStream();
+                java.net.URLConnection con = jarURL.openConnection();
+                con.setUseCaches(false);
+                return con.getInputStream();
             }
             catch (IOException e) {
                 throw new NotFoundException("broken jar file?: "