Program: 189065
Project: 189065
Buggy source:
/** 
 * This method does the actual work of importing given properly parsed parameters
 * @param referenceID
 * @param threadCount
 * @param inputFiles
 * @param workerModule
 * @param compressed
 * @param outputFile
 * @param tagSetSGIDs
 * @param adhocTagSet
 * @param batch_size
 * @return SGID if successful, null if not
 */
protected static SGID performImport(SGID referenceID,int threadCount,List<String> inputFiles,String workerModule,boolean compressed,File outputFile,List<SGID> tagSetSGIDs,SGID adhocTagSetID,int batch_size){
  CreateUpdateManager modelManager=SWQEFactory.getModelManager();
  Reference ref=SWQEFactory.getQueryInterface().getLatestAtomBySGID(referenceID,Reference.class);
  FeatureSet featureSet=modelManager.buildFeatureSet().setReference(ref).build();
  TagSet adHocSet;
  if (adhocTagSetID != null) {
    adHocSet=SWQEFactory.getQueryInterface().getLatestAtomBySGID(adhocTagSetID,TagSet.class);
  }
 else {
    adHocSet=modelManager.buildTagSet().setName("String_Node_Str" + featureSet.getSGID().getRowKey()).build();
  }
  modelManager.close();
  final FeatureImporter pmi=new FeatureImporter(threadCount);
  try {
    if (modelManager != null) {
      Iterator<String> it=inputFiles.iterator();
      ImportWorker[] workerArray=new ImportWorker[inputFiles.size()];
      int index=0;
      while (it.hasNext()) {
        String input=(String)it.next();
        Logger.getLogger(FeatureImporter.class.getName()).info("String_Node_Str" + input);
        Class processorClass=Class.forName("String_Node_Str" + workerModule);
        workerArray[index]=(ImportWorker)processorClass.newInstance();
        workerArray[index].setWorkerName("String_Node_Str" + index);
        workerArray[index].setPmi(pmi);
        workerArray[index].setInput(input);
        workerArray[index].setFeatureSetID(featureSet.getSGID());
        workerArray[index].setAdhoctagset(adHocSet.getSGID());
        workerArray[index].setTagSetIDs(tagSetSGIDs);
        workerArray[index].setBatch_size(batch_size);
        workerArray[index].setCompressed(compressed);
        workerArray[index].setMinCoverage(0);
        workerArray[index].setMaxCoverage(0);
        workerArray[index].setMinSnpQuality(0);
        workerArray[index].setIncludeSNV(false);
        workerArray[index].setFastqConvNum(0);
        workerArray[index].setIncludeIndels(false);
        workerArray[index].setIncludeCoverage(false);
        workerArray[index].setBinSize(0);
        workerArray[index].setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){
          @Override public void uncaughtException(          Thread thread,          Throwable thrwbl){
            pmi.failedWorkers.add((ImportWorker)thread);
          }
        }
);
        workerArray[index].start();
        index++;
      }
      Logger.getLogger(FeatureImporter.class.getName()).info("String_Node_Str");
      for (int i=0; i < workerArray.length; i++) {
        workerArray[i].join();
      }
      Logger.getLogger(FeatureImporter.class.getName()).info("String_Node_Str");
    }
  }
 catch (  Exception e) {
    Logger.getLogger(FeatureImporter.class.getName()).fatal("String_Node_Str",e);
    return null;
  }
  if (pmi.failedWorkers.size() > 0) {
    return null;
  }
  SWQEFactory.getStorage().closeStorage();
  System.out.println("String_Node_Str");
  String outputID=featureSet.getSGID().getUuid().toString();
  System.out.println(outputID);
  Map<String,String> keyValues=new HashMap<String,String>();
  keyValues.put(FEATURE_SET_ID,outputID);
  if (adhocTagSetID == null) {
    System.out.println("String_Node_Str");
    String aoutputID=adHocSet.getSGID().getUuid().toString();
    System.out.println(aoutputID);
    keyValues.put("String_Node_Str",aoutputID);
  }
  Utility.writeKeyValueFile(outputFile,keyValues);
  return featureSet.getSGID();
}

