Program: 126000
Project: 126000
Buggy source:
public IMetadataColumn createNewMetadataColumn(){
  MetadataColumn metadataColumn=new MetadataColumn();
  String columnName=getNextGeneratedColumnName();
  metadataColumn.setLabel(columnName);
  metadataColumn.setNullable(true);
  metadataColumn.setOriginalDbColumnName(columnName);
  IPreferenceStore preferenceStore=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreUIService.class)) {
    IDesignerCoreUIService designerCoreUiService=(IDesignerCoreUIService)GlobalServiceRegister.getDefault().getService(IDesignerCoreUIService.class);
    preferenceStore=designerCoreUiService.getPreferenceStore();
  }
  if (preferenceStore != null && preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_TYPE) != null && !preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_TYPE).equals("String_Node_Str")) {
    metadataColumn.setTalendType(preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_TYPE));
    if (preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_LENGTH) != null && !preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_LENGTH).equals("String_Node_Str")) {
      metadataColumn.setLength(Integer.parseInt(preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_LENGTH)));
    }
  }
 else {
    metadataColumn.setTalendType(JavaTypesManager.getDefaultJavaType().getId());
    if (metadataTable.getDbms() != null) {
      metadataColumn.setType(TypesManager.getDBTypeFromTalendType(metadataTable.getDbms(),metadataColumn.getTalendType()));
    }
  }
  return metadataColumn;
}

Fixed version (ground truth):
public IMetadataColumn createNewMetadataColumn(){
  MetadataColumn metadataColumn=new MetadataColumn();
  String columnName=getNextGeneratedColumnName();
  metadataColumn.setLabel(columnName);
  metadataColumn.setNullable(true);
  metadataColumn.setOriginalDbColumnName(columnName);
  IPreferenceStore preferenceStore=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IDesignerCoreUIService.class)) {
    IDesignerCoreUIService designerCoreUiService=(IDesignerCoreUIService)GlobalServiceRegister.getDefault().getService(IDesignerCoreUIService.class);
    preferenceStore=designerCoreUiService.getPreferenceStore();
  }
  if (preferenceStore != null && preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_TYPE) != null && !preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_TYPE).equals("String_Node_Str")) {
    metadataColumn.setTalendType(preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_TYPE));
    if (metadataTable.getDbms() != null) {
      metadataColumn.setType(TypesManager.getDBTypeFromTalendType(metadataTable.getDbms(),metadataColumn.getTalendType()));
    }
    if (preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_LENGTH) != null && !preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_LENGTH).equals("String_Node_Str")) {
      metadataColumn.setLength(Integer.parseInt(preferenceStore.getString(MetadataTypeLengthConstants.FIELD_DEFAULT_LENGTH)));
    }
  }
 else {
    metadataColumn.setTalendType(JavaTypesManager.getDefaultJavaType().getId());
    if (metadataTable.getDbms() != null) {
      metadataColumn.setType(TypesManager.getDBTypeFromTalendType(metadataTable.getDbms(),metadataColumn.getTalendType()));
    }
  }
  return metadataColumn;
}