use of org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TypeEquivalenceSet in project che by eclipse.
the class InferTypeArgumentsConstraintsSolver method getChosenType.
public static TType getChosenType(ConstraintVariable2 cv) {
TType type = (TType) cv.getData(CHOSEN_TYPE);
if (type != null)
return type;
TypeEquivalenceSet set = cv.getTypeEquivalenceSet();
if (set == null) {
//TODO: should not have to set this here. Clean up when caching chosen type
return null;
// // no representative == no restriction
// set= new TypeEquivalenceSet(cv);
// set.setTypeEstimate(TypeUniverseSet.create());
// cv.setTypeEquivalenceSet(set);
}
return cv.getTypeEstimate().chooseSingleType();
}
use of org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TypeEquivalenceSet in project che by eclipse.
the class ParametricStructureComputer method computeContainerStructure.
private void computeContainerStructure() {
if (DEBUG_INITIALIZATION)
//$NON-NLS-1$
System.out.println("\n*** Computing Container Structure ***\n");
initializeContainerStructure();
if (DEBUG_INITIALIZATION)
dumpContainerStructure();
while (!fWorkList2.isEmpty()) {
ConstraintVariable2 v = fWorkList2.pop();
List<ITypeConstraint2> usedIn = fTCModel.getUsedIn(v);
for (Iterator<ITypeConstraint2> iter = usedIn.iterator(); iter.hasNext(); ) {
SubTypeConstraint2 stc = (SubTypeConstraint2) iter.next();
ConstraintVariable2 lhs = stc.getLeft();
ConstraintVariable2 rhs = stc.getRight();
unifyContainerStructure(lhs, rhs);
}
TypeEquivalenceSet typeEquivalenceSet = v.getTypeEquivalenceSet();
if (typeEquivalenceSet != null) {
ConstraintVariable2[] contributingVariables = typeEquivalenceSet.getContributingVariables();
for (int i = 0; i + 1 < contributingVariables.length; i++) {
ConstraintVariable2 first = contributingVariables[i];
ConstraintVariable2 second = contributingVariables[i + 1];
unifyContainerStructure(first, second);
}
}
}
if (DEBUG_INITIALIZATION)
dumpContainerStructure();
}
Aggregations