From cf04cd49f4e5836099624903206eb2e9d5d8a5f5 Mon Sep 17 00:00:00 2001 From: dgelessus <dgelessus@users.noreply.github.com> Date: Tue, 30 Jul 2024 12:49:37 +0200 Subject: [PATCH] Always read standard modules as resources, not as files Reading as resources always works, even when running from source, so there's no need to manually fall back to reading files. --- src/main/java/de/tlc4b/TLC4B.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/main/java/de/tlc4b/TLC4B.java b/src/main/java/de/tlc4b/TLC4B.java index 5109475..8446759 100644 --- a/src/main/java/de/tlc4b/TLC4B.java +++ b/src/main/java/de/tlc4b/TLC4B.java @@ -2,8 +2,6 @@ package de.tlc4b; import java.io.BufferedWriter; import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; @@ -468,16 +466,7 @@ public class TLC4B { InputStream is = null; FileOutputStream fos = null; try { - - try { - is = new FileInputStream("src/main/resources/standardModules/" + name + ".tla"); - } catch (FileNotFoundException e) { - is = this - .getClass() - .getClassLoader() - .getResourceAsStream("standardModules/" + name + ".tla"); - } - + is = this.getClass().getClassLoader().getResourceAsStream("standardModules/" + name + ".tla"); if (is == null) { // should never happen throw new TranslationException("Unable to determine the source of the standard module: " + name); -- GitLab