Changes to be committed:
modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java modified: src/test/java/bytecode/InheritTest.java modified: src/test/resources/bytecode/javFiles/Inherit.jav
This commit is contained in:
parent
60b182b9b1
commit
9240b0d163
@ -761,6 +761,7 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
}
|
||||
}
|
||||
//Alle minimalen Elemente in nextSetasListRest bestimmen
|
||||
writeLog("nextSetasListRest davor: " + nextSetasListRest);
|
||||
List<Set<UnifyPair>> minElementsTest = oup.minElements(nextSetasListRest);
|
||||
List<Set<UnifyPair>> nextSetasListRestTest;
|
||||
do {
|
||||
@ -777,7 +778,9 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
||||
|
||||
}}
|
||||
} 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);
|
||||
|
@ -37,20 +37,24 @@ public class InheritTest {
|
||||
private static Object instanceOfClass;
|
||||
private static Object instanceOfClassAA, instanceOfClassBB, instanceOfClassCC, instanceOfClassDD;
|
||||
private static HashMap<ArrayList<String>, Method> hm = new HashMap<>();
|
||||
private static List<ResultSet> typeinferenceResult;
|
||||
private static List<GenericGenratorResultForSourceFile> 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<ResultSet> typeinferenceResult = compiler.typeInference();
|
||||
List<GenericGenratorResultForSourceFile> 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");
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import java.lang.String;
|
||||
|
||||
public class Inherit {
|
||||
|
||||
AA aafield;
|
||||
//AA aafield;
|
||||
//m(Integer i) { return "AA"; }
|
||||
|
||||
main(d, i) {
|
||||
|
Loading…
Reference in New Issue
Block a user