Search in sources :

Example 6 with ITypeConstraint2

use of org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ITypeConstraint2 in project che by eclipse.

the class InferTypeArgumentsTCModel method createSubtypeConstraint.

public void createSubtypeConstraint(ConstraintVariable2 cv1, ConstraintVariable2 cv2) {
    if (!keep(cv1, cv2))
        return;
    ConstraintVariable2 storedCv1 = storedCv(cv1);
    ConstraintVariable2 storedCv2 = storedCv(cv2);
    ITypeConstraint2 typeConstraint = new SubTypeConstraint2(storedCv1, storedCv2);
    Object storedTc = fTypeConstraints.get(typeConstraint);
    if (storedTc == null) {
        fTypeConstraints.put(typeConstraint, typeConstraint);
    } else {
        typeConstraint = (ITypeConstraint2) storedTc;
    }
    registerCvWithTc(storedCv1, typeConstraint);
    registerCvWithTc(storedCv2, typeConstraint);
}
Also used : ConstraintVariable2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ConstraintVariable2) ITypeConstraint2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ITypeConstraint2) SubTypeConstraint2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.SubTypeConstraint2)

Aggregations

ConstraintVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ConstraintVariable2)5 ITypeConstraint2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ITypeConstraint2)5 TypeEquivalenceSet (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TypeEquivalenceSet)3 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)2 SubTypeConstraint2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.SubTypeConstraint2)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 SubProgressMonitor (org.eclipse.core.runtime.SubProgressMonitor)1 EnumeratedTypeSet (org.eclipse.jdt.internal.corext.refactoring.typeconstraints.typesets.EnumeratedTypeSet)1 SingletonTypeSet (org.eclipse.jdt.internal.corext.refactoring.typeconstraints.typesets.SingletonTypeSet)1 TypeSet (org.eclipse.jdt.internal.corext.refactoring.typeconstraints.typesets.TypeSet)1 TypeSetEnvironment (org.eclipse.jdt.internal.corext.refactoring.typeconstraints.typesets.TypeSetEnvironment)1 CollectionElementVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.CollectionElementVariable2)1