From a17e1f473a6a09911f4e4a9f09a760ace2613edf Mon Sep 17 00:00:00 2001 From: Daniel Holle Date: Wed, 5 Jul 2023 15:48:27 +0200 Subject: [PATCH] Catch linkage error --- .../target/generate/ASTToTargetAST.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java b/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java index bfe353a1..639bdfd0 100644 --- a/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java +++ b/src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java @@ -240,8 +240,8 @@ public class ASTToTargetAST { ); } - private static final Map usedFunN = new HashMap<>(); - private static final Set usedFunNSuperTypes = new HashSet<>(); + private final Map usedFunN = new HashMap<>(); + private final Set usedFunNSuperTypes = new HashSet<>(); public Map auxiliaries = new HashMap<>(); @@ -295,7 +295,9 @@ public class ASTToTargetAST { try { classLoader.findClass(superClassName); } catch (ClassNotFoundException e) { - classLoader.loadClass(code); + try { + classLoader.loadClass(code); + } catch (LinkageError ignored) {} } auxiliaries.put(superClassName, code); } @@ -306,7 +308,9 @@ public class ASTToTargetAST { try { classLoader.findClass(className); } catch (ClassNotFoundException e) { - classLoader.loadClass(code); + try { + classLoader.loadClass(code); + } catch (LinkageError ignored) {} } usedFunN.put(className, gep); auxiliaries.put(className, code);