Program: 19656
Project: 19656
Buggy source:
/** 
 * Loads the transition matrices
 * @param path the path to the transitions matrices
 * @return a pool of transition matrices
 * @throws FileNotFoundException if a file cannot be found
 * @throws IOException           if an error occurs while loading the data
 */
protected Pool loadTransitionMatricesAscii(String path) throws FileNotFoundException, IOException {
  String location=super.getLocation();
  InputStream inputStream=StreamFactory.getInputStream(location,path);
  LogMath logMath=ConfigurationManager.getInstance(LogMath.class);
  logger.info("String_Node_Str");
  logger.info(path);
  int numMatrices;
  int numStates;
  Pool pool=new Pool(path);
  ExtendedStreamTokenizer est=new ExtendedStreamTokenizer(inputStream,'#',false);
  est.expectString("String_Node_Str");
  numMatrices=est.getInt("String_Node_Str");
  est.expectString("String_Node_Str");
  for (int i=0; i < numMatrices; i++) {
    est.expectString("String_Node_Str");
    est.expectString("String_Node_Str" + i + "String_Node_Str");
    est.expectString("String_Node_Str");
    numStates=est.getInt("String_Node_Str") + 1;
    float[][] tmat=new float[numStates][numStates];
    for (int j=0; j < numStates; j++) {
      for (int k=0; k < numStates; k++) {
        if (j < numStates - 1) {
          if (sparseForm) {
            if (k == j || k == j + 1) {
              tmat[j][k]=est.getFloat("String_Node_Str");
            }
          }
 else {
            tmat[j][k]=est.getFloat("String_Node_Str");
          }
        }
        tmat[j][k]=logMath.linearToLog(tmat[j][k]);
        if (logger.isLoggable(Level.FINE)) {
          logger.fine("String_Node_Str" + j + "String_Node_Str"+ k+ "String_Node_Str"+ tmat[j][k]);
        }
      }
    }
    pool.put(i,tmat);
  }
  est.close();
  return pool;
}

Fixed version (ground truth):
/** 
 * Loads the transition matrices
 * @param path the path to the transitions matrices
 * @return a pool of transition matrices
 * @throws FileNotFoundException if a file cannot be found
 * @throws IOException           if an error occurs while loading the data
 */
protected Pool loadTransitionMatricesAscii(String path) throws FileNotFoundException, IOException {
  String location="String_Node_Str";
  InputStream inputStream=StreamFactory.getInputStream(location,path);
  LogMath logMath=ConfigurationManager.getInstance(LogMath.class);
  logger.info("String_Node_Str");
  logger.info(path);
  int numMatrices;
  int numStates;
  Pool pool=new Pool(path);
  ExtendedStreamTokenizer est=new ExtendedStreamTokenizer(inputStream,'#',false);
  est.expectString("String_Node_Str");
  numMatrices=est.getInt("String_Node_Str");
  est.expectString("String_Node_Str");
  for (int i=0; i < numMatrices; i++) {
    est.expectString("String_Node_Str");
    est.expectString("String_Node_Str" + i + "String_Node_Str");
    est.expectString("String_Node_Str");
    numStates=est.getInt("String_Node_Str") + 1;
    float[][] tmat=new float[numStates][numStates];
    for (int j=0; j < numStates; j++) {
      for (int k=0; k < numStates; k++) {
        if (j < numStates - 1) {
          if (sparseForm) {
            if (k == j || k == j + 1) {
              tmat[j][k]=est.getFloat("String_Node_Str");
            }
          }
 else {
            tmat[j][k]=est.getFloat("String_Node_Str");
          }
        }
        tmat[j][k]=logMath.linearToLog(tmat[j][k]);
        if (logger.isLoggable(Level.FINE)) {
          logger.fine("String_Node_Str" + j + "String_Node_Str"+ k+ "String_Node_Str"+ tmat[j][k]);
        }
      }
    }
    pool.put(i,tmat);
  }
  est.close();
  return pool;
}