diff --git a/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java index 750dd9bf..24611f75 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java @@ -830,7 +830,8 @@ public class BytecodeGenMethod implements StatementVisitor { } methodRefl = getMethod(methodCall.name,methodCall.arglist.getArguments().size(),methCallType, typesOfParams,methods); } - catch (Throwable e2) { + catch (Exception e2) { + System.out.println(""); //do nothing } } diff --git a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java index 1111302f..28a9d20e 100644 --- a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -104,6 +104,7 @@ public class JavaTXCompiler { return new ArrayList<>(allClasses); } +/* public List typeInferenceOld() throws ClassNotFoundException { List allClasses = new ArrayList<>();//environment.getAllAvailableClasses(); //Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC @@ -226,12 +227,13 @@ public class JavaTXCompiler { return results.stream().map((unifyPairs -> new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList()); } - + */ /** * Vererbt alle Variancen bei Paaren (a <. theta) oder (Theta <. a) * wenn a eine Variance !=0 hat auf alle Typvariablen in Theta. * @param eq The set of constraints */ + /* private void varianceInheritance(Set eq) { Set usedTPH = new HashSet<>(); Set phSet = eq.stream().map(x -> { @@ -258,7 +260,7 @@ public class JavaTXCompiler { phSetVariance.removeIf(x -> (x.getVariance() == 0 || usedTPH.contains(x))); } } - + */ public List typeInference() throws ClassNotFoundException { @@ -278,7 +280,7 @@ public class JavaTXCompiler { TypeUnify unify = new TypeUnify(); Set> results = new HashSet<>(); try { - FileWriter logFile = new FileWriter(new File(System.getProperty("user.dir")+"/src/test/java/logFiles/"+"log")); + FileWriter logFile = new FileWriter(new File(System.getProperty("user.dir")+"/src/test/java/logFiles/"+"log_"+sourceFiles.keySet().iterator().next().getName())); logFile.write("FC:\\" + finiteClosure.toString()+"\n"); for(SourceFile sf : this.sourceFiles.values()) { logFile.write(ASTTypePrinter.print(sf)); diff --git a/src/test/resources/javFiles/Faculty.jav b/src/test/resources/javFiles/Faculty.jav index ca539add..71f40515 100644 --- a/src/test/resources/javFiles/Faculty.jav +++ b/src/test/resources/javFiles/Faculty.jav @@ -5,7 +5,7 @@ class Faculty { Integer mul(Integer x, Integer y) { return x; } - + m () { var fact = (Integer x) -> { return mul(x, fact.apply(x));