break; case TypeDesc.BOOLEAN_CODE: if (to.toPrimitiveType().getTypeCode() == TypeDesc.BOOLEAN_CODE) { break;
/** * Returns true if the type of the given property type is supported. The * types currently supported are primitives, primitive wrapper objects, * Strings, byte arrays and Lobs. */ public boolean isSupported(TypeDesc propertyType) { if (propertyType.toPrimitiveType() != null) { return true; } if (propertyType == TypeDesc.STRING || propertyType == TypeDesc.forClass(byte[].class)) { return true; } Class clazz = propertyType.toClass(); if (clazz != null) { return Lob.class.isAssignableFrom(clazz) || BigInteger.class.isAssignableFrom(clazz) || BigDecimal.class.isAssignableFrom(clazz); } return false; }
/** * Returns true if the type of the given property type is supported. The * types currently supported are primitives, primitive wrapper objects, * Strings, byte arrays and Lobs. */ public boolean isSupported(TypeDesc propertyType) { if (propertyType.toPrimitiveType() != null) { return true; } if (propertyType == TypeDesc.STRING || propertyType == TypeDesc.forClass(byte[].class)) { return true; } Class clazz = propertyType.toClass(); if (clazz != null) { return Lob.class.isAssignableFrom(clazz) || BigInteger.class.isAssignableFrom(clazz) || BigDecimal.class.isAssignableFrom(clazz); } return false; }
static <T> RParameter<T> make(Class<T> type, boolean asynchronous, boolean timeout, boolean timeoutUnit) { if (type == void.class || type == null) { return null; } boolean unshared = type.isPrimitive() || String.class.isAssignableFrom(type) || (asynchronous && Pipe.class.isAssignableFrom(type)) || TypeDesc.forClass(type).toPrimitiveType() != null; int flags = (unshared ? FLAG_UNSHARED : 0) | (timeout ? FLAG_TIMEOUT : 0) | (timeoutUnit ? FLAG_TIMEOUT_UNIT : 0); return intern(new RParameter<T>(type, flags)); }
/** * @param fieldType must be an object type * @return null if compareTo should not be called */ private static TypeDesc compareToType(TypeDesc fieldType) { if (fieldType.toPrimitiveType() == TypeDesc.FLOAT) { // Special treatment to handle NaN. return TypeDesc.FLOAT.toObjectType(); } else if (fieldType.toPrimitiveType() == TypeDesc.DOUBLE) { // Special treatment to handle NaN. return TypeDesc.DOUBLE.toObjectType(); } else if (BigDecimal.class.isAssignableFrom(fieldType.toClass())) { // Call compareTo to disregard scale. return TypeDesc.forClass(BigDecimal.class); } else { return null; } }
if (from.toPrimitiveType() != null && to.toPrimitiveType() != null) { from = from.toPrimitiveType(); to = to.toPrimitiveType(); } else { from = from.toObjectType();
/** * @param fieldType must be an object type * @return null if compareTo should not be called */ private static TypeDesc compareToType(TypeDesc fieldType) { if (fieldType.toPrimitiveType() == TypeDesc.FLOAT) { // Special treatment to handle NaN. return TypeDesc.FLOAT.toObjectType(); } else if (fieldType.toPrimitiveType() == TypeDesc.DOUBLE) { // Special treatment to handle NaN. return TypeDesc.DOUBLE.toObjectType(); } else if (BigDecimal.class.isAssignableFrom(fieldType.toClass())) { // Call compareTo to disregard scale. return TypeDesc.forClass(BigDecimal.class); } else { return null; } }
if (from.toPrimitiveType() != null && to.toPrimitiveType() != null) { from = from.toPrimitiveType(); to = to.toPrimitiveType(); } else { from = from.toObjectType();
/** * Returns the actual field type used to store the given property * type. Floating point values are represented in their "bit" form, in * order to compare against NaN. */ private static TypeDesc actualFieldType(TypeDesc type) { if (type.toPrimitiveType() == FLOAT) { if (type.isPrimitive()) { type = INT; } else { type = INT.toObjectType(); } } else if (type.toPrimitiveType() == DOUBLE) { if (type.isPrimitive()) { type = LONG; } else { type = LONG.toObjectType(); } } return type; }
/** * Returns the actual field type used to store the given property * type. Floating point values are represented in their "bit" form, in * order to compare against NaN. */ private static TypeDesc actualFieldType(TypeDesc type) { if (type.toPrimitiveType() == FLOAT) { if (type.isPrimitive()) { type = INT; } else { type = INT.toObjectType(); } } else if (type.toPrimitiveType() == DOUBLE) { if (type.isPrimitive()) { type = LONG; } else { type = LONG.toObjectType(); } } return type; }
if (from.toPrimitiveType() != null) { from = from.toPrimitiveType(); result = compare(from, a, b); if (result != 0) { if (!toType_a.isPrimitive() && a.toPrimitiveType() != null) { a = a.toPrimitiveType(); if (!toType_b.isPrimitive() && b.toPrimitiveType() != null) { b = b.toPrimitiveType();
TypeDesc fromPrimitiveType = fromType.toPrimitiveType(); if (fromPrimitiveType == null) { if (!toType.isPrimitive()) { TypeDesc toPrimitiveType = toType.toPrimitiveType(); if (toPrimitiveType == null) { throw invalidConversion(fromType, toType);
break; case TypeDesc.BOOLEAN_CODE: if (to.toPrimitiveType().getTypeCode() == TypeDesc.BOOLEAN_CODE) { break;
TypeDesc toType) if (resultSetType == TypeDesc.STRING && toType.toPrimitiveType() == TypeDesc.CHAR) {
TypeDesc toType) if (resultSetType == TypeDesc.STRING && toType.toPrimitiveType() == TypeDesc.CHAR) {
LocalVariable timeoutVar) switch (timeoutVar.getType().toPrimitiveType().getTypeCode()) { case TypeDesc.BYTE_CODE: if (((byte) timeout) != timeout) {
TypeDesc fromPrimType = fromType.toPrimitiveType(); TypeDesc toPrimType = toType.toPrimitiveType();
TypeDesc fromPrimType = fromType.toPrimitiveType(); TypeDesc toPrimType = toType.toPrimitiveType();
private static void adjustVersion(CodeBuilder b, TypeDesc type, int value, boolean increment) throws SupportException TypeDesc primitiveType = type.toPrimitiveType(); supportCheck: { if (primitiveType != null) {
private static void adjustVersion(CodeBuilder b, TypeDesc type, int value, boolean increment) throws SupportException TypeDesc primitiveType = type.toPrimitiveType(); supportCheck: { if (primitiveType != null) {