forked from JavaTX/JavaCompilerCore
modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
This commit is contained in:
parent
8402d18f83
commit
486d7d9011
@ -15,16 +15,16 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
|
|
||||||
public static List<ClassConstraint> getClassConstraints(List<TPHConstraint> cs, HashMap<String, PositionFinder.Position> posOfTphs) { //Inputparameter List<TPHConstraint> constraintsSet weg
|
public static List<ClassConstraint> getClassConstraints(List<TPHConstraint> cs, HashMap<String, PositionFinder.Position> posOfTphs) { //Inputparameter List<TPHConstraint> constraintsSet weg
|
||||||
List<ClassConstraint> cs_cl = new ArrayList<>();
|
List<ClassConstraint> cs_cl = new ArrayList<>();
|
||||||
System.out.println("1: " + cs_cl);
|
System.out.println("0: " + cs_cl);
|
||||||
List<ClassConstraint> classConstraints1 = typeOfANodeOfAField(cs, cs_cl, posOfTphs);
|
List<ClassConstraint> classConstraints1 = typeOfANodeOfAField(cs, cs_cl, posOfTphs);
|
||||||
cs_cl.addAll(classConstraints1);
|
cs_cl.addAll(classConstraints1);
|
||||||
System.out.println("2: " + cs_cl);
|
System.out.println("1: " + cs_cl);
|
||||||
List<ClassConstraint> classConstraints2 = transitiveSubtypeForClassTypes(cs, cs_cl); // in Klammer classConstraints1 oder constraintsSet? beides eher
|
List<ClassConstraint> classConstraints2 = transitiveSubtypeForClassTypes(cs, cs_cl); // in Klammer classConstraints1 oder constraintsSet? beides eher
|
||||||
cs_cl.addAll(classConstraints2);
|
cs_cl.addAll(classConstraints2);
|
||||||
System.out.println("3: " + cs_cl);
|
System.out.println("2: " + cs_cl);
|
||||||
List<ClassConstraint> classConstraints3 = hasNoSupertypeForClassTypes(cs, cs_cl, posOfTphs);
|
List<ClassConstraint> classConstraints3 = hasNoSupertypeForClassTypes(cs, cs_cl, posOfTphs);
|
||||||
cs_cl.addAll(classConstraints3);
|
cs_cl.addAll(classConstraints3);
|
||||||
System.out.println("4: " + cs_cl);
|
System.out.println("3: " + cs_cl);
|
||||||
|
|
||||||
return cs_cl;
|
return cs_cl;
|
||||||
}
|
}
|
||||||
@ -44,12 +44,11 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
* {T < .T' | T is a type variable in a type of a node of a field}
|
* {T < .T' | T is a type variable in a type of a node of a field}
|
||||||
*/
|
*/
|
||||||
public static List<ClassConstraint> typeOfANodeOfAField(List<TPHConstraint> allConstraints, List<ClassConstraint> cs_cl, HashMap<String, PositionFinder.Position> posOfTphs) {
|
public static List<ClassConstraint> typeOfANodeOfAField(List<TPHConstraint> allConstraints, List<ClassConstraint> cs_cl, HashMap<String, PositionFinder.Position> posOfTphs) {
|
||||||
//TODO:
|
|
||||||
List<ClassConstraint> tempCC= new ArrayList<>();
|
List<ClassConstraint> tempCC= new ArrayList<>();
|
||||||
for(TPHConstraint allCons: allConstraints){
|
for(TPHConstraint allCons: allConstraints){
|
||||||
if(posOfTphs.containsKey(allCons.getLeft()) && allCons.getRight()!=null && allCons.getRel()==Relation.EXTENDS) {
|
if(posOfTphs.containsKey(allCons.getLeft()) && allCons.getRight()!=null && allCons.getRel()==Relation.EXTENDS) {
|
||||||
for(String tph: posOfTphs.keySet()) {
|
for(String tph: posOfTphs.keySet()) {
|
||||||
if(posOfTphs.get(tph) == PositionFinder.Position.FIELD) {
|
if(tph == allCons.getLeft() && posOfTphs.get(tph) == PositionFinder.Position.FIELD) {
|
||||||
tempCC.add(new ClassConstraint(allCons.getLeft(), allCons.getRight(), allCons.getRel()));
|
tempCC.add(new ClassConstraint(allCons.getLeft(), allCons.getRight(), allCons.getRel()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -87,9 +86,15 @@ public class FamilyOfGeneratedGenerics {
|
|||||||
List<ClassConstraint> tempCC= new ArrayList<>();
|
List<ClassConstraint> tempCC= new ArrayList<>();
|
||||||
for(TPHConstraint allCons: allConstraints) {
|
for(TPHConstraint allCons: allConstraints) {
|
||||||
for(ClassConstraint cCons: cs_cl) {
|
for(ClassConstraint cCons: cs_cl) {
|
||||||
if( (posOfTphs.containsKey(allCons.getLeft()) || cCons.getRight() != null)
|
for(String tph: posOfTphs.keySet()) {
|
||||||
&& allCons.getRight()== null && allCons.getRel()==Relation.EXTENDS && cCons.getRel()==Relation.EXTENDS) {
|
System.out.println("cCons: " + cCons);
|
||||||
tempCC.add(new ClassConstraint(allCons.getLeft(), "Object", Relation.EXTENDS));
|
if( (posOfTphs.get(tph) == PositionFinder.Position.FIELD) ||
|
||||||
|
(posOfTphs.containsKey(cCons.getLeft()) && cCons.getRight() != null) &&
|
||||||
|
allCons.getRight() == null &&
|
||||||
|
allCons.getRel()==Relation.EXTENDS && cCons.getRel()==Relation.EXTENDS) {
|
||||||
|
System.out.println("C3: " + allCons);
|
||||||
|
tempCC.add(new ClassConstraint(allCons.getLeft(), "Object", Relation.EXTENDS));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user