Program: 10261
Project: 10261
Buggy source:
/** 
 * Initialise all components based on conf file.
 * @param file Conf file to read. 
 */
public Start(File file){
  String baseDir=file.getParentFile().getPath();
  System.out.print("String_Node_Str");
  long cmStartTime=System.nanoTime();
  ComponentManager cm=ComponentManager.getInstance();
  long cmTime=System.nanoTime() - cmStartTime;
  System.out.println("String_Node_Str" + Helper.prettyPrintNanoSeconds(cmTime) + "String_Node_Str");
  Map<Class<? extends Component>,String> componentPrefixMapping=createComponentPrefixMapping();
  ConfParser parser=ConfParser.parseFile(file);
  Set<KnowledgeSource> 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().toString());
    sources.add(ks);
    configureComponent(cm,ks,componentPrefixMapping,parser);
    initComponent(cm,ks);
  }
  ConfFileOption reasonerOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends ReasonerComponent> reasonerClass=null;
  if (reasonerOption == null || reasonerOption.getStringValue().equals("String_Node_Str"))   reasonerClass=DIGReasoner.class;
 else   if (reasonerOption.getStringValue().equals("String_Node_Str"))   reasonerClass=OWLAPIReasoner.class;
 else   if (reasonerOption.getStringValue().equals("String_Node_Str"))   reasonerClass=FastRetrievalReasoner.class;
 else {
    handleError("String_Node_Str" + reasonerOption.getStringValue() + "String_Node_Str");
  }
  ReasonerComponent reasoner=cm.reasoner(reasonerClass,sources);
  configureComponent(cm,reasoner,componentPrefixMapping,parser);
  initComponent(cm,reasoner);
  rs=cm.reasoningService(reasoner);
  ConfFileOption problemOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends LearningProblem> lpClass=null;
  if (problemOption == null || problemOption.getStringValue().equals("String_Node_Str"))   lpClass=PosNegDefinitionLP.class;
 else   if (problemOption.getStringValue().equals("String_Node_Str"))   lpClass=PosNegInclusionLP.class;
 else   if (problemOption.getStringValue().equals("String_Node_Str"))   lpClass=PosOnlyDefinitionLP.class;
 else   handleError("String_Node_Str" + problemOption.getValue() + "String_Node_Str");
  lp=cm.learningProblem(lpClass,rs);
  SortedSet<String> posExamples=parser.getPositiveExamples();
  SortedSet<String> negExamples=parser.getNegativeExamples();
  cm.applyConfigEntry(lp,"String_Node_Str",posExamples);
  if (lpClass != PosOnlyDefinitionLP.class)   cm.applyConfigEntry(lp,"String_Node_Str",negExamples);
  configureComponent(cm,lp,componentPrefixMapping,parser);
  initComponent(cm,lp);
  ConfFileOption algorithmOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends LearningAlgorithm> laClass=null;
  if (algorithmOption == null || algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=ROLearner.class;
 else   if (algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=ExampleBasedROLComponent.class;
 else   if (algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=GP.class;
 else   if (algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=BruteForceLearner.class;
 else   if (algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=RandomGuesser.class;
 else   handleError("String_Node_Str" + algorithmOption);
  la=cm.learningAlgorithm(laClass,lp,rs);
  configureComponent(cm,la,componentPrefixMapping,parser);
  initComponent(cm,la);
  performExports(parser,baseDir,sources,rs);
  boolean oneLineExampleInfo=true;
  int maxExampleStringLength=Math.max(posExamples.toString().length(),negExamples.toString().length());
  if (maxExampleStringLength > 100)   oneLineExampleInfo=false;
  if (oneLineExampleInfo) {
    System.out.println("String_Node_Str" + posExamples.size() + "String_Node_Str"+ posExamples);
    System.out.println("String_Node_Str" + negExamples.size() + "String_Node_Str"+ negExamples);
  }
 else {
    System.out.println("String_Node_Str" + posExamples.size() + "String_Node_Str");
    for (    String ex : posExamples)     System.out.println("String_Node_Str" + ex);
    System.out.println("String_Node_Str" + negExamples.size() + "String_Node_Str");
    for (    String ex : negExamples)     System.out.println("String_Node_Str" + ex);
  }
  processCLIOptions(cm,parser,rs);
}

Fixed version (ground truth):
/** 
 * Initialise all components based on conf file.
 * @param file Conf file to read. 
 */
public Start(File file){
  String baseDir=file.getParentFile().getPath();
  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);
  Map<Class<? extends Component>,String> componentPrefixMapping=createComponentPrefixMapping();
  ConfParser parser=ConfParser.parseFile(file);
  Set<KnowledgeSource> 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().toString());
    sources.add(ks);
    configureComponent(cm,ks,componentPrefixMapping,parser);
    initComponent(cm,ks);
  }
  ConfFileOption reasonerOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends ReasonerComponent> reasonerClass=null;
  if (reasonerOption == null || reasonerOption.getStringValue().equals("String_Node_Str"))   reasonerClass=DIGReasoner.class;
 else   if (reasonerOption.getStringValue().equals("String_Node_Str"))   reasonerClass=OWLAPIReasoner.class;
 else   if (reasonerOption.getStringValue().equals("String_Node_Str"))   reasonerClass=FastRetrievalReasoner.class;
 else {
    handleError("String_Node_Str" + reasonerOption.getStringValue() + "String_Node_Str");
  }
  ReasonerComponent reasoner=cm.reasoner(reasonerClass,sources);
  configureComponent(cm,reasoner,componentPrefixMapping,parser);
  initComponent(cm,reasoner);
  rs=cm.reasoningService(reasoner);
  ConfFileOption problemOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends LearningProblem> lpClass=null;
  if (problemOption == null || problemOption.getStringValue().equals("String_Node_Str"))   lpClass=PosNegDefinitionLP.class;
 else   if (problemOption.getStringValue().equals("String_Node_Str"))   lpClass=PosNegInclusionLP.class;
 else   if (problemOption.getStringValue().equals("String_Node_Str"))   lpClass=PosOnlyDefinitionLP.class;
 else   handleError("String_Node_Str" + problemOption.getValue() + "String_Node_Str");
  lp=cm.learningProblem(lpClass,rs);
  SortedSet<String> posExamples=parser.getPositiveExamples();
  SortedSet<String> negExamples=parser.getNegativeExamples();
  cm.applyConfigEntry(lp,"String_Node_Str",posExamples);
  if (lpClass != PosOnlyDefinitionLP.class)   cm.applyConfigEntry(lp,"String_Node_Str",negExamples);
  configureComponent(cm,lp,componentPrefixMapping,parser);
  initComponent(cm,lp);
  ConfFileOption algorithmOption=parser.getConfOptionsByName("String_Node_Str");
  Class<? extends LearningAlgorithm> laClass=null;
  if (algorithmOption == null || algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=ROLearner.class;
 else   if (algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=ExampleBasedROLComponent.class;
 else   if (algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=GP.class;
 else   if (algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=BruteForceLearner.class;
 else   if (algorithmOption.getStringValue().equals("String_Node_Str"))   laClass=RandomGuesser.class;
 else   handleError("String_Node_Str" + algorithmOption);
  la=cm.learningAlgorithm(laClass,lp,rs);
  configureComponent(cm,la,componentPrefixMapping,parser);
  initComponent(cm,la);
  performExports(parser,baseDir,sources,rs);
  boolean oneLineExampleInfo=true;
  int maxExampleStringLength=Math.max(posExamples.toString().length(),negExamples.toString().length());
  if (maxExampleStringLength > 100)   oneLineExampleInfo=false;
  if (oneLineExampleInfo) {
    System.out.println("String_Node_Str" + posExamples.size() + "String_Node_Str"+ posExamples);
    System.out.println("String_Node_Str" + negExamples.size() + "String_Node_Str"+ negExamples);
  }
 else {
    System.out.println("String_Node_Str" + posExamples.size() + "String_Node_Str");
    for (    String ex : posExamples)     System.out.println("String_Node_Str" + ex);
    System.out.println("String_Node_Str" + negExamples.size() + "String_Node_Str");
    for (    String ex : negExamples)     System.out.println("String_Node_Str" + ex);
  }
  processCLIOptions(cm,parser,rs);
}