Program: 57231
Project: 57231
Buggy source:
/** 
 * Load the direction vector for each dimension from the given stream.
 * @param is the input stream to read the direction vector from
 * @return the last dimension that has been read from the input stream
 * @throws IOException if the stream could not be read
 * @throws MathParseException if the content could not be parsed successfully
 */
private int initFromStream(final InputStream is) throws MathParseException, IOException {
  for (int i=1; i <= BITS; i++) {
    direction[0][i]=1l << (BITS - i);
  }
  final BufferedReader reader=new BufferedReader(new InputStreamReader(is));
  int dim=-1;
  try {
    reader.readLine();
    int lineNumber=2;
    int index=1;
    String line=null;
    while ((line=reader.readLine()) != null) {
      StringTokenizer st=new StringTokenizer(line,"String_Node_Str");
      try {
        dim=Integer.valueOf(st.nextToken());
        if (dim >= 2 && dim <= dimension) {
          final int s=Integer.valueOf(st.nextToken());
          final int a=Integer.valueOf(st.nextToken());
          final int[] m=new int[s + 1];
          for (int i=1; i <= s; i++) {
            m[i]=Integer.valueOf(st.nextToken());
          }
          initDirectionVector(index++,a,m);
        }
        if (dim > dimension) {
          return dim;
        }
      }
 catch (      NoSuchElementException e) {
        throw new MathParseException(line,lineNumber);
      }
catch (      NumberFormatException e) {
        throw new MathParseException(line,lineNumber);
      }
      lineNumber++;
    }
  }
  finally {
    reader.close();
  }
  return dim;
}

Fixed version (ground truth):
/** 
 * Load the direction vector for each dimension from the given stream. <p> The input stream <i>must</i> be an ASCII text containing one valid direction vector per line.
 * @param is the input stream to read the direction vector from
 * @return the last dimension that has been read from the input stream
 * @throws IOException if the stream could not be read
 * @throws MathParseException if the content could not be parsed successfully
 */
private int initFromStream(final InputStream is) throws MathParseException, IOException {
  for (int i=1; i <= BITS; i++) {
    direction[0][i]=1l << (BITS - i);
  }
  final Charset charset=Charset.forName(FILE_CHARSET);
  final BufferedReader reader=new BufferedReader(new InputStreamReader(is,charset));
  int dim=-1;
  try {
    reader.readLine();
    int lineNumber=2;
    int index=1;
    String line=null;
    while ((line=reader.readLine()) != null) {
      StringTokenizer st=new StringTokenizer(line,"String_Node_Str");
      try {
        dim=Integer.valueOf(st.nextToken());
        if (dim >= 2 && dim <= dimension) {
          final int s=Integer.valueOf(st.nextToken());
          final int a=Integer.valueOf(st.nextToken());
          final int[] m=new int[s + 1];
          for (int i=1; i <= s; i++) {
            m[i]=Integer.valueOf(st.nextToken());
          }
          initDirectionVector(index++,a,m);
        }
        if (dim > dimension) {
          return dim;
        }
      }
 catch (      NoSuchElementException e) {
        throw new MathParseException(line,lineNumber);
      }
catch (      NumberFormatException e) {
        throw new MathParseException(line,lineNumber);
      }
      lineNumber++;
    }
  }
  finally {
    reader.close();
  }
  return dim;
}