forked from JavaTX/JavaCompilerCore
modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified: src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
This commit is contained in:
parent
a04316f629
commit
2f37bb7313
@ -76,7 +76,7 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<MethodConstraint> methodConstraints5 = methodTypesWithoutClassTypes(cs_cl, cs_m);
|
List<MethodConstraint> methodConstraints5 = methodTypesWithoutClassTypes(cs_cl, cs_m);
|
||||||
// cs_m = methodConstraints5;
|
cs_m = methodConstraints5;
|
||||||
return cs_m;
|
return cs_m;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,33 +253,32 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
*/
|
*/
|
||||||
public static List<MethodConstraint> methodTypesWithoutClassTypes(List<ClassConstraint> cs_cl, List<MethodConstraint> cs_m) {
|
public static List<MethodConstraint> methodTypesWithoutClassTypes(List<ClassConstraint> cs_cl, List<MethodConstraint> cs_m) {
|
||||||
//TODO:
|
//TODO:
|
||||||
/*List<MethodConstraint> tempMCToReturn = new ArrayList<>();
|
List<TPHConstraint> tempCC = new ArrayList<>();
|
||||||
List<TPHConstraint> tempMC = new ArrayList<TPHConstraint>();
|
for(ClassConstraint cc: cs_cl) {
|
||||||
for (int i=0; i < cs_m.size(); i++) {
|
TPHConstraint tphC = new TPHConstraint(cc.getLeft(), cc.getRight(), cc.getRel());
|
||||||
TPHConstraint tphC = (TPHConstraint) cs_m.get(i);
|
|
||||||
tempMC.add((TPHConstraint) tphC);
|
|
||||||
}
|
|
||||||
List<TPHConstraint> tempCC = new ArrayList<TPHConstraint>(cs_cl);
|
|
||||||
for (TPHConstraint cc: cs_cl) {
|
|
||||||
TPHConstraint tphC = TPHConstraint.class.cast(cc);
|
|
||||||
tempCC.add(tphC);
|
tempCC.add(tphC);
|
||||||
}
|
}
|
||||||
|
List<TPHConstraint> tempMC = new ArrayList<>();
|
||||||
|
for(MethodConstraint mc: cs_m) {
|
||||||
|
TPHConstraint tphC = new TPHConstraint(mc.getLeft(), mc.getRight(), mc.getRel());
|
||||||
|
tempMC.add(tphC);
|
||||||
|
}
|
||||||
|
List<TPHConstraint> tempMC2 = new ArrayList<>();
|
||||||
|
tempMC2.addAll(tempMC);
|
||||||
|
List<MethodConstraint> tempMCToReturn = new ArrayList<>();
|
||||||
|
|
||||||
for (TPHConstraint cc: tempCC) {
|
for(TPHConstraint cc: tempCC) {
|
||||||
if(tempMC.contains(cc)) {
|
for(TPHConstraint mc: tempMC) {
|
||||||
tempMC.remove(cc);
|
if(cc.getLeft().equals(mc.getLeft()) && cc.getRight().equals(mc.getRight())) {
|
||||||
|
tempMC2.remove(mc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tempMCToReturn = List.class.cast(tempMC);
|
for(TPHConstraint tphC: tempMC2) {
|
||||||
return tempMCToReturn;*/
|
MethodConstraint mCons = new MethodConstraint(tphC.getLeft(), tphC.getRight(), tphC.getRel());
|
||||||
|
tempMCToReturn.add(mCons);
|
||||||
List<MethodConstraint> tempMC = new ArrayList<>();
|
|
||||||
List<TPHConstraint> tempTphC = new ArrayList<>();
|
|
||||||
for(int i=0; i<cs_cl.size(); i++) {
|
|
||||||
TPHConstraint tphC = (TPHConstraint) cs_cl.get(i);
|
|
||||||
tempTphC.add(tphC);
|
|
||||||
}
|
}
|
||||||
return null;
|
return tempMCToReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean checkForDuplicates(TPHConstraint constraint, List list) {
|
public static boolean checkForDuplicates(TPHConstraint constraint, List list) {
|
||||||
|
@ -175,7 +175,7 @@ public class FamilyOfGeneratedGenericsTest extends TestCase {
|
|||||||
assertFalse(classConstraints.isEmpty());
|
assertFalse(classConstraints.isEmpty());
|
||||||
assertTrue(classConstraints.size() == 3);
|
assertTrue(classConstraints.size() == 3);
|
||||||
assertFalse(methodConstraints.isEmpty());
|
assertFalse(methodConstraints.isEmpty());
|
||||||
assertTrue(methodConstraints.size()==11);
|
assertTrue(methodConstraints.size()==9);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user