nus-yam/ex-repair huggingface dataset:
Program: 163371
Project: 163371
Buggy source:
/** 
 * Calculates the index of a header name in relation to the original   {@link #headers} array defined in this writer
 * @param headersInContext headers currently in use (they might change).
 * @param headerName       the name of the header whose position will be identified
 * @return the position of the given header
 */
private int getFieldIndex(String[] headersInContext,String headerName){
  if (headerIndexes == null) {
    headerIndexes=new HashMap<String[],Map<String,Integer>>();
  }
  Map<String,Integer> indexes=headerIndexes.get(headersInContext);
  if (indexes == null) {
    indexes=new HashMap<String,Integer>();
    headerIndexes.put(headersInContext,indexes);
  }
  Integer index=indexes.get(headerName);
  if (index == null) {
    if (headersInContext == null) {
      throw throwExceptionAndClose("String_Node_Str" + headerName + "String_Node_Str",null);
    }
    index=ArgumentUtils.indexOf(ArgumentUtils.normalize(headersInContext),ArgumentUtils.normalize(headerName));
    if (index == -1) {
      throw throwExceptionAndClose("String_Node_Str" + headerName + "String_Node_Str"+ Arrays.toString(headers)+ '.',null);
    }
    indexes.put(headerName,index);
  }
  return index;
}

Fixed version (ground truth):
/** 
 * Calculates the index of a header name in relation to the original   {@link #headers} array defined in this writer
 * @param headersInContext headers currently in use (they might change).
 * @param headerName       the name of the header whose position will be identified
 * @param ignoreOnMismatch flag indicating that if the header is not found, no exception is to be thrown, and -1 should be returned instead.
 * @return the position of the given header, or -1 if it's not found when ignoreOnMismatch is set to {@code true}
 */
private int getFieldIndex(String[] headersInContext,String headerName,boolean ignoreOnMismatch){
  if (headerIndexes == null) {
    headerIndexes=new HashMap<String[],Map<String,Integer>>();
  }
  Map<String,Integer> indexes=headerIndexes.get(headersInContext);
  if (indexes == null) {
    indexes=new HashMap<String,Integer>();
    headerIndexes.put(headersInContext,indexes);
  }
  Integer index=indexes.get(headerName);
  if (index == null) {
    if (headersInContext == null) {
      throw throwExceptionAndClose("String_Node_Str" + headerName + "String_Node_Str",null);
    }
    index=ArgumentUtils.indexOf(ArgumentUtils.normalize(headersInContext),ArgumentUtils.normalize(headerName));
    if (index == -1) {
      if (!ignoreOnMismatch) {
        throw throwExceptionAndClose("String_Node_Str" + headerName + "String_Node_Str"+ Arrays.toString(headersInContext)+ '.',null);
      }
    }
    indexes.put(headerName,index);
  }
  return index;
}
Program: 163372
Project: 163372
Buggy source:
private final void addValue(String[] headersInContext,String headerName,Object value){
  addValue(getFieldIndex(headersInContext,headerName),value);
}

Fixed version (ground truth):
private final void addValue(String[] headersInContext,String headerName,boolean ignoreOnMismatch,Object value){
  int index=getFieldIndex(headersInContext,headerName,ignoreOnMismatch);
  if (index != -1) {
    addValue(index,value);
  }
}
Program: 163374
Project: 163374
Buggy source:
/** 
 * Associates a   {@link RowWriterProcessor} implementation with an expected value to be matched in the column provided in the constructor of this class.
 * @param beanType the type of annotated java beans whose instances will be used to trigger the usage of a different format.
 */
public <T>void addSwitchForType(Class<T> beanType){
  addSwitch(new Switch(null,null,beanType));
}

Fixed version (ground truth):
/** 
 * Associates a   {@link RowWriterProcessor} implementation with an expected value to be matched in the column provided in the constructor of this class.
 * @param beanType the type of annotated java beans whose instances will be used to trigger the usage of a different format.
 * @param < T >      the type of annotated java beans whose instances will be used to trigger the usage of a different format.
 */
public <T>void addSwitchForType(Class<T> beanType){
  addSwitch(new Switch(null,null,beanType));
}
Program: 163375
Project: 163375
Buggy source:
/** 
 * Returns the CSV format detected when one of the following settings is enabled: <li> <ul>  {@link CommonParserSettings#isLineSeparatorDetectionEnabled()}</ul> <ul>  {@link CsvParserSettings#isDelimiterDetectionEnabled()}</ul> <ul>  {@link CsvParserSettings#isQuoteDetectionEnabled()}</ul> </li> The detected format will be available once the parsing process is initialized (i.e. when   {@link AbstractParser#beginParsing(Reader) runs}.
 * @return the detected CSV format, or {@code null} if no detection has been enabled or if the parsing process has not been started yet.
 */
public final CsvFormat getDetectedFormat(){
  CsvFormat out=null;
  if (settings.isDelimiterDetectionEnabled()) {
    out=settings.getFormat().clone();
    out.setDelimiter(this.delimiter);
  }
  if (settings.isQuoteDetectionEnabled()) {
    out=out == null ? settings.getFormat().clone() : out;
    out.setQuote(quote);
    out.setQuoteEscape(quoteEscape);
  }
  if (settings.isLineSeparatorDetectionEnabled()) {
    out=out == null ? settings.getFormat().clone() : out;
    out.setLineSeparator(input.getLineSeparator());
  }
  return out;
}

Fixed version (ground truth):
/** 
 * Returns the CSV format detected when one of the following settings is enabled: <ul> <li>  {@link CommonParserSettings#isLineSeparatorDetectionEnabled()}</li> <li>  {@link CsvParserSettings#isDelimiterDetectionEnabled()}</li> <li>  {@link CsvParserSettings#isQuoteDetectionEnabled()}</li> </ul> The detected format will be available once the parsing process is initialized (i.e. when   {@link AbstractParser#beginParsing(Reader) runs}.
 * @return the detected CSV format, or {@code null} if no detection has been enabled or if the parsing process has not been started yet.
 */
