Program: 177695
Project: 177695
Buggy source:
/** 
 * Makes name and column type bindings to given <code>field</code>. It also makes default name bindings to unnamed   {@link Index}es (or   {@link Id} fieldssince it covers  {@link Index})
 * @param entity used to generate index name if not specified.
 * @param field
 * @param namingPolicy
 * @param dataTypeMapper
 */
public static void makeBinding(Entity entity,Field field,PhysicalNamingPolicy namingPolicy,DataTypeMapper dataTypeMapper){
  if (field.getCustomName() != null) {
    Log.trace("String_Node_Str",entity.getOriginalName(),field.getOriginalName());
    field.setGeneratedName(field.getCustomName());
  }
 else {
    field.setGeneratedName(PhysicalNameGenerator.format(field.getOriginalName(),namingPolicy));
  }
  if (field.getCustomType() != null) {
    Log.trace("String_Node_Str",entity.getOriginalName(),field.getOriginalName());
    field.setType(field.getCustomType());
  }
 else {
    Class<?> fieldType=null;
    String customizedBindingType=null;
    if (field.isAnnotationPresent(OneToOne.class)) {
      Class<?> idType=getIdTypeForClass(field.getClazz());
      fieldType=idType;
      customizedBindingType=getCustomizedBinding(field.getClazz());
      Log.trace("String_Node_Str",entity.getOriginalName(),field.getOriginalName());
    }
 else     if (MappingSession.entityExists(field.getClazz())) {
      Class<?> idType=getIdTypeForClass(field.getClazz());
      fieldType=idType;
      Log.trace("String_Node_Str",entity.getOriginalName(),field.getOriginalName());
    }
 else {
      fieldType=field.getClazz();
    }
    if (customizedBindingType != null)     field.setType(customizedBindingType);
 else     field.setType(dataTypeMapper.getTypeFor(fieldType));
    Log.info("String_Node_Str",field.getOriginalName(),field.getClazz().getName(),field.getGeneratedName(),field.getType());
  }
  if (field.getIndex() != null) {
    if (field.getIndex().name() == null || "String_Node_Str".equals(field.getIndex().name())) {
      String indexName=String.format(INDEX_FORMAT,entity.getGeneratedName(),field.getGeneratedName(),INDEX_POSTFIX);
      Log.info("String_Node_Str",field.getOriginalName(),indexName);
      field.getIndex().name(indexName);
    }
  }
}

Fixed version (ground truth):
/** 
 * Makes name and column type bindings to given <code>field</code>. It also makes default name bindings to unnamed   {@link Index}es (or   {@link Id} fieldssince it covers  {@link Index})
 * @param entity used to generate index name if not specified.
 * @param field
 * @param namingPolicy
 * @param dataTypeMapper
 */
public static void makeBinding(Entity entity,Field field,PhysicalNamingPolicy namingPolicy,DataTypeMapper dataTypeMapper){
  if (field.getCustomName() != null) {
    Log.trace("String_Node_Str",entity.getOriginalName(),field.getOriginalName());
    field.setGeneratedName(field.getCustomName());
  }
 else {
    field.setGeneratedName(PhysicalNameGenerator.format(field.getOriginalName(),namingPolicy));
  }
  if (field.getCustomType() != null) {
    Log.trace("String_Node_Str",entity.getOriginalName(),field.getOriginalName());
    field.setType(field.getCustomType());
  }
 else {
    Class<?> fieldType=null;
    String customizedBindingType=null;
    if (MappingSession.entityExists(field.getClazz())) {
      Class<?> idType=getIdTypeForClass(field.getClazz());
      fieldType=idType;
      Log.error(fieldType);
      customizedBindingType=getCustomizedBinding(field.getClazz());
      Log.trace("String_Node_Str",entity.getOriginalName(),field.getOriginalName());
    }
 else     if (field.isAnnotationPresent(OneToOne.class)) {
      Class<?> idType=getIdTypeForClass(field.getClazz());
      fieldType=idType;
      customizedBindingType=getCustomizedBinding(field.getClazz());
      Log.trace("String_Node_Str",entity.getOriginalName(),field.getOriginalName());
    }
 else {
      fieldType=field.getClazz();
    }
    if (customizedBindingType != null)     field.setType(customizedBindingType);
 else     field.setType(dataTypeMapper.getTypeFor(fieldType));
    Log.info("String_Node_Str",field.getOriginalName(),field.getClazz().getName(),field.getGeneratedName(),field.getType(),customizedBindingType != null ? "String_Node_Str" : "String_Node_Str");
  }
  if (field.getIndex() != null) {
    if (field.getIndex().name() == null || "String_Node_Str".equals(field.getIndex().name())) {
      String indexName=String.format(INDEX_FORMAT,entity.getGeneratedName(),field.getGeneratedName(),INDEX_POSTFIX);
      Log.info("String_Node_Str",field.getOriginalName(),indexName);
      field.getIndex().name(indexName);
    }
  }
}