forked from JavaTX/JavaCompilerCore
modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
This commit is contained in:
parent
cfacc6235c
commit
bb900af6bf
@ -35,19 +35,19 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
cs_cl.add(cons);
|
cs_cl.add(cons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boolean addedToConstraintsList = false;
|
|
||||||
do {
|
|
||||||
addedToConstraintsList = false;
|
|
||||||
List<ClassConstraint> classConstraints2 = new ArrayList<>();
|
|
||||||
classConstraints2 = transitiveSubtypeForClassTypes(cs, cs_cl); // in Klammer classConstraints1 oder constraintsSet? beides eher
|
|
||||||
|
|
||||||
|
// if sth new is added to cs_cl, then do same step again
|
||||||
|
boolean addedToConstraintsListForCC2 = false;
|
||||||
|
do {
|
||||||
|
addedToConstraintsListForCC2 = false;
|
||||||
|
List<ClassConstraint> classConstraints2 = transitiveSubtypeForClassTypes(cs, cs_cl); // in Klammer classConstraints1 oder constraintsSet? beides eher
|
||||||
for (ClassConstraint cons: classConstraints2) {
|
for (ClassConstraint cons: classConstraints2) {
|
||||||
if (!checkForDuplicates(cons, cs_cl)) {
|
if (!checkForDuplicates(cons, cs_cl)) {
|
||||||
cs_cl.add(cons);
|
cs_cl.add(cons);
|
||||||
addedToConstraintsList = true;
|
addedToConstraintsListForCC2 = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}while(addedToConstraintsList);
|
} while (addedToConstraintsListForCC2);
|
||||||
|
|
||||||
List<ClassConstraint> classConstraints3 = hasNoSupertypeForClassTypes(cs, cs_cl, posOfTphs);
|
List<ClassConstraint> classConstraints3 = hasNoSupertypeForClassTypes(cs, cs_cl, posOfTphs);
|
||||||
for (ClassConstraint cons: classConstraints3) {
|
for (ClassConstraint cons: classConstraints3) {
|
||||||
@ -59,7 +59,6 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<MethodConstraint> getMethodConstraints(List<TPHConstraint> cs, List<ClassConstraint> cs_cl, HashMap<String, PairTphMethod<PositionFinder.Position, String>> posOfTphs) {
|
public static List<MethodConstraint> getMethodConstraints(List<TPHConstraint> cs, List<ClassConstraint> cs_cl, HashMap<String, PairTphMethod<PositionFinder.Position, String>> posOfTphs) {
|
||||||
//TODO: Regeln
|
|
||||||
List<MethodConstraint> cs_m = new ArrayList<>();
|
List<MethodConstraint> cs_m = new ArrayList<>();
|
||||||
List<MethodConstraint> methodConstraints1 = typeOfTheMethodInClSigma(cs, posOfTphs);
|
List<MethodConstraint> methodConstraints1 = typeOfTheMethodInClSigma(cs, posOfTphs);
|
||||||
for (MethodConstraint cons: methodConstraints1) {
|
for (MethodConstraint cons: methodConstraints1) {
|
||||||
@ -67,18 +66,32 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
cs_m.add(cons);
|
cs_m.add(cons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<MethodConstraint> methodConstraints2 = firstTransitiveSubtypeForMethodTypes(cs, cs_m);
|
|
||||||
for (MethodConstraint cons: methodConstraints2) {
|
// if sth new is added to cs_cl, then do same step again
|
||||||
if (!checkForDuplicates(cons, cs_m)) {
|
boolean addedToConstraintsListForMC2 = false;
|
||||||
cs_m.add(cons);
|
do {
|
||||||
|
addedToConstraintsListForMC2 = false;
|
||||||
|
List<MethodConstraint> methodConstraints2 = firstTransitiveSubtypeForMethodTypes(cs, cs_m);
|
||||||
|
for (MethodConstraint cons : methodConstraints2) {
|
||||||
|
if (!checkForDuplicates(cons, cs_m)) {
|
||||||
|
cs_m.add(cons);
|
||||||
|
addedToConstraintsListForMC2 = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} while (addedToConstraintsListForMC2);
|
||||||
List<MethodConstraint> methodConstraints3 = secondTransitiveSubtypeForMethodTypes(cs, cs_cl, cs_m);
|
|
||||||
for (MethodConstraint cons: methodConstraints3) {
|
// if sth new is added to cs_cl, then do same step again
|
||||||
if (!checkForDuplicates(cons, cs_m)) {
|
boolean addedToConstraintsListForMC3 = false;
|
||||||
cs_m.add(cons);
|
do {
|
||||||
|
addedToConstraintsListForMC3 = false;
|
||||||
|
List<MethodConstraint> methodConstraints3 = secondTransitiveSubtypeForMethodTypes(cs, cs_cl, cs_m);
|
||||||
|
for (MethodConstraint cons : methodConstraints3) {
|
||||||
|
if (!checkForDuplicates(cons, cs_m)) {
|
||||||
|
cs_m.add(cons);
|
||||||
|
addedToConstraintsListForMC3 = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
} while (addedToConstraintsListForMC3);
|
||||||
List<MethodConstraint> methodConstraints4 = hasNoSupertypeForMethodTypes(cs, posOfTphs);
|
List<MethodConstraint> methodConstraints4 = hasNoSupertypeForMethodTypes(cs, posOfTphs);
|
||||||
for (MethodConstraint cons: methodConstraints4) {
|
for (MethodConstraint cons: methodConstraints4) {
|
||||||
if (!checkForDuplicates(cons, cs_m)) {
|
if (!checkForDuplicates(cons, cs_m)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user