Program: 61342
Project: 61342
Buggy source:
public static DirichletState<VectorWritable> getDirichletState(JobConf job) throws NumberFormatException, SecurityException, IllegalArgumentException, NoSuchMethodException, InvocationTargetException {
  String statePath=job.get(DirichletDriver.STATE_IN_KEY);
  String modelFactory=job.get(DirichletDriver.MODEL_FACTORY_KEY);
  String modelPrototype=job.get(DirichletDriver.MODEL_PROTOTYPE_KEY);
  String prototypeSize=job.get(DirichletDriver.PROTOTYPE_SIZE_KEY);
  String numClusters=job.get(DirichletDriver.NUM_CLUSTERS_KEY);
  String alpha_0=job.get(DirichletDriver.ALPHA_0_KEY);
  try {
    DirichletState<VectorWritable> state=DirichletDriver.createState(modelFactory,modelPrototype,Integer.parseInt(prototypeSize),Integer.parseInt(numClusters),Double.parseDouble(alpha_0));
    Path path=new Path(statePath);
    FileSystem fs=FileSystem.get(path.toUri(),job);
    FileStatus[] status=fs.listStatus(path,new OutputLogFilter());
    for (    FileStatus s : status) {
      SequenceFile.Reader reader=new SequenceFile.Reader(fs,s.getPath(),job);
      try {
        Text key=new Text();
        DirichletCluster<VectorWritable> cluster=new DirichletCluster<VectorWritable>();
        while (reader.next(key,cluster)) {
          int index=Integer.parseInt(key.toString());
          state.getClusters().set(index,cluster);
          cluster=new DirichletCluster<VectorWritable>();
        }
      }
  finally {
        reader.close();
      }
    }
    state.setMixture(UncommonDistributions.rDirichlet(state.totalCounts()));
    return state;
  }
 catch (  ClassNotFoundException e) {
    throw new IllegalStateException(e);
  }
catch (  InstantiationException e) {
    throw new IllegalStateException(e);
  }
catch (  IllegalAccessException e) {
    throw new IllegalStateException(e);
  }
catch (  IOException e) {
    throw new IllegalStateException(e);
  }
}

Fixed version (ground truth):
public static DirichletState<VectorWritable> getDirichletState(JobConf job) throws SecurityException, IllegalArgumentException, NoSuchMethodException, InvocationTargetException {
  String statePath=job.get(DirichletDriver.STATE_IN_KEY);
  String modelFactory=job.get(DirichletDriver.MODEL_FACTORY_KEY);
  String modelPrototype=job.get(DirichletDriver.MODEL_PROTOTYPE_KEY);
  String prototypeSize=job.get(DirichletDriver.PROTOTYPE_SIZE_KEY);
  String numClusters=job.get(DirichletDriver.NUM_CLUSTERS_KEY);
  String alpha_0=job.get(DirichletDriver.ALPHA_0_KEY);
  try {
    DirichletState<VectorWritable> state=DirichletDriver.createState(modelFactory,modelPrototype,Integer.parseInt(prototypeSize),Integer.parseInt(numClusters),Double.parseDouble(alpha_0));
    Path path=new Path(statePath);
    FileSystem fs=FileSystem.get(path.toUri(),job);
    FileStatus[] status=fs.listStatus(path,new OutputLogFilter());
    for (    FileStatus s : status) {
      SequenceFile.Reader reader=new SequenceFile.Reader(fs,s.getPath(),job);
      try {
        Text key=new Text();
        DirichletCluster<VectorWritable> cluster=new DirichletCluster<VectorWritable>();
        while (reader.next(key,cluster)) {
          int index=Integer.parseInt(key.toString());
          state.getClusters().set(index,cluster);
          cluster=new DirichletCluster<VectorWritable>();
        }
      }
  finally {
        reader.close();
      }
    }
    state.setMixture(UncommonDistributions.rDirichlet(state.totalCounts()));
    return state;
  }
 catch (  ClassNotFoundException e) {
    throw new IllegalStateException(e);
  }
catch (  InstantiationException e) {
    throw new IllegalStateException(e);
  }
catch (  IllegalAccessException e) {
    throw new IllegalStateException(e);
  }
catch (  IOException e) {
    throw new IllegalStateException(e);
  }
}