From 013539e7e8ef8f9d77d28a2f0ce308c8b14fdc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Sun, 30 Dec 2018 19:02:40 +0100 Subject: [PATCH] =?UTF-8?q?=09modified:=20=20=20../../../../main/java/de/d?= =?UTF-8?q?hbwstuttgart/bytecode/BytecodeGenMethod.java=20Throwable=20wied?= =?UTF-8?q?er=20in=20Exception=20zur=C3=BCckgewandelt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit modified: ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java Log-Files um Name des jeweiligen Jav-Files ergaenzt modified: ../../javFiles/Faculty.jav --- .../java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java | 3 ++- src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java | 8 +++++--- src/test/resources/javFiles/Faculty.jav | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) 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));