Program: 163365
Project: 163365
Buggy source:
@Override protected void parseRecord(){
  if (ch == newLine && skipEmptyLines) {
    return;
  }
  boolean matched=false;
  if (lookaheadFormats != null || lookbehindFormats != null) {
    if (initializeLookaheadInput) {
      initializeLookaheadInput=false;
      this.lookaheadInput=new LookaheadCharInputReader(input,newLine);
      this.input=lookaheadInput;
    }
    lookaheadInput.lookahead(maxLookupLength);
    if (lookaheadFormats != null) {
      for (int i=0; i < lookaheadFormats.length; i++) {
        if (lookaheadInput.matches(ch,lookaheadFormats[i].value)) {
          lengths=lookaheadFormats[i].lengths;
          lookupFormat=lookaheadFormats[i];
          matched=true;
          break;
        }
      }
      if (lookbehindFormats != null && matched) {
        lookbehindFormat=null;
        for (int i=0; i < lookbehindFormats.length; i++) {
          if (lookaheadInput.matches(ch,lookbehindFormats[i].value)) {
            lookbehindFormat=lookbehindFormats[i];
            break;
          }
        }
      }
    }
 else {
      for (int i=0; i < lookbehindFormats.length; i++) {
        if (lookaheadInput.matches(ch,lookbehindFormats[i].value)) {
          lookbehindFormat=lookbehindFormats[i];
          matched=true;
          lengths=rootLengths;
          break;
        }
      }
    }
    if (!matched) {
      if (lookbehindFormat == null) {
        if (rootLengths == null) {
          throw new TextParsingException(context,"String_Node_Str" + lookaheadInput.getLookahead(ch) + '\'');
        }
        lengths=rootLengths;
        alignments=rootAlignments;
        paddings=rootPaddings;
        lookupFormat=null;
      }
 else {
        lengths=lookbehindFormat.lengths;
        alignments=lookbehindFormat.alignments;
        paddings=lookbehindFormat.paddings;
        lookupFormat=lookbehindFormat;
      }
    }
  }
  int i;
  for (i=0; i < lengths.length; i++) {
    length=lengths[i];
    if (paddings != null) {
      padding=useDefaultPadding ? defaultPadding : paddings[i];
    }
    if (alignments != null) {
      alignment=alignments[i];
    }
    skipPadding();
    if (ignoreLeadingWhitespace) {
      skipWhitespace();
    }
    if (recordEndsOnNewLine) {
      readValueUntilNewLine();
      if (ch == newLine) {
        output.valueParsed();
        useDefaultPadding=false;
        return;
      }
    }
 else {
      readValue();
    }
    output.valueParsed();
  }
  if (skipToNewLine) {
    skipToNewLine();
  }
  useDefaultPadding=false;
}

Fixed version (ground truth):
@Override protected void parseRecord(){
  if (ch == newLine && skipEmptyLines) {
    return;
  }
  boolean matched=false;
  if (lookaheadFormats != null || lookbehindFormats != null) {
    if (initializeLookaheadInput) {
      initializeLookaheadInput=false;
      this.lookaheadInput=new LookaheadCharInputReader(input,newLine);
      this.input=lookaheadInput;
    }
    lookaheadInput.lookahead(maxLookupLength);
    if (lookaheadFormats != null) {
      for (int i=0; i < lookaheadFormats.length; i++) {
        if (lookaheadInput.matches(ch,lookaheadFormats[i].value)) {
          lengths=lookaheadFormats[i].lengths;
          lookupFormat=lookaheadFormats[i];
          matched=true;
          break;
        }
      }
      if (lookbehindFormats != null && matched) {
        lookbehindFormat=null;
        for (int i=0; i < lookbehindFormats.length; i++) {
          if (lookaheadInput.matches(ch,lookbehindFormats[i].value)) {
            lookbehindFormat=lookbehindFormats[i];
            break;
          }
        }
      }
    }
 else {
      for (int i=0; i < lookbehindFormats.length; i++) {
        if (lookaheadInput.matches(ch,lookbehindFormats[i].value)) {
          lookbehindFormat=lookbehindFormats[i];
          matched=true;
          lengths=rootLengths;
          break;
        }
      }
    }
    if (!matched) {
      if (lookbehindFormat == null) {
        if (rootLengths == null) {
          throw new TextParsingException(context,"String_Node_Str" + lookaheadInput.getLookahead(ch) + '\'');
        }
        lengths=rootLengths;
        alignments=rootAlignments;
        paddings=rootPaddings;
        lookupFormat=null;
      }
 else {
        lengths=lookbehindFormat.lengths;
        alignments=lookbehindFormat.alignments;
        paddings=lookbehindFormat.paddings;
        lookupFormat=lookbehindFormat;
      }
    }
  }
  int i;
  for (i=0; i < lengths.length; i++) {
    length=lengths[i];
    if (paddings != null) {
      padding=useDefaultPadding ? defaultPadding : paddings[i];
    }
    if (alignments != null) {
      alignment=alignments[i];
    }
    skipPadding();
    if (ignoreLeadingWhitespace) {
      skipWhitespace();
    }
    if (recordEndsOnNewLine) {
      readValueUntilNewLine();
      if (ch == newLine) {
        output.valueParsed();
        useDefaultPadding=false;
        return;
      }
    }
 else     if (length > 0) {
      readValue();
      if (i + 1 < lengths.length) {
        ch=input.nextChar();
      }
    }
    output.valueParsed();
  }
  if (skipToNewLine) {
    skipToNewLine();
  }
  useDefaultPadding=false;
}