Program: 29275
Project: 29275
Buggy source:
public String readLine() throws IOException {
  if (ib == null) {
    throw new IllegalStateException(sm.getString("String_Node_Str"));
  }
  if (lineBuffer == null) {
    lineBuffer=new char[MAX_LINE_LENGTH];
  }
  String result=null;
  int pos=0;
  int end=-1;
  int skip=-1;
  StringBuilder aggregator=null;
  while (end < 0) {
    mark(MAX_LINE_LENGTH);
    while ((pos < MAX_LINE_LENGTH) && (end < 0)) {
      int nRead=read(lineBuffer,pos,MAX_LINE_LENGTH - pos);
      if (nRead < 0) {
        if (pos == 0 && aggregator == null) {
          return null;
        }
        end=pos;
        skip=pos;
      }
      for (int i=pos; (i < (pos + nRead)) && (end < 0); i++) {
        if (lineBuffer[i] == LINE_SEP[0]) {
          end=i;
          skip=i + 1;
          char nextchar;
          if (i == (pos + nRead - 1)) {
            nextchar=(char)read();
          }
 else {
            nextchar=lineBuffer[i + 1];
          }
          if (nextchar == LINE_SEP[1]) {
            skip++;
          }
        }
 else         if (lineBuffer[i] == LINE_SEP[1]) {
          end=i;
          skip=i + 1;
        }
      }
      if (nRead > 0) {
        pos+=nRead;
      }
    }
    if (end < 0) {
      if (aggregator == null) {
        aggregator=new StringBuilder();
      }
      aggregator.append(lineBuffer);
      pos=0;
    }
 else {
      reset();
      skip(skip);
    }
  }
  if (aggregator == null) {
    result=new String(lineBuffer,0,end);
  }
 else {
    aggregator.append(lineBuffer,0,end);
    result=aggregator.toString();
  }
  return result;
}

Fixed version (ground truth):
public String readLine() throws IOException {
  if (ib == null) {
    throw new IllegalStateException(sm.getString("String_Node_Str"));
  }
  if (lineBuffer == null) {
    lineBuffer=new char[MAX_LINE_LENGTH];
  }
  String result=null;
  int pos=0;
  int end=-1;
  int skip=-1;
  StringBuilder aggregator=null;
  while (end < 0) {
    mark(MAX_LINE_LENGTH);
    while ((pos < MAX_LINE_LENGTH) && (end < 0)) {
      int nRead=read(lineBuffer,pos,MAX_LINE_LENGTH - pos);
      if (nRead < 0) {
        if (pos == 0 && aggregator == null) {
          return null;
        }
        end=pos;
        skip=pos;
      }
      for (int i=pos; (i < (pos + nRead)) && (end < 0); i++) {
        if (lineBuffer[i] == LINE_SEP[0]) {
          end=i;
          skip=i + 1;
          char nextchar;
          if (i == (pos + nRead - 1)) {
            nextchar=(char)read();
          }
 else {
            nextchar=lineBuffer[i + 1];
          }
          if (nextchar == LINE_SEP[1]) {
            skip++;
          }
        }
 else         if (lineBuffer[i] == LINE_SEP[1]) {
          end=i;
          skip=i + 1;
        }
      }
      if (nRead > 0) {
        pos+=nRead;
      }
    }
    if (end < 0) {
      if (aggregator == null) {
        aggregator=new StringBuilder();
      }
      aggregator.append(lineBuffer);
      pos=0;
    }
 else {
      reset();
      if (skip(skip) != skip && log.isLoggable(Level.WARNING)) {
        log.warning(sm.getString("String_Node_Str",skip));
      }
    }
  }
  if (aggregator == null) {
    result=new String(lineBuffer,0,end);
  }
 else {
    aggregator.append(lineBuffer,0,end);
    result=aggregator.toString();
  }
  return result;
}