Program: 31980
Project: 31980
Buggy source:
private void writeModelToFileSystem(List<TreeNode> trees,Path out){
  FSDataOutputStream fos=null;
  try {
    fos=FileSystem.get(new Configuration()).create(out);
    LOG.info("String_Node_Str",out);
    fos.writeUTF(modelConfig.getAlgorithm());
    fos.writeUTF(this.validParams.get("String_Node_Str").toString());
    fos.writeBoolean(this.modelConfig.isClassification());
    fos.writeBoolean(this.modelConfig.getTrain().isOneVsAll());
    fos.writeInt(this.inputCount);
    Map<Integer,String> columnIndexNameMapping=new HashMap<Integer,String>();
    Map<Integer,List<String>> columnIndexCategoricalListMapping=new HashMap<Integer,List<String>>();
    Map<Integer,Double> numericalMeanMapping=new HashMap<Integer,Double>();
    for (    ColumnConfig columnConfig : this.columnConfigList) {
      columnIndexNameMapping.put(columnConfig.getColumnNum(),columnConfig.getColumnName());
      if (columnConfig.isCategorical() && CollectionUtils.isNotEmpty(columnConfig.getBinBoundary())) {
        columnIndexCategoricalListMapping.put(columnConfig.getColumnNum(),columnConfig.getBinCategory());
      }
      if (columnConfig.isNumerical() && columnConfig.getMean() != null) {
        numericalMeanMapping.put(columnConfig.getColumnNum(),columnConfig.getMean());
      }
    }
    fos.writeInt(numericalMeanMapping.keySet().size());
    for (    Entry<Integer,Double> entry : numericalMeanMapping.entrySet()) {
      fos.writeInt(entry.getKey());
      fos.writeDouble(entry.getValue() == null ? 0d : entry.getValue());
    }
    fos.writeInt(columnIndexNameMapping.size());
    for (    Entry<Integer,String> entry : columnIndexNameMapping.entrySet()) {
      fos.writeInt(entry.getKey());
      fos.writeUTF(entry.getValue());
    }
    fos.writeInt(columnIndexCategoricalListMapping.size());
    for (    Entry<Integer,List<String>> entry : columnIndexCategoricalListMapping.entrySet()) {
      List<String> categories=entry.getValue();
      if (categories != null) {
        fos.writeInt(entry.getKey());
        fos.writeInt(categories.size());
        for (        String category : categories) {
          fos.writeUTF(category);
        }
      }
    }
    Map<Integer,Integer> columnMapping=getColumnMapping();
    fos.writeInt(columnMapping.size());
    for (    Entry<Integer,Integer> entry : columnMapping.entrySet()) {
      fos.writeInt(entry.getKey());
      fos.writeInt(entry.getValue());
    }
    int treeLength=trees.size();
    fos.writeInt(treeLength);
    for (    TreeNode treeNode : trees) {
      treeNode.write(fos);
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    IOUtils.closeStream(fos);
  }
}

Fixed version (ground truth):
private void writeModelToFileSystem(List<TreeNode> trees,Path out){
  FSDataOutputStream fos=null;
  try {
    fos=FileSystem.get(new Configuration()).create(out);
    LOG.info("String_Node_Str",out);
    fos.writeUTF(modelConfig.getAlgorithm());
    fos.writeUTF(this.validParams.get("String_Node_Str").toString());
    fos.writeBoolean(this.modelConfig.isClassification());
    fos.writeBoolean(this.modelConfig.getTrain().isOneVsAll());
    fos.writeInt(this.inputCount);
    Map<Integer,String> columnIndexNameMapping=new HashMap<Integer,String>();
    Map<Integer,List<String>> columnIndexCategoricalListMapping=new HashMap<Integer,List<String>>();
    Map<Integer,Double> numericalMeanMapping=new HashMap<Integer,Double>();
    for (    ColumnConfig columnConfig : this.columnConfigList) {
      columnIndexNameMapping.put(columnConfig.getColumnNum(),columnConfig.getColumnName());
      if (columnConfig.isCategorical() && CollectionUtils.isNotEmpty(columnConfig.getBinCategory())) {
        columnIndexCategoricalListMapping.put(columnConfig.getColumnNum(),columnConfig.getBinCategory());
      }
      if (columnConfig.isNumerical() && columnConfig.getMean() != null) {
        numericalMeanMapping.put(columnConfig.getColumnNum(),columnConfig.getMean());
      }
    }
    fos.writeInt(numericalMeanMapping.keySet().size());
    for (    Entry<Integer,Double> entry : numericalMeanMapping.entrySet()) {
      fos.writeInt(entry.getKey());
      fos.writeDouble(entry.getValue() == null ? 0d : entry.getValue());
    }
    fos.writeInt(columnIndexNameMapping.size());
    for (    Entry<Integer,String> entry : columnIndexNameMapping.entrySet()) {
      fos.writeInt(entry.getKey());
      fos.writeUTF(entry.getValue());
    }
    fos.writeInt(columnIndexCategoricalListMapping.size());
    for (    Entry<Integer,List<String>> entry : columnIndexCategoricalListMapping.entrySet()) {
      List<String> categories=entry.getValue();
      if (categories != null) {
        fos.writeInt(entry.getKey());
        fos.writeInt(categories.size());
        for (        String category : categories) {
          fos.writeUTF(category);
        }
      }
    }
    Map<Integer,Integer> columnMapping=getColumnMapping();
    fos.writeInt(columnMapping.size());
    for (    Entry<Integer,Integer> entry : columnMapping.entrySet()) {
      fos.writeInt(entry.getKey());
      fos.writeInt(entry.getValue());
    }
    int treeLength=trees.size();
    fos.writeInt(treeLength);
    for (    TreeNode treeNode : trees) {
      treeNode.write(fos);
    }
  }
 catch (  IOException e) {
    LOG.error("String_Node_Str",e);
  }
 finally {
    IOUtils.closeStream(fos);
  }
}