modified: ../../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java

Throwable wieder in Exception zurückgewandelt

	modified:   ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
Log-Files um Name des jeweiligen Jav-Files ergaenzt

	modified:   ../../javFiles/Faculty.jav
This commit is contained in:
Martin Plümicke 2018-12-30 19:02:40 +01:00
parent 531b484c53
commit 013539e7e8
3 changed files with 8 additions and 5 deletions

View File

@ -830,7 +830,8 @@ public class BytecodeGenMethod implements StatementVisitor {
} }
methodRefl = getMethod(methodCall.name,methodCall.arglist.getArguments().size(),methCallType, typesOfParams,methods); methodRefl = getMethod(methodCall.name,methodCall.arglist.getArguments().size(),methCallType, typesOfParams,methods);
} }
catch (Throwable e2) { catch (Exception e2) {
System.out.println("");
//do nothing //do nothing
} }
} }

View File

@ -104,6 +104,7 @@ public class JavaTXCompiler {
return new ArrayList<>(allClasses); return new ArrayList<>(allClasses);
} }
/*
public List<ResultSet> typeInferenceOld() throws ClassNotFoundException { public List<ResultSet> typeInferenceOld() throws ClassNotFoundException {
List<ClassOrInterface> allClasses = new ArrayList<>();//environment.getAllAvailableClasses(); List<ClassOrInterface> allClasses = new ArrayList<>();//environment.getAllAvailableClasses();
//Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC //Alle Importierten Klassen in allen geparsten Sourcefiles kommen ins FC
@ -226,12 +227,13 @@ public class JavaTXCompiler {
return results.stream().map((unifyPairs -> return results.stream().map((unifyPairs ->
new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList()); new ResultSet(UnifyTypeFactory.convert(unifyPairs, generateTPHMap(cons))))).collect(Collectors.toList());
} }
*/
/** /**
* Vererbt alle Variancen bei Paaren (a <. theta) oder (Theta <. a) * Vererbt alle Variancen bei Paaren (a <. theta) oder (Theta <. a)
* wenn a eine Variance !=0 hat auf alle Typvariablen in Theta. * wenn a eine Variance !=0 hat auf alle Typvariablen in Theta.
* @param eq The set of constraints * @param eq The set of constraints
*/ */
/*
private void varianceInheritance(Set<UnifyPair> eq) { private void varianceInheritance(Set<UnifyPair> eq) {
Set<PlaceholderType> usedTPH = new HashSet<>(); Set<PlaceholderType> usedTPH = new HashSet<>();
Set<PlaceholderType> phSet = eq.stream().map(x -> { Set<PlaceholderType> phSet = eq.stream().map(x -> {
@ -258,7 +260,7 @@ public class JavaTXCompiler {
phSetVariance.removeIf(x -> (x.getVariance() == 0 || usedTPH.contains(x))); phSetVariance.removeIf(x -> (x.getVariance() == 0 || usedTPH.contains(x)));
} }
} }
*/
public List<ResultSet> typeInference() throws ClassNotFoundException { public List<ResultSet> typeInference() throws ClassNotFoundException {
@ -278,7 +280,7 @@ public class JavaTXCompiler {
TypeUnify unify = new TypeUnify(); TypeUnify unify = new TypeUnify();
Set<Set<UnifyPair>> results = new HashSet<>(); Set<Set<UnifyPair>> results = new HashSet<>();
try { 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"); logFile.write("FC:\\" + finiteClosure.toString()+"\n");
for(SourceFile sf : this.sourceFiles.values()) { for(SourceFile sf : this.sourceFiles.values()) {
logFile.write(ASTTypePrinter.print(sf)); logFile.write(ASTTypePrinter.print(sf));

View File

@ -5,7 +5,7 @@ class Faculty {
Integer mul(Integer x, Integer y) { Integer mul(Integer x, Integer y) {
return x; return x;
} }
m () { m () {
var fact = (Integer x) -> { var fact = (Integer x) -> {
return mul(x, fact.apply(x)); return mul(x, fact.apply(x));