public final CsvFormat getDetectedFormat(){
  CsvFormat out=null;
  if (settings.isDelimiterDetectionEnabled()) {
    out=settings.getFormat().clone();
    out.setDelimiter(this.delimiter);
  }
  if (settings.isQuoteDetectionEnabled()) {
    out=out == null ? settings.getFormat().clone() : out;
    out.setQuote(quote);
    out.setQuoteEscape(quoteEscape);
  }
  if (settings.isLineSeparatorDetectionEnabled()) {
    out=out == null ? settings.getFormat().clone() : out;
    out.setLineSeparator(input.getLineSeparator());
  }
  return out;
}
Program: 163376
Project: 163376
Buggy source:
/** 
 * Creates a new instance with the mandatory characters for handling newlines transparently.
 * @param lineSeparator the sequence of characters that represent a newline, as defined in {@link Format#getLineSeparator()}
 * @param normalizedLineSeparator the normalized newline character (as defined in {@link Format#getNormalizedNewline()}) that is used to replace any lineSeparator sequence found in the input.
 */
public AbstractCharInputReader(char[] lineSeparator,char normalizedLineSeparator){
  this.detectLineSeparator=false;
  this.normalizedLineSeparator=normalizedLineSeparator;
  setLineSeparator(lineSeparator);
}

Fixed version (ground truth):
/** 
 * Creates a new instance with the mandatory characters for handling newlines transparently.
 * @param lineSeparator           the sequence of characters that represent a newline, as defined in {@link Format#getLineSeparator()}
 * @param normalizedLineSeparator the normalized newline character (as defined in {@link Format#getNormalizedNewline()}) that is used to replace any lineSeparator sequence found in the input.
 */
public AbstractCharInputReader(char[] lineSeparator,char normalizedLineSeparator){
  this.detectLineSeparator=false;
  this.normalizedLineSeparator=normalizedLineSeparator;
  setLineSeparator(lineSeparator);
}
Program: 163377
Project: 163377
Buggy source:
/** 
 * Closes the   {@link java.io.Writer} given in this class constructor.<p> An IllegalStateException will be thrown in case of any errors.
 */
public final void close(){
  try {
    this.headerIndexes=null;
    if (writer != null) {
      try {
        writer.flush();
      }
  finally {
        writer.close();
        writer=null;
      }
    }
  }
 catch (  Throwable ex) {
    throw new IllegalStateException("String_Node_Str",ex);
  }
  if (this.partialLineIndex != 0) {
    throw new TextWritingException("String_Node_Str" + "String_Node_Str",recordCount,Arrays.copyOf(partialLine,partialLineIndex));
  }
}

Fixed version (ground truth):
/** 
 * Closes the   {@link java.io.Writer} given in this class constructor.<p> An IllegalStateException will be thrown in case of any errors.
 */
