@Override public final boolean isCompatibleWith(TypeBinding right, Scope captureScope) { if (equalsEquals(this, right)) return true; int right2left = this.id + (right.id<<4); if (right2left >= 0 && right2left < MAX_CONVERSIONS && (CONVERSIONS[right2left] & (IDENTITY|WIDENING)) != 0) return true; return this == TypeBinding.NULL && !right.isBaseType(); }
@Override public boolean sIsMoreSpecific(TypeBinding s, TypeBinding t, Scope scope) { if (super.sIsMoreSpecific(s, t, scope)) return true; return isPolyExpression() ? !s.isBaseType() && t.isBaseType() : false; }
public final boolean isCompatibleWith(TypeBinding right, Scope captureScope) { if (equalsEquals(this, right)) return true; int right2left = this.id + (right.id<<4); if (right2left >= 0 && right2left < MAX_CONVERSIONS && (CONVERSIONS[right2left] & (IDENTITY|WIDENING)) != 0) return true; return this == TypeBinding.NULL && !right.isBaseType(); }
public final boolean isCompatibleWith(TypeBinding right, Scope captureScope) { if (equalsEquals(this, right)) return true; int right2left = this.id + (right.id<<4); if (right2left >= 0 && right2left < MAX_CONVERSIONS && (CONVERSIONS[right2left] & (IDENTITY|WIDENING)) != 0) return true; return this == TypeBinding.NULL && !right.isBaseType(); }
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 void autoboxing(Expression expression, TypeBinding originalType, TypeBinding convertedType) { if (this.options.getSeverity(CompilerOptions.AutoBoxing) == ProblemSeverities.Ignore) return; this.handle( originalType.isBaseType() ? IProblem.BoxingConversion : IProblem.UnboxingConversion, new String[] { new String(originalType.readableName()), new String(convertedType.readableName()), }, new String[] { new String(originalType.shortReadableName()), new String(convertedType.shortReadableName()), }, expression.sourceStart, expression.sourceEnd); } public void boundCannotBeArray(ASTNode location, TypeBinding type) {
public void autoboxing(Expression expression, TypeBinding originalType, TypeBinding convertedType) { if (this.options.getSeverity(CompilerOptions.AutoBoxing) == ProblemSeverities.Ignore) return; this.handle( originalType.isBaseType() ? IProblem.BoxingConversion : IProblem.UnboxingConversion, new String[] { new String(originalType.readableName()), new String(convertedType.readableName()), }, new String[] { new String(originalType.shortReadableName()), new String(convertedType.shortReadableName()), }, expression.sourceStart, expression.sourceEnd); } public void boundCannotBeArray(ASTNode location, TypeBinding type) {
public void autoboxing(Expression expression, TypeBinding originalType, TypeBinding convertedType) { if (this.options.getSeverity(CompilerOptions.AutoBoxing) == ProblemSeverities.Ignore) return; this.handle( originalType.isBaseType() ? IProblem.BoxingConversion : IProblem.UnboxingConversion, new String[] { new String(originalType.readableName()), new String(convertedType.readableName()), }, new String[] { new String(originalType.shortReadableName()), new String(convertedType.shortReadableName()), }, expression.sourceStart, expression.sourceEnd); } public void boundCannotBeArray(ASTNode location, TypeBinding type) {
public void autoboxing(Expression expression, TypeBinding originalType, TypeBinding convertedType) { if (this.options.getSeverity(CompilerOptions.AutoBoxing) == ProblemSeverities.Ignore) return; this.handle( originalType.isBaseType() ? IProblem.BoxingConversion : IProblem.UnboxingConversion, new String[] { new String(originalType.readableName()), new String(convertedType.readableName()), }, new String[] { new String(originalType.shortReadableName()), new String(convertedType.shortReadableName()), }, expression.sourceStart, expression.sourceEnd); } public void boundCannotBeArray(ASTNode location, TypeBinding type) {
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
void applyReturnNullBits(MethodBinding method, long nullnessBits) { if (this.environment.usesNullTypeAnnotations()) { if (!method.returnType.isBaseType()) { method.returnType = this.environment.createAnnotatedType(method.returnType, this.environment.nullAnnotationsFromTagBits(nullnessBits)); } } else { method.tagBits |= nullnessBits; } }
public TypeBinding boxing(TypeBinding type) { if (type.isBaseType() || type.kind() == Binding.POLY_TYPE) return environment().computeBoxingType(type); return type; }
void applyReturnNullBits(MethodBinding method, long nullnessBits) { if (this.environment.usesNullTypeAnnotations()) { if (!method.returnType.isBaseType()) { method.returnType = this.environment.createAnnotatedType(method.returnType, this.environment.nullAnnotationsFromTagBits(nullnessBits)); } } else { method.tagBits |= nullnessBits; } }
protected void checkIllegalNullAnnotation(Scope scope) { if (this.resolvedType.leafComponentType().isBaseType() && hasNullTypeAnnotation(AnnotationPosition.LEAF_TYPE)) scope.problemReporter().illegalAnnotationForBaseType(this, this.annotations[0], this.resolvedType.tagBits & TagBits.AnnotationNullMASK); } /** Retrieve the null annotation that has been translated to the given nullTagBits. */
protected void checkIllegalNullAnnotation(Scope scope) { if (this.resolvedType.leafComponentType().isBaseType() && hasNullTypeAnnotation(AnnotationPosition.LEAF_TYPE)) scope.problemReporter().illegalAnnotationForBaseType(this, this.annotations[0], this.resolvedType.tagBits & TagBits.AnnotationNullMASK); } /** Retrieve the null annotation that has been translated to the given nullTagBits. */
public void generateEmulatedReadAccessForField(FieldBinding fieldBinding) { generateEmulationForField(fieldBinding); // swap the field with the receiver this.swap(); invokeJavaLangReflectFieldGetter(fieldBinding.type.id); if (!fieldBinding.type.isBaseType()) { this.checkcast(fieldBinding.type); } }
public void generateEmulatedReadAccessForField(FieldBinding fieldBinding) { generateEmulationForField(fieldBinding); // swap the field with the receiver this.swap(); invokeJavaLangReflectFieldGetter(fieldBinding.type.id); if (!fieldBinding.type.isBaseType()) { this.checkcast(fieldBinding.type); } }