public TypeBinding boxing(TypeBinding type) { if (type.isBaseType()) return environment().computeBoxingType(type); return type; }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType()) return environment().computeBoxingType(type); return type; }
@Override public TypeElement boxedClass(PrimitiveType p) { PrimitiveTypeImpl primitiveTypeImpl = (PrimitiveTypeImpl) p; BaseTypeBinding baseTypeBinding = (BaseTypeBinding)primitiveTypeImpl._binding; TypeBinding boxed = _env.getLookupEnvironment().computeBoxingType(baseTypeBinding); return (TypeElement) _env.getFactory().newElement(boxed); }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
@Override public TypeElement boxedClass(PrimitiveType p) { PrimitiveTypeImpl primitiveTypeImpl = (PrimitiveTypeImpl) p; BaseTypeBinding baseTypeBinding = (BaseTypeBinding)primitiveTypeImpl._binding; TypeBinding boxed = _env.getLookupEnvironment().computeBoxingType(baseTypeBinding); return (TypeElement) _env.getFactory().newElement(boxed); }
@Override public TypeElement boxedClass(PrimitiveType p) { PrimitiveTypeImpl primitiveTypeImpl = (PrimitiveTypeImpl) p; BaseTypeBinding baseTypeBinding = (BaseTypeBinding)primitiveTypeImpl._binding; TypeBinding boxed = _env.getLookupEnvironment().computeBoxingType(baseTypeBinding); return (TypeElement) _env.getFactory().newElement(boxed); }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
@Override public TypeElement boxedClass(PrimitiveType p) { PrimitiveTypeImpl primitiveTypeImpl = (PrimitiveTypeImpl) p; BaseTypeBinding baseTypeBinding = (BaseTypeBinding)primitiveTypeImpl._binding; TypeBinding boxed = _env.getLookupEnvironment().computeBoxingType(baseTypeBinding); return (TypeElement) _env.getFactory().newElement(boxed); }
private int parameterCompatibilityLevel(TypeBinding arg, TypeBinding param, LookupEnvironment env) { // only called if env.options.sourceLevel >= ClassFileConstants.JDK1_5 if (arg.isCompatibleWith(param)) return COMPATIBLE; if (arg.isBaseType() != param.isBaseType()) { TypeBinding convertedType = env.computeBoxingType(arg); if (convertedType == param || convertedType.isCompatibleWith(param)) return AUTOBOX_COMPATIBLE; } return NOT_COMPATIBLE; }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return TypeBinding.equalsEquals(convertedType, targetType) || convertedType.isCompatibleWith(targetType, this); }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return TypeBinding.equalsEquals(convertedType, targetType) || convertedType.isCompatibleWith(targetType, this); }
public boolean isBoxingCompatibleWith(TypeBinding expressionType, TypeBinding targetType) { LookupEnvironment environment = environment(); if (environment.globalOptions.sourceLevel < ClassFileConstants.JDK1_5 || expressionType.isBaseType() == targetType.isBaseType()) return false; // check if autoboxed type is compatible TypeBinding convertedType = environment.computeBoxingType(expressionType); return TypeBinding.equalsEquals(convertedType, targetType) || convertedType.isCompatibleWith(targetType, this); }
public boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) { if (scope.isBoxingCompatibleWith(expressionType, targetType)) return true; return expressionType.isBaseType() // narrowing then boxing ? Only allowed for some target types see 362279 && !targetType.isBaseType() && !targetType.isTypeVariable() && scope.compilerOptions().sourceLevel >= org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5 // autoboxing && (targetType.id == TypeIds.T_JavaLangByte || targetType.id == TypeIds.T_JavaLangShort || targetType.id == TypeIds.T_JavaLangCharacter) && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(targetType)); }
public boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) { if (scope.isBoxingCompatibleWith(expressionType, targetType)) return true; return expressionType.isBaseType() // narrowing then boxing ? Only allowed for some target types see 362279 && !targetType.isBaseType() && !targetType.isTypeVariable() && scope.compilerOptions().sourceLevel >= org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5 // autoboxing && (targetType.id == TypeIds.T_JavaLangByte || targetType.id == TypeIds.T_JavaLangShort || targetType.id == TypeIds.T_JavaLangCharacter) && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(targetType)); }
public boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) { if (scope.isBoxingCompatibleWith(expressionType, targetType)) return true; return expressionType.isBaseType() // narrowing then boxing ? Only allowed for some target types see 362279 && !targetType.isBaseType() && !targetType.isTypeVariable() && scope.compilerOptions().sourceLevel >= org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5 // autoboxing && (targetType.id == TypeIds.T_JavaLangByte || targetType.id == TypeIds.T_JavaLangShort || targetType.id == TypeIds.T_JavaLangCharacter) && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(targetType)); }
protected boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) { if (scope.isBoxingCompatibleWith(expressionType, targetType)) return true; return expressionType.isBaseType() // narrowing then boxing ? Only allowed for some target types see 362279 && !targetType.isBaseType() && !targetType.isTypeVariable() && scope.compilerOptions().sourceLevel >= org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5 // autoboxing && (targetType.id == TypeIds.T_JavaLangByte || targetType.id == TypeIds.T_JavaLangShort || targetType.id == TypeIds.T_JavaLangCharacter) && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(targetType)); }
public boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) { if (scope.isBoxingCompatibleWith(expressionType, targetType)) return true; return expressionType.isBaseType() // narrowing then boxing ? Only allowed for some target types see 362279 && !targetType.isBaseType() && !targetType.isTypeVariable() && scope.compilerOptions().sourceLevel >= org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5 // autoboxing && (targetType.id == TypeIds.T_JavaLangByte || targetType.id == TypeIds.T_JavaLangShort || targetType.id == TypeIds.T_JavaLangCharacter) && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(targetType)); }
protected boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) { if (scope.isBoxingCompatibleWith(expressionType, targetType)) return true; return expressionType.isBaseType() // narrowing then boxing ? && !targetType.isBaseType() && !targetType.isTypeVariable() && scope.compilerOptions().sourceLevel >= org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5 // autoboxing && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(targetType)); }
protected boolean isBoxingCompatible(TypeBinding expressionType, TypeBinding targetType, Expression expression, Scope scope) { if (scope.isBoxingCompatibleWith(expressionType, targetType)) return true; return expressionType.isBaseType() // narrowing then boxing ? && !targetType.isBaseType() && !targetType.isTypeVariable() && scope.compilerOptions().sourceLevel >= org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK1_5 // autoboxing && expression.isConstantValueOfTypeAssignableToType(expressionType, scope.environment().computeBoxingType(targetType)); }