modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/ClassConstraint.java

modified:   src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
This commit is contained in:
AluAli 2020-10-30 09:41:09 +01:00
parent c86fe95da5
commit 0ecd3916f8
2 changed files with 9 additions and 6 deletions

View File

@ -3,7 +3,13 @@ package de.dhbwstuttgart.bytecode.gGenericsAli;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint; import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
public class ClassConstraint extends TPHConstraint { public class ClassConstraint extends TPHConstraint {
private TPHConstraint constraint;
public ClassConstraint(String left, String right, Relation rel) { public ClassConstraint(String left, String right, Relation rel) {
super(left, right, rel); super(left, right, rel);
} }
//besser?
/*public ClassConstraint(TPHConstraint constraint) {
this.constraint = constraint;
}*/
} }

View File

@ -47,14 +47,10 @@ public class FamilyOfGeneratedGenerics {
public List<ClassConstraint> typeOfANodeOfAField(List<TPHConstraint> cs) { public List<ClassConstraint> typeOfANodeOfAField(List<TPHConstraint> cs) {
//TODO: //TODO:
for(TPHConstraint cons: cs){ for(TPHConstraint cons: cs){
System.out.println(cons);
System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
if(cons.getRight()!=null && cons.getRel()==Relation.EXTENDS) { if(cons.getRight()!=null && cons.getRel()==Relation.EXTENDS) {
cs_cl.add(new ClassConstraint(cons.getLeft(), cons.getRight(),cons.getRel())); cs_cl.add(new ClassConstraint(cons.getLeft(), cons.getRight(),cons.getRel()));
} }
} }
System.out.println(cs_cl);
System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
return cs_cl; return cs_cl;
} }
@ -65,13 +61,14 @@ public class FamilyOfGeneratedGenerics {
public List<ClassConstraint> transitiveSubtypeForClassTypes(List<TPHConstraint> allConstraints, List<ClassConstraint> classConstraints) { public List<ClassConstraint> transitiveSubtypeForClassTypes(List<TPHConstraint> allConstraints, List<ClassConstraint> classConstraints) {
//TODO: //TODO:
for(ClassConstraint cCons: classConstraints) { for(ClassConstraint cCons: classConstraints) {
for(TPHConstraint allCons: allConstraints) for(TPHConstraint allCons: allConstraints) {
// if(tphExtractor.containsConstraint(allConstraints, cCons)) { // if(tphExtractor.containsConstraint(allConstraints, cCons)) {
// } // }
if(cCons.getRight() == allCons.getLeft()){ if(cCons.getRight() == allCons.getLeft()){
} }
} }
}
return cs_cl; return cs_cl;
} }