Program: 163373
Project: 163373
Buggy source:
/** 
 * Writes values from an implementation of   {@link java.util.Map} to a partial output record, ready to bewritten to the output. Values will be stored under a column identified by the headers. If no headers are defined, the keys of the map will be used to initialize an internal header row. A map of headers can be optionally provided to assign a name to the keys of the input map. This is useful when the input map has keys will generate unwanted header names.
 * @param headerMapping an optional map associating keys of the rowData map with expected header names
 * @param rowData       the data to be written. Its keys will be used to form a header row in case no headers are available.
 * @param < K >           type of the key in both rowData and headerMapping maps.
 */
private <K>void writeValuesFromMap(Map<K,String> headerMapping,Map<K,?> rowData){
  try {
    if (rowData != null && !rowData.isEmpty()) {
      dummyHeaderRow=this.headers;
      if (usingSwitch) {
        dummyHeaderRow=((RowWriterProcessorSwitch)writerProcessor).getHeaders(headerMapping,rowData);
        if (dummyHeaderRow == null) {
          dummyHeaderRow=this.headers;
        }
      }
      if (dummyHeaderRow != null) {
        if (headerMapping == null) {
          for (          Map.Entry<?,?> e : rowData.entrySet()) {
            addValue(dummyHeaderRow,String.valueOf(e.getKey()),e.getValue());
          }
        }
 else {
          for (          Map.Entry<?,?> e : rowData.entrySet()) {
            String header=headerMapping.get(e.getKey());
            if (header != null) {
              addValue(dummyHeaderRow,header,e.getValue());
            }
          }
        }
      }
 else       if (headerMapping != null) {
        setHeadersFromMap(headerMapping,false);
        writeValuesFromMap(headerMapping,rowData);
      }
 else {
        setHeadersFromMap(rowData,true);
        writeValuesFromMap(null,rowData);
      }
    }
  }
 catch (  Throwable t) {
    throw throwExceptionAndClose("String_Node_Str",t);
  }
}

Fixed version (ground truth):
/** 
 * Writes values from an implementation of   {@link java.util.Map} to a partial output record, ready to bewritten to the output. Values will be stored under a column identified by the headers. If no headers are defined, the keys of the map will be used to initialize an internal header row. A map of headers can be optionally provided to assign a name to the keys of the input map. This is useful when the input map has keys will generate unwanted header names.
 * @param headerMapping an optional map associating keys of the rowData map with expected header names
 * @param rowData       the data to be written. Its keys will be used to form a header row in case no headers are available.
 * @param < K >           type of the key in both rowData and headerMapping maps.
 */
private <K>void writeValuesFromMap(Map<K,String> headerMapping,Map<K,?> rowData){
  try {
    if (rowData != null && !rowData.isEmpty()) {
      dummyHeaderRow=this.headers;
      if (usingSwitch) {
        dummyHeaderRow=((RowWriterProcessorSwitch)writerProcessor).getHeaders(headerMapping,rowData);
        if (dummyHeaderRow == null) {
          dummyHeaderRow=this.headers;
        }
      }
      if (dummyHeaderRow != null) {
        if (headerMapping == null) {
          for (          Map.Entry<?,?> e : rowData.entrySet()) {
            addValue(dummyHeaderRow,String.valueOf(e.getKey()),true,e.getValue());
          }
        }
 else {
          for (          Map.Entry<?,?> e : rowData.entrySet()) {
            String header=headerMapping.get(e.getKey());
            if (header != null) {
              addValue(dummyHeaderRow,header,true,e.getValue());
            }
          }
        }
      }
 else       if (headerMapping != null) {
        setHeadersFromMap(headerMapping,false);
        writeValuesFromMap(headerMapping,rowData);
      }
 else {
        setHeadersFromMap(rowData,true);
        writeValuesFromMap(null,rowData);
      }
    }
  }
 catch (  Throwable t) {
    throw throwExceptionAndClose("String_Node_Str",t);
  }
}