Program: 16023
Project: 16023
Buggy source:
/** 
 * Get the value type for the given Java class.
 * @param x the Java class
 * @return the value type
 */
public static int getTypeFromClass(Class<?> x){
  if (x == null) {
    return Value.NULL;
  }
  if (x.isPrimitive()) {
    x=Utils.getNonPrimitiveClass(x);
  }
  if (ResultSet.class.isAssignableFrom(x)) {
    return Value.RESULT_SET;
  }
 else   if (Value.ValueBlob.class.isAssignableFrom(x)) {
    return Value.BLOB;
  }
 else   if (Value.ValueClob.class.isAssignableFrom(x)) {
    return Value.CLOB;
  }
 else   if (String.class.isAssignableFrom(x)) {
    return Value.STRING;
  }
 else   if (BigDecimal.class.isAssignableFrom(x)) {
    return Value.DECIMAL;
  }
 else   if (Boolean.class == x) {
    return Value.BOOLEAN;
  }
 else   if (Byte.class == x) {
    return Value.BYTE;
  }
 else   if (Short.class == x) {
    return Value.SHORT;
  }
 else   if (Integer.class == x) {
    return Value.INT;
  }
 else   if (Character.class == x) {
    throw DbException.get(ErrorCode.DATA_CONVERSION_ERROR_1,"String_Node_Str");
  }
 else   if (Long.class == x) {
    return Value.LONG;
  }
 else   if (Float.class == x) {
    return Value.FLOAT;
  }
 else   if (Double.class == x) {
    return Value.DOUBLE;
  }
 else   if (byte[].class.isAssignableFrom(x)) {
    return Value.BYTES;
  }
 else   if (Date.class.isAssignableFrom(x)) {
    return Value.DATE;
  }
 else   if (Time.class.isAssignableFrom(x)) {
    return Value.TIME;
  }
 else   if (Timestamp.class.isAssignableFrom(x)) {
    return Value.TIMESTAMP;
  }
 else   if (java.util.Date.class.isAssignableFrom(x)) {
    return Value.TIMESTAMP;
  }
 else   if (java.io.Reader.class.isAssignableFrom(x)) {
    return Value.CLOB;
  }
 else   if (java.sql.Clob.class.isAssignableFrom(x)) {
    return Value.CLOB;
  }
 else   if (java.io.InputStream.class.isAssignableFrom(x)) {
    return Value.BLOB;
  }
 else   if (java.sql.Blob.class.isAssignableFrom(x)) {
    return Value.BLOB;
  }
 else   if (UUID.class.isAssignableFrom(x)) {
    return Value.UUID;
  }
 else   if (Object[].class.isAssignableFrom(x)) {
    return Value.ARRAY;
  }
 else   if (Void.TYPE == x) {
    return Value.NULL;
  }
 else {
    return Value.JAVA_OBJECT;
  }
}

Fixed version (ground truth):
/** 
 * Get the value type for the given Java class.
 * @param x the Java class
 * @return the value type
 */
public static int getTypeFromClass(Class<?> x){
  if (x == null || Void.TYPE == x) {
    return Value.NULL;
  }
  if (x.isPrimitive()) {
    x=Utils.getNonPrimitiveClass(x);
  }
  if (ResultSet.class.isAssignableFrom(x)) {
    return Value.RESULT_SET;
  }
 else   if (Value.ValueBlob.class.isAssignableFrom(x)) {
    return Value.BLOB;
  }
 else   if (Value.ValueClob.class.isAssignableFrom(x)) {
    return Value.CLOB;
  }
 else   if (String.class.isAssignableFrom(x)) {
    return Value.STRING;
  }
 else   if (BigDecimal.class.isAssignableFrom(x)) {
    return Value.DECIMAL;
  }
 else   if (Boolean.class == x) {
    return Value.BOOLEAN;
  }
 else   if (Byte.class == x) {
    return Value.BYTE;
  }
 else   if (Short.class == x) {
    return Value.SHORT;
  }
 else   if (Integer.class == x) {
    return Value.INT;
  }
 else   if (Character.class == x) {
    throw DbException.get(ErrorCode.DATA_CONVERSION_ERROR_1,"String_Node_Str");
  }
 else   if (Long.class == x) {
    return Value.LONG;
  }
 else   if (Float.class == x) {
    return Value.FLOAT;
  }
 else   if (Double.class == x) {
    return Value.DOUBLE;
  }
 else   if (byte[].class.isAssignableFrom(x)) {
    return Value.BYTES;
  }
 else   if (Date.class.isAssignableFrom(x)) {
    return Value.DATE;
  }
 else   if (Time.class.isAssignableFrom(x)) {
    return Value.TIME;
  }
 else   if (Timestamp.class.isAssignableFrom(x)) {
    return Value.TIMESTAMP;
  }
 else   if (java.util.Date.class.isAssignableFrom(x)) {
    return Value.TIMESTAMP;
  }
 else   if (java.io.Reader.class.isAssignableFrom(x)) {
    return Value.CLOB;
  }
 else   if (java.sql.Clob.class.isAssignableFrom(x)) {
    return Value.CLOB;
  }
 else   if (java.io.InputStream.class.isAssignableFrom(x)) {
    return Value.BLOB;
  }
 else   if (java.sql.Blob.class.isAssignableFrom(x)) {
    return Value.BLOB;
  }
 else   if (UUID.class.isAssignableFrom(x)) {
    return Value.UUID;
  }
 else   if (Object[].class.isAssignableFrom(x)) {
    return Value.ARRAY;
  }
 else   if (Void.TYPE == x) {
    return Value.NULL;
  }
 else {
    return Value.JAVA_OBJECT;
  }
}