Program: 120351
Project: 120351
Buggy source:
public boolean readRecord() throws IOException {
  checkClosed();
  if (mode == 0) {
    if (skipEmptyRecord) {
      do {
        rowRecord=null;
        if (!scanner.hasNext()) {
          return false;
        }
        rowRecord=scanner.next();
        if (!rowRecord.equals("String_Node_Str")) {
          currentRecord++;
          return true;
        }
      }
 while (true);
    }
 else {
      rowRecord=null;
      if (!scanner.hasNext()) {
        return false;
      }
 else {
        rowRecord=scanner.next();
        currentRecord++;
        return true;
      }
    }
  }
 else   if (mode == 1) {
    hasReadRecord=false;
    if (streamBuffer.hasMoreData()) {
      while (streamBuffer.hasMoreData() && !hasReadRecord) {
        if (streamBuffer.noDataForDelimter()) {
          checkDataLength();
        }
 else {
          if (isStartRecordDelimited()) {
            if (!skipEmptyRecord) {
              endRecord();
            }
            streamBuffer.skipDelimiter();
          }
 else {
            startedRow=true;
            streamBuffer.rowStart=streamBuffer.currentPosition;
            boolean firstLoop=true;
            while (streamBuffer.hasMoreData() && startedRow) {
              if (!firstLoop && streamBuffer.noDataForDelimter()) {
                checkDataLength();
              }
 else {
                if (!firstLoop) {
                  if (isStartRecordDelimited()) {
                    endRecord();
                    streamBuffer.skipDelimiter();
                  }
                }
 else {
                  firstLoop=false;
                }
                if (startedRow) {
                  streamBuffer.currentPosition++;
                  if (safetySwitch && streamBuffer.currentPosition - streamBuffer.rowStart + rowBuffer.position > StaticSettings.MAX_SIZE_FOR_SAFTY) {
                    close();
                    throw new IOException("String_Node_Str" + NumberFormat.getIntegerInstance().format(currentRecord) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
                  }
                }
              }
            }
          }
        }
      }
    }
    if (!hasReadRecord) {
      if (!streamBuffer.noData()) {
        if (!startedRow) {
          startedRow=true;
          streamBuffer.rowStart=streamBuffer.currentPosition;
          streamBuffer.currentPosition=streamBuffer.count;
          endRecord();
          return true;
        }
        if (startedRow) {
          streamBuffer.currentPosition=streamBuffer.count;
          endRecord();
          return true;
        }
      }
 else {
        return false;
      }
    }
    return hasReadRecord;
  }
 else {
    int readNumber=inputStream.read(buffer,0,rowLength);
    if (readNumber == -1) {
      return false;
    }
 else {
      this.rowRecord=new String(buffer,0,readNumber);
      currentRecord++;
      return true;
    }
  }
}

Fixed version (ground truth):
public boolean readRecord() throws IOException {
  checkClosed();
  if (mode == 0) {
    if (skipEmptyRecord) {
      do {
        rowRecord=null;
        if (scanner != null) {
          if (!scanner.hasNext()) {
            return false;
          }
          rowRecord=scanner.next();
        }
 else {
          rowRecord=inputStream.readLine();
          if (rowRecord == null) {
            return false;
          }
        }
        if (!rowRecord.equals("String_Node_Str")) {
          currentRecord++;
          return true;
        }
      }
 while (true);
    }
 else {
      rowRecord=null;
      if (scanner != null) {
        if (!scanner.hasNext()) {
          return false;
        }
 else {
          rowRecord=scanner.next();
          currentRecord++;
          return true;
        }
      }
 else {
        rowRecord=inputStream.readLine();
        if (rowRecord == null) {
          return false;
        }
 else {
          currentRecord++;
          return true;
        }
      }
    }
  }
 else   if (mode == 1) {
    hasReadRecord=false;
    if (streamBuffer.hasMoreData()) {
      while (streamBuffer.hasMoreData() && !hasReadRecord) {
        if (streamBuffer.noDataForDelimter()) {
          checkDataLength();
        }
 else {
          if (isStartRecordDelimited()) {
            if (!skipEmptyRecord) {
              endRecord();
            }
            streamBuffer.skipDelimiter();
          }
 else {
            startedRow=true;
            streamBuffer.rowStart=streamBuffer.currentPosition;
            boolean firstLoop=true;
            while (streamBuffer.hasMoreData() && startedRow) {
              if (!firstLoop && streamBuffer.noDataForDelimter()) {
                checkDataLength();
              }
 else {
                if (!firstLoop) {
                  if (isStartRecordDelimited()) {
                    endRecord();
                    streamBuffer.skipDelimiter();
                  }
                }
 else {
                  firstLoop=false;
                }
                if (startedRow) {
                  streamBuffer.currentPosition++;
                  if (safetySwitch && streamBuffer.currentPosition - streamBuffer.rowStart + rowBuffer.position > StaticSettings.MAX_SIZE_FOR_SAFTY) {
                    close();
                    throw new IOException("String_Node_Str" + NumberFormat.getIntegerInstance().format(currentRecord) + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
                  }
                }
              }
            }
          }
        }
      }
    }
    if (!hasReadRecord) {
      if (!streamBuffer.noData()) {
        if (!startedRow) {
          startedRow=true;
          streamBuffer.rowStart=streamBuffer.currentPosition;
          streamBuffer.currentPosition=streamBuffer.count;
          endRecord();
          return true;
        }
        if (startedRow) {
          streamBuffer.currentPosition=streamBuffer.count;
          endRecord();
          return true;
        }
      }
 else {
        return false;
      }
    }
    return hasReadRecord;
  }
 else {
    int readNumber=inputStream.read(buffer,0,rowLength);
    if (readNumber == -1) {
      return false;
    }
 else {
      this.rowRecord=new String(buffer,0,readNumber);
      currentRecord++;
      return true;
    }
  }
}