diff --git a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java index 42f4f094..7debd5e3 100644 --- a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -668,6 +668,7 @@ public class JavaTXCompiler { public boolean loadJavaTXClass(JavaClassName name) { var file = findFileForClass(name); if (file != null) { + if (classRegistry.contains(name)) return true; try { var tree = JavaTXParser.parse(file); classRegistry.addName(name.toString(), 0); // TODO This gets overwritten later, is it bad if we don't know this right away? diff --git a/src/main/java/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java b/src/main/java/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java index 1ab04244..968daf8e 100644 --- a/src/main/java/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java +++ b/src/main/java/de/dhbwstuttgart/parser/scope/JavaClassRegistry.java @@ -55,6 +55,10 @@ public class JavaClassRegistry { return existingClasses.containsKey(new JavaClassName(whole)); } + public boolean contains(JavaClassName name) { + return existingClasses.containsKey(name); + } + public int getNumberOfGenerics(String name) { return existingClasses.get(new JavaClassName(name)); } diff --git a/src/test/java/TestPackages.java b/src/test/java/TestPackages.java index 68674bcb..d4d7128f 100644 --- a/src/test/java/TestPackages.java +++ b/src/test/java/TestPackages.java @@ -22,7 +22,6 @@ public class TestPackages { cmp.generateBytecode(bytecodeDirectory); } - @Ignore("FIXME") @Test public void testPackagesCircular() throws Exception { var cmp = new JavaTXCompiler(