public boolean isSuperset(VarType val) { return this.equals(val) || this.isStrictSuperset(val); }
private static boolean isNarrowedIntType(VarType type) { return VarType.VARTYPE_INT.isStrictSuperset(type) || type.equals(VarType.VARTYPE_BYTE_OBJ) || type.equals(VarType.VARTYPE_SHORT_OBJ); } }
if (minInteger.isStrictSuperset(newType)) { newType = minInteger; if (currentMinType != null && (newMinType.typeFamily > currentMinType.typeFamily || newMinType.isStrictSuperset(currentMinType))) { return false;
case FUNCTION_NE: { if (type1.type == CodeConstants.TYPE_BOOLEAN) { if (type2.isStrictSuperset(type1)) { result.addMinTypeExprent(param1, VarType.VARTYPE_BYTECHAR); if (type1.isStrictSuperset(type2)) { result.addMinTypeExprent(param2, VarType.VARTYPE_BYTECHAR);
public boolean isSuperset(VarType val) { return this.equals(val) || this.isStrictSuperset(val); }
if (minInteger.isStrictSuperset(newType)) { newType = minInteger; if (currentMinType != null && (newMinType.typeFamily > currentMinType.typeFamily || newMinType.isStrictSuperset(currentMinType))) { return false;
case FUNCTION_NE: { if (type1.type == CodeConstants.TYPE_BOOLEAN) { if (type2.isStrictSuperset(type1)) { result.addMinTypeExprent(param1, VarType.VARTYPE_BYTECHAR); if (type1.isStrictSuperset(type2)) { result.addMinTypeExprent(param2, VarType.VARTYPE_BYTECHAR);
public static boolean getCastedExprent(Exprent exprent, VarType leftType, TextBuffer buffer, int indent, boolean castNull, boolean castAlways, boolean castNarrowing, BytecodeMappingTracer tracer) { VarType rightType = exprent.getExprType(); boolean cast = castAlways || (!leftType.isSuperset(rightType) && (rightType.equals(VarType.VARTYPE_OBJECT) || leftType.type != CodeConstants.TYPE_OBJECT)) || (castNull && rightType.type == CodeConstants.TYPE_NULL && !UNDEFINED_TYPE_STRING.equals(getTypeName(leftType))) || (castNarrowing && isIntConstant(exprent) && VarType.VARTYPE_INT.isStrictSuperset(leftType)); boolean quote = cast && exprent.getPrecedence() >= FunctionExprent.getPrecedence(FunctionExprent.FUNCTION_CAST); if (cast) buffer.append('(').append(getCastTypeName(leftType)).append(')'); if (quote) buffer.append('('); if (exprent.type == Exprent.EXPRENT_CONST) { ((ConstExprent) exprent).adjustConstType(leftType); } buffer.append(exprent.toJava(indent, tracer)); if (quote) buffer.append(')'); return cast; }