Program: 101974
Project: 101974
Buggy source:
/** 
 * Create EMF Column from the supplied RelationalReference
 * @param ref the relational object
 * @param procedureResult the procedure result set
 * @param modelResource the model resource
 * @return the new object
 */
public EObject createColumn(RelationalReference ref,ProcedureResult procedureResult,ModelResource modelResource){
  CoreArgCheck.isInstanceOf(RelationalColumn.class,ref);
  RelationalColumn columnRef=(RelationalColumn)ref;
  Column column=FACTORY.createColumn();
  column.setOwner(procedureResult);
  column.setName(columnRef.getName());
  column.setNameInSource(columnRef.getNameInSource());
  column.setAutoIncremented(columnRef.isAutoIncremented());
  column.setCaseSensitive(columnRef.isCaseSensitive());
  column.setCharacterSetName(columnRef.getCharacterSetName());
  column.setCollationName(columnRef.getCollationName());
  column.setCurrency(columnRef.isCurrency());
  column.setDefaultValue(columnRef.getDefaultValue());
  column.setDistinctValueCount(columnRef.getDistinctValueCount());
  column.setFixedLength(columnRef.isLengthFixed());
  column.setFormat(columnRef.getFormat());
  column.setLength(columnRef.getLength());
  column.setMaximumValue(columnRef.getMaximumValue());
  column.setMinimumValue(columnRef.getMinimumValue());
  column.setNativeType(columnRef.getNativeType());
  String nullableStr=columnRef.getNullable();
  column.setNullable(getNullableType(nullableStr));
  column.setNullValueCount(columnRef.getNullValueCount());
  column.setPrecision(columnRef.getPrecision());
  column.setRadix(columnRef.getRadix());
  column.setScale(columnRef.getScale());
  column.setSearchability(getSearchabilityType(columnRef.getSearchability()));
  column.setSelectable(columnRef.isSelectable());
  column.setSigned(columnRef.isSigned());
  column.setUpdateable(columnRef.isUpdateable());
  String dType=columnRef.getDatatype();
  if (dType == null || dType.length() == 0) {
    dType=DatatypeProcessor.DEFAULT_DATATYPE;
  }
  EObject datatype=this.datatypeProcessor.findDatatype(dType);
  if (datatype != null) {
    column.setType(datatype);
    String dTypeName=this.modelEditor.getName(datatype);
    int datatypeLength=columnRef.getLength();
    if (datatypeLength == 0 && DatatypeProcessor.DEFAULT_DATATYPE.equalsIgnoreCase(dTypeName)) {
      columnRef.setLength(DatatypeProcessor.DEFAULT_DATATYPE_LENGTH);
    }
 else {
      columnRef.setLength(datatypeLength);
    }
  }
  updateDeferredList(columnRef,column);
  return column;
}

Fixed version (ground truth):
/** 
 * Create EMF Column from the supplied RelationalReference
 * @param ref the relational object
 * @param procedureResult the procedure result set
 * @param modelResource the model resource
 * @return the new object
 */
public EObject createColumn(RelationalReference ref,ProcedureResult procedureResult,ModelResource modelResource){
  CoreArgCheck.isInstanceOf(RelationalColumn.class,ref);
  RelationalColumn columnRef=(RelationalColumn)ref;
  Column column=FACTORY.createColumn();
  column.setOwner(procedureResult);
  column.setName(columnRef.getName());
  column.setNameInSource(columnRef.getNameInSource());
  column.setAutoIncremented(columnRef.isAutoIncremented());
  column.setCaseSensitive(columnRef.isCaseSensitive());
  column.setCharacterSetName(columnRef.getCharacterSetName());
  column.setCollationName(columnRef.getCollationName());
  column.setCurrency(columnRef.isCurrency());
  column.setDefaultValue(columnRef.getDefaultValue());
  column.setDistinctValueCount(columnRef.getDistinctValueCount());
  column.setFixedLength(columnRef.isLengthFixed());
  column.setFormat(columnRef.getFormat());
  column.setLength(columnRef.getLength());
  column.setMaximumValue(columnRef.getMaximumValue());
  column.setMinimumValue(columnRef.getMinimumValue());
  column.setNativeType(columnRef.getNativeType());
  String nullableStr=columnRef.getNullable();
  column.setNullable(getNullableType(nullableStr));
  column.setNullValueCount(columnRef.getNullValueCount());
  column.setPrecision(columnRef.getPrecision());
  column.setRadix(columnRef.getRadix());
  column.setScale(columnRef.getScale());
  column.setSearchability(getSearchabilityType(columnRef.getSearchability()));
  column.setSelectable(columnRef.isSelectable());
  column.setSigned(columnRef.isSigned());
  column.setUpdateable(columnRef.isUpdateable());
  String dType=columnRef.getDatatype();
  if (dType == null || dType.length() == 0) {
    dType=DatatypeProcessor.DEFAULT_DATATYPE;
  }
  EObject datatype=this.datatypeProcessor.findDatatype(dType);
  if (datatype != null) {
    column.setType(datatype);
    String dTypeName=this.getModelEditor().getName(datatype);
    int datatypeLength=columnRef.getLength();
    if (datatypeLength == 0 && DatatypeProcessor.DEFAULT_DATATYPE.equalsIgnoreCase(dTypeName)) {
      columnRef.setLength(DatatypeProcessor.DEFAULT_DATATYPE_LENGTH);
    }
 else {
      columnRef.setLength(datatypeLength);
    }
  }
  updateDeferredList(columnRef,column);
  return column;
}