From a522e2ae379aa4cd48ac30ce9bd946535cd51caf Mon Sep 17 00:00:00 2001 From: gnembon Date: Thu, 13 May 2021 01:51:01 -0300 Subject: [PATCH] fixed changed behaviour under java 16 --- src/main/java/carpet/script/argument/FileArgument.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/carpet/script/argument/FileArgument.java b/src/main/java/carpet/script/argument/FileArgument.java index fa4cbed3..beaa0279 100644 --- a/src/main/java/carpet/script/argument/FileArgument.java +++ b/src/main/java/carpet/script/argument/FileArgument.java @@ -1,8 +1,6 @@ package carpet.script.argument; import carpet.CarpetServer; -import carpet.script.Context; -import carpet.script.LazyValue; import carpet.script.bundled.Module; import carpet.script.exception.InternalExpressionException; import carpet.script.exception.ThrowStatement; @@ -180,14 +178,11 @@ public class FileArgument Map env = new HashMap<>(); if (reason == Reason.CREATE) env.put("create", "true"); zipPath = resolve(getDescriptor(module, zipContainer)); + if (!Files.exists(zipPath) && reason != Reason.CREATE) return null; // no zip file try { zfs = FileSystems.newFileSystem(URI.create("jar:"+ zipPath.toUri().toString()), env); } - catch (FileSystemNotFoundException fsnfe) - { - return null; - } - catch (IOException e) + catch (FileSystemNotFoundException | IOException fsnfe) { throw new ThrowStatement("Unable to open zip file: "+zipContainer, Throwables.IO_EXCEPTION); }