Skip to content
Snippets Groups Projects
Commit cf04cd49 authored by dgelessus's avatar dgelessus
Browse files

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.
parent 49a7214a
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment