Program: 145756
Project: 145756
Buggy source:
/** 
 * Load snips and users into the SnipSpace from an xml document out of a stream.
 * @param file  the file to load from
 */
private static Document load(File file) throws Exception {
  final long fileLength=file.length();
  System.err.print("String_Node_Str");
  SAXReader saxReader=new SAXReader();
  Document document=saxReader.read(new FileReader(file){
    public int read(    char[] chars) throws IOException {
      int n=super.read(chars);
      for (int i=0; i < n; i++) {
        chars[i]=replaceIfIllegal(chars[i]);
      }
      return n;
    }
    public int read(    char[] chars,    int start,    int length) throws IOException {
      int n=super.read(chars,start,length);
      for (int i=0; i < n; i++) {
        chars[i]=replaceIfIllegal(chars[i]);
      }
      readProgress(fileLength,curr+=n,length);
      return n;
    }
    private char replaceIfIllegal(    char c){
      if (c < 0x20 && !(c == 0x09 || c == 0x0a || c == 0x0d)) {
        errCount++;
        return (char)0x20;
      }
      return c;
    }
    private void readProgress(    long length,    long current,    int blockSize){
      long percentage=current * 100 / length;
      if (percentage % 5 != 0 && ((current - blockSize) * 100 / length) % 5 == 0) {
        System.err.print("String_Node_Str");
      }
 else       if (percentage % 20 == 0 && ((current - blockSize) * 100 / length) % 20 != 0) {
        System.err.print(NumberFormat.getIntegerInstance().format(percentage) + "String_Node_Str");
      }
    }
  }
);
  System.err.println();
  if (errCount > 0) {
    System.err.println("String_Node_Str" + errCount + "String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
  }
  return document;
}

Fixed version (ground truth):
/** 
 * Load snips and users into the SnipSpace from an xml document out of a stream.
 * @param file  the file to load from
 */
private static Document load(File file) throws Exception {
  final long fileLength=file.length();
  System.err.print("String_Node_Str");
  SAXReader saxReader=new SAXReader();
  InputStreamReader reader=new InputStreamReader(new FileInputStream(file),"String_Node_Str"){
    public int read(    char[] chars) throws IOException {
      int n=super.read(chars);
      for (int i=0; i < n; i++) {
        chars[i]=replaceIfIllegal(chars[i]);
      }
      return n;
    }
    public int read(    char[] chars,    int start,    int length) throws IOException {
      int n=super.read(chars,start,length);
      for (int i=0; i < n; i++) {
        chars[i]=replaceIfIllegal(chars[i]);
      }
      readProgress(fileLength,curr+=n,length);
      return n;
    }
    private char replaceIfIllegal(    char c){
      if (c < 0x20 && !(c == 0x09 || c == 0x0a || c == 0x0d)) {
        errCount++;
        return (char)0x20;
      }
      return c;
    }
    private void readProgress(    long length,    long current,    int blockSize){
      long percentage=current * 100 / length;
      if (percentage % 5 != 0 && ((current - blockSize) * 100 / length) % 5 == 0) {
        System.err.print("String_Node_Str");
      }
 else       if (percentage % 20 == 0 && ((current - blockSize) * 100 / length) % 20 != 0) {
        System.err.print(NumberFormat.getIntegerInstance().format(percentage) + "String_Node_Str");
      }
    }
  }
;
  Document document=saxReader.read(reader);
  System.err.println();
  if (errCount > 0) {
    System.err.println("String_Node_Str" + errCount + "String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
  }
  return document;
}