Fixed version (ground truth):
/** 
 * This method does the actual work of importing given properly parsed parameters
 * @param referenceID
 * @param threadCount
 * @param inputFiles
 * @param workerModule
 * @param compressed
 * @param outputFile
 * @param tagSetSGIDs
 * @param adhocTagSet
 * @param batch_size
 * @return SGID if successful, null if not
 */
protected static SGID performImport(SGID referenceID,int threadCount,List<String> inputFiles,String workerModule,boolean compressed,File outputFile,List<SGID> tagSetSGIDs,SGID adhocTagSetID,int batch_size){
  CreateUpdateManager modelManager=SWQEFactory.getModelManager();
  Reference ref=SWQEFactory.getQueryInterface().getLatestAtomBySGID(referenceID,Reference.class);
  FeatureSet featureSet=modelManager.buildFeatureSet().setReference(ref).build();
  TagSet adHocSet;
  if (adhocTagSetID != null) {
    adHocSet=SWQEFactory.getQueryInterface().getLatestAtomBySGID(adhocTagSetID,TagSet.class);
  }
 else {
    adHocSet=modelManager.buildTagSet().setName("String_Node_Str" + featureSet.getSGID().getRowKey()).build();
  }
  modelManager.close();
  final FeatureImporter pmi=new FeatureImporter(threadCount);
  try {
    if (modelManager != null) {
      Iterator<String> it=inputFiles.iterator();
      ImportWorker[] workerArray=new ImportWorker[inputFiles.size()];
      int index=0;
      while (it.hasNext()) {
        String input=(String)it.next();
        Logger.getLogger(FeatureImporter.class.getName()).info("String_Node_Str" + input);
        Class processorClass=Class.forName("String_Node_Str" + workerModule);
        workerArray[index]=(ImportWorker)processorClass.newInstance();
        workerArray[index].setWorkerName("String_Node_Str" + index);
        workerArray[index].setPmi(pmi);
        workerArray[index].setInput(input);
        workerArray[index].setFeatureSetID(featureSet.getSGID());
        workerArray[index].setAdhoctagset(adHocSet.getSGID());
        workerArray[index].setTagSetIDs(tagSetSGIDs);
        workerArray[index].setBatch_size(batch_size);
        workerArray[index].setCompressed(compressed);
        workerArray[index].setMinCoverage(0);
        workerArray[index].setMaxCoverage(0);
        workerArray[index].setMinSnpQuality(0);
        workerArray[index].setIncludeSNV(false);
        workerArray[index].setFastqConvNum(0);
        workerArray[index].setIncludeIndels(false);
        workerArray[index].setIncludeCoverage(false);
        workerArray[index].setBinSize(0);
        workerArray[index].setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){
          @Override public void uncaughtException(          Thread thread,          Throwable thrwbl){
            pmi.failedWorkers.add((ImportWorker)thread);
          }
        }
);
        workerArray[index].start();
        index++;
      }
      Logger.getLogger(FeatureImporter.class.getName()).info("String_Node_Str");
      for (int i=0; i < workerArray.length; i++) {
        workerArray[i].join();
      }
      Logger.getLogger(FeatureImporter.class.getName()).info("String_Node_Str");
    }
  }
 catch (  Exception e) {
    Logger.getLogger(FeatureImporter.class.getName()).fatal("String_Node_Str",e);
    return null;
  }
  if (pmi.failedWorkers.size() > 0) {
    return null;
  }
  SWQEFactory.getStorage().closeStorage();
  System.out.println("String_Node_Str");
  String outputID=featureSet.getSGID().getRowKey();
  System.out.println(outputID);
  Map<String,String> keyValues=new HashMap<String,String>();
  keyValues.put(FEATURE_SET_ID,outputID);
  if (adhocTagSetID == null) {
    System.out.println("String_Node_Str");
    String aoutputID=adHocSet.getSGID().getUuid().toString();
    System.out.println(aoutputID);
    keyValues.put("String_Node_Str",aoutputID);
  }
  Utility.writeKeyValueFile(outputFile,keyValues);
  return featureSet.getSGID();
}