forked from JavaTX/JavaCompilerCore
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
|
//Alle minimalen Elemente in nextSetasListRest bestimmen
|
||||||
|
writeLog("nextSetasListRest davor: " + nextSetasListRest);
|
||||||
List<Set<UnifyPair>> minElementsTest = oup.minElements(nextSetasListRest);
|
List<Set<UnifyPair>> minElementsTest = oup.minElements(nextSetasListRest);
|
||||||
List<Set<UnifyPair>> nextSetasListRestTest;
|
List<Set<UnifyPair>> nextSetasListRestTest;
|
||||||
do {
|
do {
|
||||||
@ -777,7 +778,9 @@ public class TypeUnifyTask extends RecursiveTask<Set<Set<UnifyPair>>> {
|
|||||||
|
|
||||||
}}
|
}}
|
||||||
} while(!nextSetasListRestTest.equals(nextSetasListRest));
|
} 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) {
|
else if (variance == 2) {
|
||||||
a = nextSetasList.remove(0);
|
a = nextSetasList.remove(0);
|
||||||
|
@ -37,20 +37,24 @@ public class InheritTest {
|
|||||||
private static Object instanceOfClass;
|
private static Object instanceOfClass;
|
||||||
private static Object instanceOfClassAA, instanceOfClassBB, instanceOfClassCC, instanceOfClassDD;
|
private static Object instanceOfClassAA, instanceOfClassBB, instanceOfClassCC, instanceOfClassDD;
|
||||||
private static HashMap<ArrayList<String>, Method> hm = new HashMap<>();
|
private static HashMap<ArrayList<String>, Method> hm = new HashMap<>();
|
||||||
|
private static List<ResultSet> typeinferenceResult;
|
||||||
|
private static List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles;
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUpBeforeClass() throws Exception {
|
public static void setUpBeforeClass() throws Exception {
|
||||||
|
/*
|
||||||
path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/AA.jav";
|
path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/AA.jav";
|
||||||
fileToTest = new File(path);
|
fileToTest = new File(path);
|
||||||
compiler = new JavaTXCompiler(fileToTest);
|
compiler = new JavaTXCompiler(fileToTest);
|
||||||
List<ResultSet> typeinferenceResult = compiler.typeInference();
|
List<ResultSet> typeinferenceResult = compiler.typeInference();
|
||||||
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
|
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
|
||||||
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
|
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
|
||||||
|
*/
|
||||||
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
|
||||||
classToTestAA = loader.loadClass("AA");
|
classToTestAA = loader.loadClass("AA");
|
||||||
instanceOfClassAA = classToTestAA.getDeclaredConstructor().newInstance();
|
instanceOfClassAA = classToTestAA.getDeclaredConstructor().newInstance();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/BB.jav";
|
path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/BB.jav";
|
||||||
fileToTest = new File(path);
|
fileToTest = new File(path);
|
||||||
@ -143,7 +147,7 @@ public class InheritTest {
|
|||||||
classToTest = loader.loadClass("Inherit");
|
classToTest = loader.loadClass("Inherit");
|
||||||
Method m = classToTestAA.getDeclaredMethod("m", Integer.class);
|
Method m = classToTestAA.getDeclaredMethod("m", Integer.class);
|
||||||
assertEquals(m.invoke(instanceOfClassAA, 5), "AA");
|
assertEquals(m.invoke(instanceOfClassAA, 5), "AA");
|
||||||
classToTestAA = classToTest.getField("aafield").getType();
|
classToTestAA = classToTestAA.getField("aafield").getType();
|
||||||
Method main = classToTest.getDeclaredMethod("main", classToTestAA, Integer.class);
|
Method main = classToTest.getDeclaredMethod("main", classToTestAA, Integer.class);
|
||||||
assertEquals(main.invoke(instanceOfClass, instanceOfClassAA, 5), "AA");
|
assertEquals(main.invoke(instanceOfClass, instanceOfClassAA, 5), "AA");
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import java.lang.String;
|
|||||||
|
|
||||||
public class Inherit {
|
public class Inherit {
|
||||||
|
|
||||||
AA aafield;
|
//AA aafield;
|
||||||
//m(Integer i) { return "AA"; }
|
//m(Integer i) { return "AA"; }
|
||||||
|
|
||||||
main(d, i) {
|
main(d, i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user