/** * int -> I */ @Override public char[] computeUniqueKey(boolean isLeaf) { return constantPoolName(); }
public boolean isConstantValueOfTypeAssignableToType(TypeBinding constantType, TypeBinding targetType) { if (this.constant == Constant.NotAConstant) return false; if (constantType == targetType) return true; //No free assignment conversion from anything but to integral ones. if (BaseTypeBinding.isWidening(TypeIds.T_int, constantType.id) && (BaseTypeBinding.isNarrowing(targetType.id, TypeIds.T_int))) { //use current explicit conversion in order to get some new value to compare with current one return isConstantValueRepresentable(this.constant, constantType.id, targetType.id); } return false; }
@Override public TypeBinding clone(TypeBinding enclosingType) { return new BaseTypeBinding(this.id, this.simpleName, this.constantPoolName); }
@Override public String toString() { return this.hasTypeAnnotations() ? annotatedDebugName() : new String(readableName()); } }
if (isConstructor && this.declaringClass.isEnum()) { // insert String name,int ordinal buffer.append(ConstantPool.JavaLangStringSignature); buffer.append(TypeBinding.INT.signature());
if (BaseTypeBinding.isNarrowing(valueIfTrueType.id, T_int) && BaseTypeBinding.isNarrowing(valueIfFalseType.id, T_int)) { this.valueIfTrue.computeConversion(scope, TypeBinding.INT, originalValueIfTrueType); this.valueIfFalse.computeConversion(scope, TypeBinding.INT, originalValueIfFalseType); if (BaseTypeBinding.isNarrowing(valueIfTrueType.id, T_long) && BaseTypeBinding.isNarrowing(valueIfFalseType.id, T_long)) { this.valueIfTrue.computeConversion(scope, TypeBinding.LONG, originalValueIfTrueType); this.valueIfFalse.computeConversion(scope, TypeBinding.LONG, originalValueIfFalseType); if (BaseTypeBinding.isNarrowing(valueIfTrueType.id, T_float) && BaseTypeBinding.isNarrowing(valueIfFalseType.id, T_float)) { this.valueIfTrue.computeConversion(scope, TypeBinding.FLOAT, originalValueIfTrueType); this.valueIfFalse.computeConversion(scope, TypeBinding.FLOAT, originalValueIfFalseType);
@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(); }
public TypeBinding unannotated() { if (!this.hasTypeAnnotations()) return this; switch (this.id) { case TypeIds.T_boolean: return TypeBinding.BOOLEAN; case TypeIds.T_byte: return TypeBinding.BYTE; case TypeIds.T_char: return TypeBinding.CHAR; case TypeIds.T_double: return TypeBinding.DOUBLE; case TypeIds.T_float: return TypeBinding.FLOAT; case TypeIds.T_int: return TypeBinding.INT; case TypeIds.T_long: return TypeBinding.LONG; case TypeIds.T_short: return TypeBinding.SHORT; default: throw new IllegalStateException(); } } /**
public String toString() { return this.hasTypeAnnotations() ? annotatedDebugName() : new String(readableName()); } }
if (isConstructor && this.declaringClass.isEnum()) { // insert String name,int ordinal buffer.append(ConstantPool.JavaLangStringSignature); buffer.append(TypeBinding.INT.signature());
if (BaseTypeBinding.isNarrowing(valueIfTrueType.id, T_int) && BaseTypeBinding.isNarrowing(valueIfFalseType.id, T_int)) { this.valueIfTrue.computeConversion(scope, TypeBinding.INT, originalValueIfTrueType); this.valueIfFalse.computeConversion(scope, TypeBinding.INT, originalValueIfFalseType); if (BaseTypeBinding.isNarrowing(valueIfTrueType.id, T_long) && BaseTypeBinding.isNarrowing(valueIfFalseType.id, T_long)) { this.valueIfTrue.computeConversion(scope, TypeBinding.LONG, originalValueIfTrueType); this.valueIfFalse.computeConversion(scope, TypeBinding.LONG, originalValueIfFalseType); if (BaseTypeBinding.isNarrowing(valueIfTrueType.id, T_float) && BaseTypeBinding.isNarrowing(valueIfFalseType.id, T_float)) { this.valueIfTrue.computeConversion(scope, TypeBinding.FLOAT, originalValueIfTrueType); this.valueIfFalse.computeConversion(scope, TypeBinding.FLOAT, originalValueIfFalseType);
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 TypeBinding unannotated() { if (!this.hasTypeAnnotations()) return this; switch (this.id) { case TypeIds.T_boolean: return TypeBinding.BOOLEAN; case TypeIds.T_byte: return TypeBinding.BYTE; case TypeIds.T_char: return TypeBinding.CHAR; case TypeIds.T_double: return TypeBinding.DOUBLE; case TypeIds.T_float: return TypeBinding.FLOAT; case TypeIds.T_int: return TypeBinding.INT; case TypeIds.T_long: return TypeBinding.LONG; case TypeIds.T_short: return TypeBinding.SHORT; default: throw new IllegalStateException(); } } /**
public boolean isConstantValueOfTypeAssignableToType(TypeBinding constantType, TypeBinding targetType) { if (this.constant == Constant.NotAConstant) return false; if (constantType == targetType) return true; //No free assignment conversion from anything but to integral ones. if (BaseTypeBinding.isWidening(TypeIds.T_int, constantType.id) && (BaseTypeBinding.isNarrowing(targetType.id, TypeIds.T_int))) { //use current explicit conversion in order to get some new value to compare with current one return isConstantValueRepresentable(this.constant, constantType.id, targetType.id); } return false; }
public String toString() { return this.hasTypeAnnotations() ? annotatedDebugName() : new String(readableName()); } }
if (isConstructor && this.declaringClass.isEnum()) { // insert String name,int ordinal buffer.append(ConstantPool.JavaLangStringSignature); buffer.append(TypeBinding.INT.signature());
if (BaseTypeBinding.isNarrowing(valueIfTrueType.id, T_int) && BaseTypeBinding.isNarrowing(valueIfFalseType.id, T_int)) { this.valueIfTrue.computeConversion(scope, TypeBinding.INT, originalValueIfTrueType); this.valueIfFalse.computeConversion(scope, TypeBinding.INT, originalValueIfFalseType); if (BaseTypeBinding.isNarrowing(valueIfTrueType.id, T_long) && BaseTypeBinding.isNarrowing(valueIfFalseType.id, T_long)) { this.valueIfTrue.computeConversion(scope, TypeBinding.LONG, originalValueIfTrueType); this.valueIfFalse.computeConversion(scope, TypeBinding.LONG, originalValueIfFalseType); if (BaseTypeBinding.isNarrowing(valueIfTrueType.id, T_float) && BaseTypeBinding.isNarrowing(valueIfFalseType.id, T_float)) { this.valueIfTrue.computeConversion(scope, TypeBinding.FLOAT, originalValueIfTrueType); this.valueIfFalse.computeConversion(scope, TypeBinding.FLOAT, originalValueIfFalseType);
/** * int -> I */ public char[] computeUniqueKey(boolean isLeaf) { return constantPoolName(); }
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 TypeBinding clone(TypeBinding enclosingType) { return new BaseTypeBinding(this.id, this.simpleName, this.constantPoolName); }