diff options
author | Roel Spilker <r.spilker@gmail.com> | 2020-01-16 00:13:44 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2020-01-20 13:55:43 +0100 |
commit | 18d70e7bc677cc1bd2e7c14f917543d88ac26ac9 (patch) | |
tree | 0edd0e384125070b7a4b4886888537596300fd18 /src/launch | |
parent | 7ca43108f52e0d4432f0266db5897eef919c71cf (diff) | |
download | lombok-18d70e7bc677cc1bd2e7c14f917543d88ac26ac9.tar.gz lombok-18d70e7bc677cc1bd2e7c14f917543d88ac26ac9.tar.bz2 lombok-18d70e7bc677cc1bd2e7c14f917543d88ac26ac9.zip |
Close more inputstreams
Diffstat (limited to 'src/launch')
-rw-r--r-- | src/launch/lombok/launch/ShadowClassLoader.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/launch/lombok/launch/ShadowClassLoader.java b/src/launch/lombok/launch/ShadowClassLoader.java index f2a21a4e..30ca6e97 100644 --- a/src/launch/lombok/launch/ShadowClassLoader.java +++ b/src/launch/lombok/launch/ShadowClassLoader.java @@ -364,16 +364,20 @@ class ShadowClassLoader extends ClassLoader { FileInputStream jar = new FileInputStream(jarLoc); try { ZipInputStream zip = new ZipInputStream(jar); - while (true) { - ZipEntry entry = zip.getNextEntry(); - if (entry == null) { - jarLocCache.put(key, false); - return false; + try { + while (true) { + ZipEntry entry = zip.getNextEntry(); + if (entry == null) { + jarLocCache.put(key, false); + return false; + } + if (!"META-INF/ShadowClassLoader".equals(entry.getName())) continue; + boolean v = sclFileContainsSuffix(zip, suffix); + jarLocCache.put(key, v); + return v; } - if (!"META-INF/ShadowClassLoader".equals(entry.getName())) continue; - boolean v = sclFileContainsSuffix(zip, suffix); - jarLocCache.put(key, v); - return v; + } finally { + zip.close(); } } finally { jar.close(); |