From 6be108c09635fae15ad45682d89ea73bc9d239df Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Fri, 26 Feb 2021 19:29:17 +0800 Subject: [PATCH] Fix stream closing issue --- .../org/maxgamer/quickshop/util/security/JarVerifyTool.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/util/security/JarVerifyTool.java b/src/main/java/org/maxgamer/quickshop/util/security/JarVerifyTool.java index fc5dfbb17..72a255d46 100644 --- a/src/main/java/org/maxgamer/quickshop/util/security/JarVerifyTool.java +++ b/src/main/java/org/maxgamer/quickshop/util/security/JarVerifyTool.java @@ -36,9 +36,8 @@ public class JarVerifyTool { Enumeration entries = jar.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); - try { + try (InputStream is = jar.getInputStream(entry)) { byte[] buffer = new byte[8192]; - InputStream is = jar.getInputStream(entry); //noinspection StatementWithEmptyBody while ((is.read(buffer, 0, buffer.length)) != -1) { // We just read. This will throw a SecurityException