public final void close(){
  try {
    this.headerIndexes=null;
    if (writer != null) {
      writer.close();
      writer=null;
    }
  }
 catch (  Throwable ex) {
    throw new IllegalStateException("String_Node_Str",ex);
  }
  if (this.partialLineIndex != 0) {
    throw new TextWritingException("String_Node_Str" + "String_Node_Str",recordCount,Arrays.copyOf(partialLine,partialLineIndex));
  }
}
Program: 163379
Project: 163379
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final char nextChar(){
  if (length == -1) {
    throwEOFException();
  }
  char ch=buffer[i - 1];
  if (i >= length) {
    updateBuffer();
  }
  i++;
  if (lineSeparator1 == ch && (lineSeparator2 == '\0' || length != -1 && lineSeparator2 == buffer[i - 1])) {
    lineCount++;
    if (lineSeparator2 != '\0') {
      ch=normalizedLineSeparator;
      if (i >= length) {
        if (length != -1) {
          updateBuffer();
        }
 else {
          throwEOFException();
        }
      }
      if (i < length) {
        i++;
      }
    }
 else {
      return normalizedLineSeparator;
    }
  }
  return ch;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final char nextChar(){
  if (length == -1) {
    throwEOFException();
  }
  char ch=buffer[i - 1];
  if (i >= length) {
    updateBuffer();
  }
  i++;
  if (lineSeparator1 == ch && (lineSeparator2 == '\0' || length != -1 && lineSeparator2 == buffer[i - 1])) {
    lineCount++;
    if (normalizeLineEndings) {
      if (lineSeparator2 != '\0') {
        ch=normalizedLineSeparator;
        if (i >= length) {
          if (length != -1) {
            updateBuffer();
          }
 else {
            throwEOFException();
          }
        }
        i++;
      }
 else {
        return normalizedLineSeparator;
      }
    }
  }
  return ch;
}
Program: 163380
Project: 163380
Buggy source:
/** 
 * Appends the given character and marks it as ignored if it is a whitespace (  {@code ch <= ' '}) or a padding character (depends on the character given as the value for the   {@link DefaultCharAppender#padding} attribute in the constructor)<p>If the given character is equal to  {@link Format#getNormalizedNewline()}, then the character sequence returned by   {@link Format#getLineSeparator()} is going to be appended.
 * @param ch character to append
 */
@Override public void appendIgnoringWhitespaceAndPadding(char ch){
  try {
    if (ch == newLine) {
      super.appendIgnoringWhitespaceAndPadding(lineSeparator1);
      if (lineSeparator2 != '\0') {
        super.appendIgnoringWhitespaceAndPadding(lineSeparator2);
      }
    }
 else {
      super.appendIgnoringWhitespaceAndPadding(ch);
    }
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    expandAndRetry();
    appendIgnoringPadding(ch);
  }
}

Fixed version (ground truth):
/** 
 * Appends the given character and marks it as ignored if it is a whitespace (  {@code ch <= ' '}) or a padding character (depends on the character given as the value for the   {@link DefaultCharAppender#padding} attribute in the constructor)<p/> <p>If the given character is equal to  {@link Format#getNormalizedNewline()}, then the character sequence returned by   {@link Format#getLineSeparator()} is going to be appended.
 * @param ch character to append
 */
@Override public void appendIgnoringWhitespaceAndPadding(char ch){
  try {
    if (ch == newLine && denormalizeLineEndings) {
      super.appendIgnoringWhitespaceAndPadding(lineSeparator1);
      if (lineSeparator2 != '\0') {
        super.appendIgnoringWhitespaceAndPadding(lineSeparator2);
      }
    }
 else {
      super.appendIgnoringWhitespaceAndPadding(ch);
    }
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    expandAndRetry();
    appendIgnoringPadding(ch);
  }
}
Program: 163381
Project: 163381
Buggy source:
/** 
 * Appends the given character and marks it as ignored if it is a whitespace (  {@code ch <= ' '}) <p>If the given character is equal to   {@link Format#getNormalizedNewline()}, then the character sequence returned by   {@link Format#getLineSeparator()} is going to be appended.
 * @param ch character to append
 */
@Override public void appendIgnoringWhitespace(char ch){
  try {
    if (ch == newLine) {
      super.appendIgnoringWhitespace(lineSeparator1);
      if (lineSeparator2 != '\0') {
        super.appendIgnoringWhitespace(lineSeparator2);
      }
    }
 else {
      super.appendIgnoringWhitespace(ch);
    }
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    expandAndRetry();
    appendIgnoringPadding(ch);
  }
}

Fixed version (ground truth):
/** 
 * Appends the given character and marks it as ignored if it is a whitespace (  {@code ch <= ' '}) <p/> <p>If the given character is equal to   {@link Format#getNormalizedNewline()}, then the character sequence returned by   {@link Format#getLineSeparator()} is going to be appended.
 * @param ch character to append
 */
@Override public void appendIgnoringWhitespace(char ch){
  try {
    if (ch == newLine && denormalizeLineEndings) {
      super.appendIgnoringWhitespace(lineSeparator1);
      if (lineSeparator2 != '\0') {
        super.appendIgnoringWhitespace(lineSeparator2);
      }
    }
 else {
      super.appendIgnoringWhitespace(ch);
    }
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    expandAndRetry();
    appendIgnoringPadding(ch);
  }
}
Program: 163382
Project: 163382
Buggy source:
/** 
 * Appends the given character and marks it as ignored if it is a padding character (depends on the character given as the value for the   {@link WriterCharAppender#padding} attribute in the constructor)<p>If the given character is equal to  {@link Format#getNormalizedNewline()}, then the character sequence returned by   {@link Format#getLineSeparator()} is going to be appended.
 * @param ch character to append
 */
@Override public void appendIgnoringPadding(char ch){
  try {
    if (ch == newLine) {
      super.appendIgnoringPadding(lineSeparator1);
      if (lineSeparator2 != '\0') {
        super.appendIgnoringPadding(lineSeparator2);
      }
    }
 else {
      super.appendIgnoringPadding(ch);
    }
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    expandAndRetry();
    appendIgnoringPadding(ch);
  }
}

Fixed version (ground truth):
/** 
 * Appends the given character and marks it as ignored if it is a padding character (depends on the character given as the value for the   {@link WriterCharAppender#padding} attribute in the constructor)<p/> <p>If the given character is equal to  {@link Format#getNormalizedNewline()}, then the character sequence returned by   {@link Format#getLineSeparator()} is going to be appended.
 * @param ch character to append
 */
@Override public void appendIgnoringPadding(char ch){
  try {
    if (ch == newLine && denormalizeLineEndings) {
      super.appendIgnoringPadding(lineSeparator1);
      if (lineSeparator2 != '\0') {
        super.appendIgnoringPadding(lineSeparator2);
      }
    }
 else {
      super.appendIgnoringPadding(ch);
    }
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    expandAndRetry();
    appendIgnoringPadding(ch);
  }
}
Program: 163383
Project: 163383
Buggy source:
/** 
 * Creates a WriterCharAppender with: <ul> <li>a maximum limit of characters to append</li> <li>the default value to return when no characters have been accumulated.</li> <li>the basic   {@link Format} specification for handling newlines</li></ul> The padding character is defaulted to a whitespace character ' '.
 * @param maxLength  maximum limit of characters to append
 * @param emptyValue default value to return when no characters have been accumulated
 * @param padding    the padding character to ignore when calling {@link WriterCharAppender#appendIgnoringWhitespaceAndPadding(char)}.
 * @param format     the output format specification used for newline handling
 */
public WriterCharAppender(int maxLength,String emptyValue,char padding,Format format){
  super(maxLength,emptyValue,padding);
  char[] lineSeparator=format.getLineSeparator();
  this.lineSeparator1=lineSeparator[0];
  this.lineSeparator2=lineSeparator.length > 1 ? lineSeparator[1] : '\0';
  newLine=format.getNormalizedNewline();
}

Fixed version (ground truth):
/** 
 * Creates a WriterCharAppender with: <ul> <li>a maximum limit of characters to append</li> <li>the default value to return when no characters have been accumulated.</li> <li>the basic   {@link Format} specification for handling newlines</li></ul> <p/> The padding character is defaulted to a whitespace character ' '.
 * @param maxLength  maximum limit of characters to append
 * @param emptyValue default value to return when no characters have been accumulated
 * @param padding    the padding character to ignore when calling {@link WriterCharAppender#appendIgnoringWhitespaceAndPadding(char)}.
 * @param format     the output format specification used for newline handling
 */
public WriterCharAppender(int maxLength,String emptyValue,char padding,Format format){
  super(maxLength,emptyValue,padding);
  char[] lineSeparator=format.getLineSeparator();
  this.lineSeparator1=lineSeparator[0];
  this.lineSeparator2=lineSeparator.length > 1 ? lineSeparator[1] : '\0';
  newLine=format.getNormalizedNewline();
}
Program: 163384
Project: 163384
Buggy source:
Annotation buildBooleanStringAnnotation(final String[] trueStrings,final String[] falseStrings){
  return new com.univocity.parsers.annotations.BooleanString(){
    @Override public String[] trueStrings(){
      return trueStrings == null ? ArgumentUtils.EMPTY_STRING_ARRAY : trueStrings;
    }
    @Override public String[] falseStrings(){
      return falseStrings == null ? ArgumentUtils.EMPTY_STRING_ARRAY : falseStrings;
    }
    @Override public Class<? extends Annotation> annotationType(){
      return com.univocity.parsers.annotations.BooleanString.class;
    }
  }
;
}

Fixed version (ground truth):
static Annotation buildBooleanStringAnnotation(final String[] trueStrings,final String[] falseStrings){
  return new com.univocity.parsers.annotations.BooleanString(){
    @Override public String[] trueStrings(){
      return trueStrings == null ? ArgumentUtils.EMPTY_STRING_ARRAY : trueStrings;
    }
    @Override public String[] falseStrings(){
      return falseStrings == null ? ArgumentUtils.EMPTY_STRING_ARRAY : falseStrings;
    }
    @Override public Class<? extends Annotation> annotationType(){
      return com.univocity.parsers.annotations.BooleanString.class;
    }
  }
;
}
Program: 163385
Project: 163385
Buggy source:
private Annotation newFormatAnnotation(final String format,final String... formatOptions){
  return new com.univocity.parsers.annotations.Format(){
    @Override public String[] formats(){
      return new String[]{format};
    }
    @Override public String[] options(){
      return formatOptions;
    }
    @Override public Class<? extends Annotation> annotationType(){
      return com.univocity.parsers.annotations.Format.class;
    }
  }
;
}

Fixed version (ground truth):
private static Annotation newFormatAnnotation(final String format,final String... formatOptions){
  return new com.univocity.parsers.annotations.Format(){
    @Override public String[] formats(){
      return new String[]{format};
    }
    @Override public String[] options(){
      return formatOptions;
    }
    @Override public Class<? extends Annotation> annotationType(){
      return com.univocity.parsers.annotations.Format.class;
    }
  }
;
}
Program: 163386
Project: 163386
Buggy source:
private void parseField(){
  if (ch <= ' ' && ignoreLeadingWhitespace) {
    skipWhitespace();
  }
  if (ch == delimiter) {
    output.emptyParsed();
  }
 else {
    if (ch == quote) {
      parseQuotedValue('\0');
    }
 else     if (doNotEscapeUnquotedValues) {
      parseValue();
    }
 else {
      parseValueProcessingEscape();
    }
    output.valueParsed();
  }
}

Fixed version (ground truth):
private void parseField(){
  if (ch <= ' ' && ignoreLeadingWhitespace) {
    skipWhitespace();
  }
  if (ch == delimiter) {
    output.emptyParsed();
  }
 else {
    if (ch == quote) {
      if (normalizeLineEndingsInQuotes) {
        parseQuotedValue('\0');
      }
 else {
        input.enableNormalizeLineEndings(false);
        parseQuotedValue('\0');
        input.enableNormalizeLineEndings(true);
      }
    }
 else     if (doNotEscapeUnquotedValues) {
      parseValue();
    }
 else {
      parseValueProcessingEscape();
    }
    output.valueParsed();
  }
}
Program: 163387
Project: 163387
Buggy source:
/** 
 * The CsvParser supports all settings provided by   {@link CsvParserSettings}, and requires this configuration to be properly initialized.
 * @param settings the parser configuration
 */
public CsvParser(CsvParserSettings settings){
  super(settings);
  ignoreTrailingWhitespace=settings.getIgnoreTrailingWhitespaces();
  ignoreLeadingWhitespace=settings.getIgnoreLeadingWhitespaces();
  parseUnescapedQuotes=settings.isParseUnescapedQuotes();
  doNotEscapeUnquotedValues=!settings.isEscapeUnquotedValues();
  keepEscape=settings.isKeepEscapeSequences();
  CsvFormat format=settings.getFormat();
  delimiter=format.getDelimiter();
  quote=format.getQuote();
  quoteEscape=format.getQuoteEscape();
  escapeEscape=format.getCharToEscapeQuoteEscaping();
  newLine=format.getNormalizedNewline();
  whitespaceAppender=new DefaultCharAppender(settings.getMaxCharsPerColumn(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * The CsvParser supports all settings provided by   {@link CsvParserSettings}, and requires this configuration to be properly initialized.
 * @param settings the parser configuration
 */
public CsvParser(CsvParserSettings settings){
  super(settings);
  ignoreTrailingWhitespace=settings.getIgnoreTrailingWhitespaces();
  ignoreLeadingWhitespace=settings.getIgnoreLeadingWhitespaces();
  parseUnescapedQuotes=settings.isParseUnescapedQuotes();
  doNotEscapeUnquotedValues=!settings.isEscapeUnquotedValues();
  keepEscape=settings.isKeepEscapeSequences();
  normalizeLineEndingsInQuotes=settings.isNormalizeLineEndingsWithinQuotes();
  CsvFormat format=settings.getFormat();
  delimiter=format.getDelimiter();
  quote=format.getQuote();
  quoteEscape=format.getQuoteEscape();
  escapeEscape=format.getCharToEscapeQuoteEscaping();
  newLine=format.getNormalizedNewline();
  whitespaceAppender=new DefaultCharAppender(settings.getMaxCharsPerColumn(),"String_Node_Str");
}
Program: 163389
Project: 163389
Buggy source:
@Override public String[] headers(){
  return fieldNames;
}

Fixed version (ground truth):
@Override public String[] headers(){
  return fieldNames == null || fieldNames.length == 0 ? context.headers() : fieldNames;
}
Program: 163390
Project: 163390
Buggy source:
@Override public final void rowProcessed(String[] row,ParsingContext context){
  RowProcessor processor=switchRowProcessor(row,context);
  if (processor == null) {
    processor=NoopRowProcessor.instance;
  }
  if (processor != selectedRowProcessor) {
    contextForProcessor=rowProcessors.get(processor);
    if (contextForProcessor == null) {
      contextForProcessor=new ParsingContextWrapper(context){
        private final String[] fieldNames=getHeaders();
        @Override public String[] headers(){
          return fieldNames;
        }
      }
;
      processor.processStarted(contextForProcessor);
      rowProcessors.put(processor,contextForProcessor);
    }
    if (selectedRowProcessor != NoopRowProcessor.instance) {
      rowProcessorSwitched(selectedRowProcessor,processor);
    }
    selectedRowProcessor=processor;
    selectedRowProcessor.rowProcessed(row,contextForProcessor);
  }
 else {
    selectedRowProcessor.rowProcessed(row,contextForProcessor);
  }
}

Fixed version (ground truth):
@Override public final void rowProcessed(String[] row,final ParsingContext context){
  RowProcessor processor=switchRowProcessor(row,context);
  if (processor == null) {
    processor=NoopRowProcessor.instance;
  }
  if (processor != selectedRowProcessor) {
    contextForProcessor=rowProcessors.get(processor);
    if (contextForProcessor == null) {
      contextForProcessor=new ParsingContextWrapper(context){
        private final String[] fieldNames=getHeaders();
        @Override public String[] headers(){
          return fieldNames == null || fieldNames.length == 0 ? context.headers() : fieldNames;
        }
      }
;
      processor.processStarted(contextForProcessor);
      rowProcessors.put(processor,contextForProcessor);
    }
    if (selectedRowProcessor != NoopRowProcessor.instance) {
      rowProcessorSwitched(selectedRowProcessor,processor);
    }
    selectedRowProcessor=processor;
    selectedRowProcessor.rowProcessed(row,contextForProcessor);
  }
 else {
    selectedRowProcessor.rowProcessed(row,contextForProcessor);
  }
}
Program: 163391
Project: 163391
Buggy source:
/** 
 * Closes the   {@link java.io.Writer} given in this class constructor.<p> An IllegalStateException will be thrown in case of any errors.
 */
public final void close(){
  try {
    this.headerIndexes=null;
    if (writer != null) {
      try {
        writer.flush();
      }
  finally {
        writer.close();
      }
    }
  }
 catch (  Throwable ex) {
    throw new IllegalStateException("String_Node_Str",ex);
  }
}

Fixed version (ground truth):
/** 
 * Closes the   {@link java.io.Writer} given in this class constructor.<p> An IllegalStateException will be thrown in case of any errors.
 */
public final void close(){
  try {
    this.headerIndexes=null;
    if (writer != null) {
      try {
        writer.flush();
      }
  finally {
        writer.close();
      }
    }
  }
 catch (  Throwable ex) {
    throw new IllegalStateException("String_Node_Str",ex);
  }
  if (this.partialLineIndex != 0) {
    throw new TextWritingException("String_Node_Str" + "String_Node_Str",recordCount,Arrays.copyOf(partialLine,partialLineIndex));
  }
}
Program: 163393
Project: 163393
Buggy source:
/** 
 * The TsvParser supports all settings provided by   {@link TsvParserSettings}, and requires this configuration to be properly initialized.
 * @param settings the parser configuration
 */
public TsvParser(TsvParserSettings settings){
  super(settings);
  ignoreTrailingWhitespace=settings.getIgnoreTrailingWhitespaces();
  ignoreLeadingWhitespace=settings.getIgnoreLeadingWhitespaces();
  TsvFormat format=settings.getFormat();
  newLine=format.getNormalizedNewline();
  escapeChar=settings.getFormat().getEscapeChar();
}

Fixed version (ground truth):
/** 
 * The TsvParser supports all settings provided by   {@link TsvParserSettings}, and requires this configuration to be properly initialized.
 * @param settings the parser configuration
 */
public TsvParser(TsvParserSettings settings){
  super(settings);
  ignoreTrailingWhitespace=settings.getIgnoreTrailingWhitespaces();
  ignoreLeadingWhitespace=settings.getIgnoreLeadingWhitespaces();
  joinLines=settings.isLineJoiningEnabled();
  TsvFormat format=settings.getFormat();
  newLine=format.getNormalizedNewline();
  escapeChar=settings.getFormat().getEscapeChar();
}
Program: 163394
Project: 163394
Buggy source:
/** 
 * Initializes the TSV writer with TSV-specific configuration
 * @param settings the TSV writer configuration
 */
protected final void initialize(TsvWriterSettings settings){
  this.escapeChar=settings.getFormat().getEscapeChar();
  this.ignoreLeading=settings.getIgnoreLeadingWhitespaces();
  this.ignoreTrailing=settings.getIgnoreTrailingWhitespaces();
}

Fixed version (ground truth):
/** 
 * Initializes the TSV writer with TSV-specific configuration
 * @param settings the TSV writer configuration
 */
protected final void initialize(TsvWriterSettings settings){
  this.escapeChar=settings.getFormat().getEscapeChar();
  this.ignoreLeading=settings.getIgnoreLeadingWhitespaces();
  this.ignoreTrailing=settings.getIgnoreTrailingWhitespaces();
  this.joinLines=settings.isLineJoiningEnabled();
  this.newLine=settings.getFormat().getNormalizedNewline();
}
Program: 163395
Project: 163395
Buggy source:
private void append(String element){
  if (element == null) {
    element=nullValue;
  }
  if (element == null) {
    return;
  }
  int start=0;
  if (this.ignoreLeading) {
    start=skipLeadingWhitespace(element);
  }
  if (this.ignoreTrailing) {
    for (int i=start; i < element.length(); i++) {
      char ch=element.charAt(i);
      if (ch == '\t') {
        appender.append(escapeChar);
        appender.append('t');
      }
 else       if (ch == '\n') {
        appender.append(escapeChar);
        appender.append('n');
      }
 else       if (ch == '\\') {
        appender.append(escapeChar);
        appender.append('\\');
      }
 else       if (ch == '\r') {
        appender.append(escapeChar);
        appender.append('r');
      }
 else {
        appender.appendIgnoringWhitespace(ch);
      }
    }
  }
 else {
    for (int i=start; i < element.length(); i++) {
      char ch=element.charAt(i);
      if (ch == '\t') {
        appender.append(escapeChar);
        appender.append('t');
      }
 else       if (ch == '\n') {
        appender.append(escapeChar);
        appender.append('n');
      }
 else       if (ch == '\\') {
        appender.append(escapeChar);
        appender.append('\\');
      }
 else       if (ch == '\r') {
        appender.append(escapeChar);
        appender.append('r');
      }
 else {
        appender.append(ch);
      }
    }
  }
}

Fixed version (ground truth):
private void append(String element){
  if (element == null) {
    element=nullValue;
  }
  if (element == null) {
    return;
  }
  int start=0;
  if (this.ignoreLeading) {
    start=skipLeadingWhitespace(element);
  }
  if (this.ignoreTrailing) {
    for (int i=start; i < element.length(); i++) {
      char ch=element.charAt(i);
      if (ch == '\t') {
        appender.append(escapeChar);
        appender.append('t');
      }
 else       if (ch == '\n') {
        appender.append(escapeChar);
        appender.append(joinLines ? newLine : 'n');
      }
 else       if (ch == '\\') {
        appender.append(escapeChar);
        appender.append('\\');
      }
 else       if (ch == '\r') {
        appender.append(escapeChar);
        appender.append(joinLines ? newLine : 'r');
      }
 else {
        appender.appendIgnoringWhitespace(ch);
      }
    }
  }
 else {
    for (int i=start; i < element.length(); i++) {
      char ch=element.charAt(i);
      if (ch == '\t') {
        appender.append(escapeChar);
        appender.append('t');
      }
 else       if (ch == '\n') {
        appender.append(escapeChar);
        appender.append(joinLines ? newLine : 'n');
      }
 else       if (ch == '\\') {
        appender.append(escapeChar);
        appender.append('\\');
      }
 else       if (ch == '\r') {
        appender.append(escapeChar);
        appender.append(joinLines ? newLine : 'r');
      }
 else {
        appender.append(ch);
      }
    }
  }
}
Program: 163396
Project: 163396
Buggy source:
@Test(enabled=true,dataProvider="String_Node_Str") public void writeSelectedColumnOnlyToString(boolean quoteAllFields,char[] lineSeparator) throws Exception {
  TsvWriterSettings settings=new TsvWriterSettings();
  String[] expectedHeaders=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  settings.getFormat().setLineSeparator(lineSeparator);
  settings.setIgnoreLeadingWhitespaces(false);
  settings.setIgnoreTrailingWhitespaces(false);
  settings.setHeaders(expectedHeaders);
  settings.selectFields("String_Node_Str","String_Node_Str");
  TsvWriter writer=new TsvWriter(settings);
  Object[][] input=new Object[][]{{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{null,null},{"String_Node_Str",null},{"String_Node_Str","String_Node_Str"}};
  String headers=writer.writeHeadersToString();
  assertEquals(headers,"String_Node_Str");
  List<String> rowList=writer.writeRowsToString(input);
  assertEquals(rowList.get(0),"String_Node_Str");
  assertEquals(rowList.get(1),"String_Node_Str");
  assertEquals(rowList.get(2),"String_Node_Str");
  assertEquals(rowList.get(3),"String_Node_Str");
  assertEquals(rowList.get(4),"String_Node_Str");
  assertEquals(rowList.get(5),"String_Node_Str");
  assertEquals(rowList.get(6),"String_Node_Str");
  assertEquals(rowList.get(7),"String_Node_Str");
}

Fixed version (ground truth):
@Test(enabled=true,dataProvider="String_Node_Str") public void writeSelectedColumnOnlyToString(char[] lineSeparator) throws Exception {
  TsvWriterSettings settings=new TsvWriterSettings();
  String[] expectedHeaders=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  settings.getFormat().setLineSeparator(lineSeparator);
  settings.setIgnoreLeadingWhitespaces(false);
  settings.setIgnoreTrailingWhitespaces(false);
  settings.setHeaders(expectedHeaders);
  settings.selectFields("String_Node_Str","String_Node_Str");
  TsvWriter writer=new TsvWriter(settings);
  Object[][] input=new Object[][]{{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"},{null,null},{"String_Node_Str",null},{"String_Node_Str","String_Node_Str"}};
  String headers=writer.writeHeadersToString();
  assertEquals(headers,"String_Node_Str");
  List<String> rowList=writer.writeRowsToString(input);
  assertEquals(rowList.get(0),"String_Node_Str");
  assertEquals(rowList.get(1),"String_Node_Str");
  assertEquals(rowList.get(2),"String_Node_Str");
  assertEquals(rowList.get(3),"String_Node_Str");
  assertEquals(rowList.get(4),"String_Node_Str");
  assertEquals(rowList.get(5),"String_Node_Str");
  assertEquals(rowList.get(6),"String_Node_Str");
  assertEquals(rowList.get(7),"String_Node_Str");
}
Program: 163399
Project: 163399
Buggy source:
@DataProvider public Object[][] lineSeparatorProvider(){
  return new Object[][]{{false,new char[]{'\n'}},{true,new char[]{'\r','\n'}},{true,new char[]{'\n'}},{false,new char[]{'\r','\n'}}};
}

Fixed version (ground truth):
@DataProvider public Object[][] lineSeparatorProvider(){
  return new Object[][]{{new char[]{'\n'}},{new char[]{'\r','\n'}},{new char[]{'\n'}},{new char[]{'\r','\n'}}};
}
Program: 163400
Project: 163400
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int[] getFieldIndexes(String[] headers){
  headers=ArgumentUtils.normalize(headers);
  List<String> var=this.get();
  ArgumentUtils.normalize(var);
  String[] chosenFields=var.toArray(new String[var.size()]);
  Object[] unknownFields=ArgumentUtils.findMissingElements(headers,chosenFields);
  if (unknownFields.length > 0 && !var.containsAll(Arrays.asList(headers))) {
    throw new IllegalStateException("String_Node_Str" + Arrays.toString(unknownFields) + "String_Node_Str"+ Arrays.toString(headers));
  }
  int[] out=new int[chosenFields.length];
  int i=0;
  Set<Integer> indexesTaken=new HashSet<Integer>();
  for (  String chosenField : chosenFields) {
    int index=ArgumentUtils.indexOf(headers,chosenField);
    if (index != -1) {
      indexesTaken.add(index);
    }
    out[i++]=index;
  }
  int generatedIndex=0;
  for (i=0; i < out.length; i++) {
    if (out[i] == -1) {
      while (indexesTaken.contains(generatedIndex)) {
        generatedIndex++;
      }
      indexesTaken.add(generatedIndex);
      out[i]=generatedIndex;
    }
  }
  return out;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int[] getFieldIndexes(String[] headers){
  headers=ArgumentUtils.normalize(headers);
  List<String> selection=this.get();
  ArgumentUtils.normalize(selection);
  String[] chosenFields=selection.toArray(new String[selection.size()]);
  Object[] unknownFields=ArgumentUtils.findMissingElements(headers,chosenFields);
  if (unknownFields.length > 0 && !selection.containsAll(Arrays.asList(headers))) {
    if (unknownFields.length == chosenFields.length) {
      return new int[0];
    }
  }
  int[] out=new int[chosenFields.length];
  int i=0;
  Set<Integer> indexesTaken=new HashSet<Integer>();
  for (  String chosenField : chosenFields) {
    int index=ArgumentUtils.indexOf(headers,chosenField);
    if (index != -1) {
      indexesTaken.add(index);
    }
    out[i++]=index;
  }
  int generatedIndex=0;
  for (i=0; i < out.length; i++) {
    if (out[i] == -1) {
      while (indexesTaken.contains(generatedIndex)) {
        generatedIndex++;
      }
      indexesTaken.add(generatedIndex);
      out[i]=generatedIndex;
    }
  }
  return out;
}
Program: 163401
Project: 163401
Buggy source:
/** 
 * Requests the next batch of characters from the implementing class and updates the character count. <p> If there are no more characters in the input, the reading will stop by invoking the   {@link AbstractCharInputReader#stop()} method.
 */
private void updateBuffer(){
  reloadBuffer();
  charCount+=i;
  i=0;
  if (length == -1) {
    stop();
  }
  if (inputAnalysisProcesses != null) {
    try {
      for (      InputAnalysisProcess process : inputAnalysisProcesses) {
        process.execute(buffer,length);
      }
    }
  finally {
      inputAnalysisProcesses=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Requests the next batch of characters from the implementing class and updates the character count. <p> If there are no more characters in the input, the reading will stop by invoking the   {@link AbstractCharInputReader#stop()} method.
 */
private void updateBuffer(){
  reloadBuffer();
  charCount+=i;
  i=0;
  if (length == -1) {
    stop();
    incrementLineCount=true;
  }
  if (inputAnalysisProcesses != null) {
    try {
      for (      InputAnalysisProcess process : inputAnalysisProcesses) {
        process.execute(buffer,length);
      }
    }
  finally {
      inputAnalysisProcesses=null;
    }
  }
}
Program: 163402
Project: 163402
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public final char nextChar(){
  if (length == -1) {
    throw new EOFException();
  }
  char ch=buffer[i - 1];
  if (i >= length) {
    updateBuffer();
  }
  i++;
  if (lineSeparator1 == ch && (lineSeparator2 == '\0' || lineSeparator2 == buffer[i - 1])) {
    lineCount++;
    if (lineSeparator2 != '\0') {
      ch=normalizedLineSeparator;
      if (i >= length) {
        if (length != -1) {
          updateBuffer();
        }
 else {
          throw new EOFException();
        }
      }
      if (i < length) {
        i++;
      }
    }
 else {
      return normalizedLineSeparator;
    }
  }
  return ch;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public final char nextChar(){
  if (length == -1) {
    throwEOFException();
  }
  char ch=buffer[i - 1];
  if (i >= length) {
    updateBuffer();
  }
  i++;
  if (lineSeparator1 == ch && (lineSeparator2 == '\0' || length != -1 && lineSeparator2 == buffer[i - 1])) {
    lineCount++;
    if (lineSeparator2 != '\0') {
      ch=normalizedLineSeparator;
      if (i >= length) {
        if (length != -1) {
          updateBuffer();
        }
 else {
          throwEOFException();
        }
      }
      if (i < length) {
        i++;
      }
    }
 else {
      return normalizedLineSeparator;
    }
  }
  return ch;
}
Program: 163405
Project: 163405
Buggy source:
/** 
 * Creates the mapping and identifies how it is mapped (by name or by index)
 * @param beanClass the class that contains a the given field.
 * @param field a {@link java.lang.reflect.Field} annotated with {@link Parsed}
 * @param property the property descriptor of this field, if any. If this bean does not have getters/setters, it will be accessed directly.
 */
public FieldMapping(Class<?> beanClass,Field field,PropertyDescriptor property){
  this.beanClass=beanClass;
  this.field=field;
  this.readMethod=property != null ? property.getReadMethod() : null;
  this.writeMethod=property != null ? property.getWriteMethod() : null;
  determineFieldMapping();
}

Fixed version (ground truth):
/** 
 * Creates the mapping and identifies how it is mapped (by name or by index)
 * @param beanClass the class that contains a the given field.
 * @param field a {@link java.lang.reflect.Field} annotated with {@link Parsed}
 * @param property the property descriptor of this field, if any. If this bean does not have getters/setters, it will be accessed directly.
 */
public FieldMapping(Class<?> beanClass,Field field,PropertyWrapper property){
  this.beanClass=beanClass;
  this.field=field;
  this.readMethod=property != null ? property.getReadMethod() : null;
  this.writeMethod=property != null ? property.getWriteMethod() : null;
  determineFieldMapping();
}
Program: 163406
Project: 163406
Buggy source:
/** 
 * Identifies and extracts fields annotated with the   {@link Parsed} annotation
 */
public final void initialize(){
  if (!initialized) {
    initialized=true;
    Map<String,PropertyDescriptor> properties=new HashMap<String,PropertyDescriptor>();
    try {
      BeanInfo beanInfo=Introspector.getBeanInfo(beanClass,Object.class);
      for (      PropertyDescriptor property : beanInfo.getPropertyDescriptors()) {
        String name=property.getName();
        properties.put(name,property);
      }
    }
 catch (    IntrospectionException e) {
    }
    Set<String> used=new HashSet<String>();
    Class<?> clazz=beanClass;
    do {
      Field[] declared=clazz.getDeclaredFields();
      for (      Field field : declared) {
        if (used.contains(field.getName())) {
          continue;
        }
        used.add(field.getName());
        processField(field,properties.get(field.getName()));
      }
      clazz=clazz.getSuperclass();
    }
 while (clazz != null && clazz != Object.class);
    readOrder=null;
    lastFieldIndexMapped=-1;
    validateMappings();
  }
}

Fixed version (ground truth):
/** 
 * Identifies and extracts fields annotated with the   {@link Parsed} annotation
 */
public final void initialize(){
  if (!initialized) {
    initialized=true;
    Map<String,PropertyWrapper> properties=new HashMap<String,PropertyWrapper>();
    try {
      for (      PropertyWrapper property : BeanHelper.getPropertyDescriptors(beanClass)) {
        String name=property.getName();
        if (name != null) {
          properties.put(name,property);
        }
      }
    }
 catch (    Exception e) {
    }
    Set<String> used=new HashSet<String>();
    Class<?> clazz=beanClass;
    do {
      Field[] declared=clazz.getDeclaredFields();
      for (      Field field : declared) {
        if (used.contains(field.getName())) {
          continue;
        }
        used.add(field.getName());
        processField(field,properties.get(field.getName()));
      }
      clazz=clazz.getSuperclass();
    }
 while (clazz != null && clazz != Object.class);
    readOrder=null;
    lastFieldIndexMapped=-1;
    validateMappings();
  }
}
Program: 163407
Project: 163407
Buggy source:
/** 
 * Normalizes the Strings in a given array by trimming all elements and converting them to lower case.
 * @param strings a String collection with elements to be normalized. The original contents of the collection will be modified.
 */
public static void normalize(Collection<String> strings){
  HashSet<String> normalized=new HashSet<String>(strings.size());
  for (  String string : strings) {
    if (string == null) {
      normalized.add(null);
    }
 else {
      normalized.add(string.trim().toLowerCase());
    }
  }
  strings.clear();
  strings.addAll(normalized);
}

Fixed version (ground truth):
/** 
 * Normalizes the Strings in a given array by trimming all elements and converting them to lower case.
 * @param strings a String collection with elements to be normalized. The original contents of the collection will be modified.
 */
public static void normalize(Collection<String> strings){
  LinkedHashSet<String> normalized=new LinkedHashSet<String>(strings.size());
  for (  String string : strings) {
    if (string == null) {
      normalized.add(null);
    }
 else {
      normalized.add(string.trim().toLowerCase());
    }
  }
  strings.clear();
  strings.addAll(normalized);
}
Program: 163408
Project: 163408
Buggy source:
private void initializeConversions(String[] row,ParsingContext context){
  conversionsInitialized=true;
  this.fieldIndexes=null;
  this.fieldsReordered=false;
  this.conversionsInitialized=false;
  if (context.headers() != null && context.headers().length > 0) {
    conversions.prepareExecution(context.headers());
  }
 else {
    conversions.prepareExecution(row);
  }
  this.fieldIndexes=context.extractedFieldIndexes();
  this.fieldsReordered=context.columnsReordered();
}

Fixed version (ground truth):
private void initializeConversions(String[] row,ParsingContext context){
  conversionsInitialized=true;
  this.fieldIndexes=null;
  this.fieldsReordered=false;
  this.conversionsInitialized=false;
  if (context.headers() != null && context.headers().length > 0) {
    conversions.prepareExecution(false,context.headers());
  }
 else {
    conversions.prepareExecution(false,row);
  }
  this.fieldIndexes=context.extractedFieldIndexes();
  this.fieldsReordered=context.columnsReordered();
}
Program: 163410
Project: 163410
Buggy source:
private int getExtractedColumnIndex(){
  if (this.extractedIndexes != null && columnIndex < extractedIndexes.length) {
    return extractedIndexes[columnIndex];
  }
  return columnIndex;
}

Fixed version (ground truth):
private int getExtractedColumnIndex(){
  if (this.extractedIndexes != null && columnIndex < extractedIndexes.length && columnIndex > -1) {
    return extractedIndexes[columnIndex];
  }
  return columnIndex;
}
Program: 163412
Project: 163412
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public int[] getFieldIndexes(String[] headers){
  headers=ArgumentUtils.normalize(headers);
  List<String> var=this.get();
  String[] chosenFields=ArgumentUtils.normalize(var.toArray(new String[var.size()]));
  Object[] unknownFields=ArgumentUtils.findMissingElements(headers,chosenFields);
  if (unknownFields.length > 0) {
    throw new IllegalStateException("String_Node_Str" + Arrays.toString(unknownFields) + "String_Node_Str"+ Arrays.toString(headers));
  }
  int[] out=new int[chosenFields.length];
  int i=0;
  for (  String chosenField : chosenFields) {
    out[i++]=ArgumentUtils.indexOf(headers,chosenField);
  }
  return out;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int[] getFieldIndexes(String[] headers){
  headers=ArgumentUtils.normalize(headers);
  List<String> var=this.get();
  ArgumentUtils.normalize(var);
  String[] chosenFields=var.toArray(new String[var.size()]);
  Object[] unknownFields=ArgumentUtils.findMissingElements(headers,chosenFields);
  if (unknownFields.length > 0 && !var.containsAll(Arrays.asList(headers))) {
    throw new IllegalStateException("String_Node_Str" + Arrays.toString(unknownFields) + "String_Node_Str"+ Arrays.toString(headers));
  }
  int[] out=new int[chosenFields.length];
  int i=0;
  Set<Integer> indexesTaken=new HashSet<Integer>();
  for (  String chosenField : chosenFields) {
    int index=ArgumentUtils.indexOf(headers,chosenField);
    if (index != -1) {
      indexesTaken.add(index);
    }
    out[i++]=index;
  }
  int generatedIndex=0;
  for (i=0; i < out.length; i++) {
    if (out[i] == -1) {
      while (indexesTaken.contains(generatedIndex)) {
        generatedIndex++;
      }
      indexesTaken.add(generatedIndex);
      out[i]=generatedIndex;
    }
  }
  return out;
}
Program: 163414
Project: 163414
Buggy source:
private void initalizeMetadataConversions(String[] data,MetaData md){
  if (conversions != null) {
    String[] headers=headers();
    if (headers == null) {
      headers=data;
    }
    conversions.prepareExecution(headers);
    md.setDefaultConversions(conversions.getConversions(md.index,md.type));
  }
}

Fixed version (ground truth):
private void initalizeMetadataConversions(String[] data,MetaData md){
  if (conversions != null) {
    String[] headers=headers();
    if (headers == null) {
      headers=data;
    }
    conversions.prepareExecution(false,headers);
    md.setDefaultConversions(conversions.getConversions(md.index,md.type));
  }
}