Search in sources :

Example 1 with CompilationUnitRange

use of org.eclipse.jdt.internal.corext.refactoring.typeconstraints.CompilationUnitRange in project che by eclipse.

the class InferTypeArgumentsTCModel method makeTypeVariable.

public TypeVariable2 makeTypeVariable(Type type) {
    ICompilationUnit cu = RefactoringASTParser.getCompilationUnit(type);
    TType ttype = getBoxedType(type.resolveBinding(), /*no boxing*/
    null);
    if (ttype == null)
        return null;
    CompilationUnitRange range = new CompilationUnitRange(cu, type);
    TypeVariable2 typeVariable = new TypeVariable2(ttype, range);
    TypeVariable2 storedCv = (TypeVariable2) storedCv(typeVariable);
    if (storedCv == typeVariable) {
        fCuScopedConstraintVariables.add(storedCv);
        if (isAGenericType(ttype))
            makeElementVariables(storedCv, ttype);
        makeArrayElementVariable(storedCv);
        if (fStoreToString)
            storedCv.setData(ConstraintVariable2.TO_STRING, type.toString());
    }
    return storedCv;
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnitRange(org.eclipse.jdt.internal.corext.refactoring.typeconstraints.CompilationUnitRange) ArrayTypeVariable2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ArrayTypeVariable2) ParameterTypeVariable2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ParameterTypeVariable2) ImmutableTypeVariable2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ImmutableTypeVariable2) TypeVariable2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TypeVariable2) IndependentTypeVariable2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.IndependentTypeVariable2) ParameterizedTypeVariable2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ParameterizedTypeVariable2) ReturnTypeVariable2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ReturnTypeVariable2) TType(org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType)

Example 2 with CompilationUnitRange

use of org.eclipse.jdt.internal.corext.refactoring.typeconstraints.CompilationUnitRange in project che by eclipse.

the class InferTypeArgumentsTCModel method makeCastVariable.

public CastVariable2 makeCastVariable(CastExpression castExpression, ConstraintVariable2 expressionCv) {
    ITypeBinding typeBinding = castExpression.resolveTypeBinding();
    ICompilationUnit cu = RefactoringASTParser.getCompilationUnit(castExpression);
    CompilationUnitRange range = new CompilationUnitRange(cu, castExpression);
    CastVariable2 castCv = new CastVariable2(createTType(typeBinding), range, expressionCv);
    fCastVariables.add(castCv);
    return castCv;
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) CompilationUnitRange(org.eclipse.jdt.internal.corext.refactoring.typeconstraints.CompilationUnitRange) CastVariable2(org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.CastVariable2) ITypeBinding(org.eclipse.jdt.core.dom.ITypeBinding)

Aggregations

ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)2 CompilationUnitRange (org.eclipse.jdt.internal.corext.refactoring.typeconstraints.CompilationUnitRange)2 ITypeBinding (org.eclipse.jdt.core.dom.ITypeBinding)1 TType (org.eclipse.jdt.internal.corext.refactoring.typeconstraints.types.TType)1 ArrayTypeVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ArrayTypeVariable2)1 CastVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.CastVariable2)1 ImmutableTypeVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ImmutableTypeVariable2)1 IndependentTypeVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.IndependentTypeVariable2)1 ParameterTypeVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ParameterTypeVariable2)1 ParameterizedTypeVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ParameterizedTypeVariable2)1 ReturnTypeVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.ReturnTypeVariable2)1 TypeVariable2 (org.eclipse.jdt.internal.corext.refactoring.typeconstraints2.TypeVariable2)1