diff --git a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java index 2d63eafd..d350077a 100644 --- a/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java +++ b/src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java @@ -761,6 +761,7 @@ public class TypeUnifyTask extends RecursiveTask>> { } } //Alle minimalen Elemente in nextSetasListRest bestimmen + writeLog("nextSetasListRest davor: " + nextSetasListRest); List> minElementsTest = oup.minElements(nextSetasListRest); List> nextSetasListRestTest; do { @@ -777,7 +778,9 @@ public class TypeUnifyTask extends RecursiveTask>> { }} } while(!nextSetasListRestTest.equals(nextSetasListRest)); - writeLog("minElementsTest: " + minElementsTest.equals(nextSetasListRest)); + writeLog("minElementsTest Vergleich: " + minElementsTest.equals(nextSetasListRest)); + writeLog("minElementsTest danach: " + minElementsTest); + writeLog("nextSetasListRest danach: " + nextSetasListRest); } else if (variance == 2) { a = nextSetasList.remove(0); diff --git a/src/test/java/bytecode/InheritTest.java b/src/test/java/bytecode/InheritTest.java index 77fcb9a1..2373d40d 100644 --- a/src/test/java/bytecode/InheritTest.java +++ b/src/test/java/bytecode/InheritTest.java @@ -37,20 +37,24 @@ public class InheritTest { private static Object instanceOfClass; private static Object instanceOfClassAA, instanceOfClassBB, instanceOfClassCC, instanceOfClassDD; private static HashMap, Method> hm = new HashMap<>(); + private static List typeinferenceResult; + private static List simplifyResultsForAllSourceFiles; @BeforeClass public static void setUpBeforeClass() throws Exception { - + /* path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/AA.jav"; fileToTest = new File(path); compiler = new JavaTXCompiler(fileToTest); List typeinferenceResult = compiler.typeInference(); List simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult); compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles); + */ loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)}); classToTestAA = loader.loadClass("AA"); instanceOfClassAA = classToTestAA.getDeclaredConstructor().newInstance(); + /* path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/BB.jav"; fileToTest = new File(path); @@ -143,7 +147,7 @@ public class InheritTest { classToTest = loader.loadClass("Inherit"); Method m = classToTestAA.getDeclaredMethod("m", Integer.class); assertEquals(m.invoke(instanceOfClassAA, 5), "AA"); - classToTestAA = classToTest.getField("aafield").getType(); + classToTestAA = classToTestAA.getField("aafield").getType(); Method main = classToTest.getDeclaredMethod("main", classToTestAA, Integer.class); assertEquals(main.invoke(instanceOfClass, instanceOfClassAA, 5), "AA"); } diff --git a/src/test/resources/bytecode/javFiles/Inherit.jav b/src/test/resources/bytecode/javFiles/Inherit.jav index 0dd5ddcc..11ca65d3 100644 --- a/src/test/resources/bytecode/javFiles/Inherit.jav +++ b/src/test/resources/bytecode/javFiles/Inherit.jav @@ -6,7 +6,7 @@ import java.lang.String; public class Inherit { -AA aafield; +//AA aafield; //m(Integer i) { return "AA"; } main(d, i) {