Program: 9738
Project: 9738
Buggy source:
/** 
 * Initialise all components based on conf file.
 * @param file Conf file to read.
 * @throws ComponentInitException
 * @throws ParseException 
 * @throws FileNotFoundException 
 * @throws IOException 
 */
public Start(File file) throws ComponentInitException, ParseException, FileNotFoundException {
  String baseDir=file.getAbsoluteFile().getParent();
  String message="String_Node_Str";
  long cmStartTime=System.nanoTime();
  ComponentManager cm=ComponentManager.getInstance();
  long cmTime=System.nanoTime() - cmStartTime;
  message+="String_Node_Str" + Helper.prettyPrintNanoSeconds(cmTime) + "String_Node_Str";
  logger.info(message);
  ConfParser parser=ConfParser.parseFile(file);
  Monitor ksMonitor=JamonMonitorLogger.getTimeMonitor(Start.class,"String_Node_Str").start();
  sources=new HashSet<KnowledgeSource>();
  Map<URL,Class<? extends KnowledgeSource>> importedFiles=getImportedFiles(parser,baseDir);
  for (  Map.Entry<URL,Class<? extends KnowledgeSource>> entry : importedFiles.entrySet()) {
    KnowledgeSource ks=cm.knowledgeSource(entry.getValue());
    cm.applyConfigEntry(ks,"String_Node_Str",entry.getKey());
    sources.add(ks);
    configureComponent(cm,ks,parser);
    initComponent(cm,ks);
  }
  ksMonitor.stop();
  Monitor rsMonitor=JamonMonitorLogger.getTimeMonitor(Start.class,"String_Node_Str").start();
  ConfFileOption reasonerOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends ReasonerComponent> rcClass;
  if (reasonerOption != null) {
    rcClass=confMapper.getReasonerComponentClass(reasonerOption.getStringValue());
    if (rcClass == null) {
      handleError("String_Node_Str" + reasonerOption.getStringValue() + "String_Node_Str"+ reasonerOption+ "String_Node_Str"+ confMapper.getReasoners()+ "String_Node_Str");
    }
  }
 else {
    rcClass=FastInstanceChecker.class;
  }
  rc=cm.reasoner(rcClass,sources);
  configureComponent(cm,rc,parser);
  initComponent(cm,rc);
  rsMonitor.stop();
  Monitor lpMonitor=JamonMonitorLogger.getTimeMonitor(Start.class,"String_Node_Str").start();
  ConfFileOption problemOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends LearningProblem> lpClass;
  if (problemOption != null) {
    lpClass=confMapper.getLearningProblemClass(problemOption.getStringValue());
    if (lpClass == null) {
      handleError("String_Node_Str" + problemOption.getStringValue() + "String_Node_Str"+ problemOption+ "String_Node_Str"+ confMapper.getLearningProblems()+ "String_Node_Str");
    }
  }
 else {
    lpClass=PosNegLPStandard.class;
  }
  lp=cm.learningProblem(lpClass,rc);
  if (lpClass == PosNegLPStandard.class || lpClass == PosOnlyLP.class) {
    SortedSet<String> posExamples=parser.getPositiveExamples();
    cm.applyConfigEntry(lp,"String_Node_Str",posExamples);
  }
  if (lpClass == PosNegLPStandard.class) {
    SortedSet<String> negExamples=parser.getNegativeExamples();
    cm.applyConfigEntry(lp,"String_Node_Str",negExamples);
  }
  configureComponent(cm,lp,parser);
  initComponent(cm,lp);
  lpMonitor.stop();
  Monitor laMonitor=JamonMonitorLogger.getTimeMonitor(Start.class,"String_Node_Str").start();
  ConfFileOption algorithmOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends LearningAlgorithm> laClass;
  if (algorithmOption != null) {
    laClass=confMapper.getLearningAlgorithmClass(algorithmOption.getStringValue());
    if (laClass == null) {
      handleError("String_Node_Str" + algorithmOption.getStringValue() + "String_Node_Str"+ algorithmOption+ "String_Node_Str"+ confMapper.getLearningAlgorithms()+ "String_Node_Str");
    }
  }
 else {
    laClass=ROLComponent2.class;
  }
  try {
    la=cm.learningAlgorithm(laClass,lp,rc);
  }
 catch (  LearningProblemUnsupportedException e) {
    e.printStackTrace();
  }
  configureComponent(cm,la,parser);
  initComponent(cm,la);
  laMonitor.stop();
  performExports(parser,baseDir,sources,rc);
  processCLIOptions(cm,parser,rc,lp);
  if (logger.isInfoEnabled()) {
    System.out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Initialise all components based on conf file.
 * @param file Conf file to read.
 * @throws ComponentInitException
 * @throws ParseException 
 * @throws FileNotFoundException 
 * @throws  
	 * @throws IOException 
 */
public Start(File file) throws ComponentInitException, ParseException, FileNotFoundException {
  String baseDir=file.getAbsoluteFile().getParent();
  String message="String_Node_Str";
  long cmStartTime=System.nanoTime();
  ComponentManager cm=ComponentManager.getInstance();
  long cmTime=System.nanoTime() - cmStartTime;
  message+="String_Node_Str" + Helper.prettyPrintNanoSeconds(cmTime) + "String_Node_Str";
  logger.info(message);
  ConfParser parser=ConfParser.parseFile(file);
  Monitor ksMonitor=JamonMonitorLogger.getTimeMonitor(Start.class,"String_Node_Str").start();
  sources=new HashSet<KnowledgeSource>();
  Map<URL,Class<? extends KnowledgeSource>> importedFiles=getImportedFiles(parser,baseDir);
  for (  Map.Entry<URL,Class<? extends KnowledgeSource>> entry : importedFiles.entrySet()) {
    KnowledgeSource ks=cm.knowledgeSource(entry.getValue());
    cm.applyConfigEntry(ks,"String_Node_Str",entry.getKey());
    sources.add(ks);
    configureComponent(cm,ks,parser);
    initComponent(cm,ks);
  }
  ksMonitor.stop();
  Monitor rsMonitor=JamonMonitorLogger.getTimeMonitor(Start.class,"String_Node_Str").start();
  ConfFileOption reasonerOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends ReasonerComponent> rcClass;
  if (reasonerOption != null) {
    rcClass=confMapper.getReasonerComponentClass(reasonerOption.getStringValue());
    if (rcClass == null) {
      handleError("String_Node_Str" + reasonerOption.getStringValue() + "String_Node_Str"+ reasonerOption+ "String_Node_Str"+ confMapper.getReasoners()+ "String_Node_Str");
    }
  }
 else {
    rcClass=FastInstanceChecker.class;
  }
  rc=cm.reasoner(rcClass,sources);
  configureComponent(cm,rc,parser);
  initComponent(cm,rc);
  rsMonitor.stop();
  Monitor lpMonitor=JamonMonitorLogger.getTimeMonitor(Start.class,"String_Node_Str").start();
  ConfFileOption problemOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends LearningProblem> lpClass;
  if (problemOption != null) {
    lpClass=confMapper.getLearningProblemClass(problemOption.getStringValue());
    if (lpClass == null) {
      handleError("String_Node_Str" + problemOption.getStringValue() + "String_Node_Str"+ problemOption+ "String_Node_Str"+ confMapper.getLearningProblems()+ "String_Node_Str");
    }
  }
 else {
    lpClass=PosNegLPStandard.class;
  }
  lp=cm.learningProblem(lpClass,rc);
  if (lpClass == PosNegLPStandard.class || lpClass == PosOnlyLP.class) {
    SortedSet<String> posExamples=parser.getPositiveExamples();
    cm.applyConfigEntry(lp,"String_Node_Str",posExamples);
  }
  if (lpClass == PosNegLPStandard.class) {
    SortedSet<String> negExamples=parser.getNegativeExamples();
    cm.applyConfigEntry(lp,"String_Node_Str",negExamples);
  }
  configureComponent(cm,lp,parser);
  initComponent(cm,lp);
  lpMonitor.stop();
  Monitor laMonitor=JamonMonitorLogger.getTimeMonitor(Start.class,"String_Node_Str").start();
  ConfFileOption algorithmOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends LearningAlgorithm> laClass;
  if (algorithmOption != null) {
    laClass=confMapper.getLearningAlgorithmClass(algorithmOption.getStringValue());
    if (laClass == null) {
      handleError("String_Node_Str" + algorithmOption.getStringValue() + "String_Node_Str"+ algorithmOption+ "String_Node_Str"+ confMapper.getLearningAlgorithms()+ "String_Node_Str");
    }
  }
 else {
    laClass=ROLComponent2.class;
  }
  try {
    la=cm.learningAlgorithm(laClass,lp,rc);
  }
 catch (  LearningProblemUnsupportedException e) {
    e.printStackTrace();
  }
  configureComponent(cm,la,parser);
  initComponent(cm,la);
  laMonitor.stop();
  performExports(parser,baseDir,sources,rc);
  processCLIOptions(cm,parser,rc,lp);
  if (logger.isInfoEnabled()) {
    System.out.println("String_Node_Str");
  }
}