Program: 31742
Project: 31742
Buggy source:
public void testIndexingConsistency() throws MauiFilterException {
  String vocabularyPath="String_Node_Str";
  String vocabularyName="String_Node_Str";
  String datasetPath="String_Node_Str";
  String indexers="String_Node_Str";
  Stemmer stemmer=new PorterStemmer();
  String language="String_Node_Str";
  String encoding="String_Node_Str";
  Stopwords stopwords=StopwordsFactory.makeStopwords(language);
  Vocabulary vocabulary=new Vocabulary();
  vocabulary.setStemmer(stemmer);
  vocabulary.setLanguage(language);
  vocabulary.setStopwords(stopwords);
  vocabulary.setSerialize(true);
  vocabulary.initializeVocabulary(vocabularyPath,vocabularyName);
  MauiTopicExtractor topicExtractor=new MauiTopicExtractor();
  MauiModelBuilder modelBuilder=new MauiModelBuilder();
  modelBuilder.stemmer=stemmer;
  modelBuilder.stopwords=stopwords;
  modelBuilder.documentLanguage=language;
  modelBuilder.documentEncoding=encoding;
  topicExtractor.stemmer=stemmer;
  topicExtractor.stopwords=stopwords;
  topicExtractor.documentEncoding=encoding;
  topicExtractor.documentLanguage=language;
  modelBuilder.setBasicFeatures(true);
  modelBuilder.setKeyphrasenessFeature(true);
  modelBuilder.setFrequencyFeatures(true);
  modelBuilder.setPositionsFeatures(true);
  modelBuilder.setLengthFeature(true);
  modelBuilder.setThesaurusFeatures(true);
  modelBuilder.setWikipediaFeatures(false);
  modelBuilder.setVocabulary(vocabulary);
  modelBuilder.setVocabularyName(vocabularyName);
  modelBuilder.modelName="String_Node_Str";
  List<MauiDocument> testDocuments=DataLoader.loadTestDocuments(datasetPath);
  List<IndexerTopics> indexersTopics=DataLoader.readIndexersTopics(indexers);
  DataLoader.addTopicsFromIndexers(testDocuments,indexersTopics);
  int numDocs=testDocuments.size();
  int fold=numDocs - 1;
  int part=numDocs / fold;
  int startTest, endTest;
  List<MauiTopics> allTopics=new ArrayList<MauiTopics>();
  for (int run=1; run <= fold; run++) {
    startTest=(run - 1) * part;
    endTest=startTest + part;
    log.info("String_Node_Str" + run + "String_Node_Str"+ startTest+ "String_Node_Str"+ endTest);
    List<MauiDocument> test=new ArrayList<MauiDocument>();
    List<MauiDocument> train=new ArrayList<MauiDocument>();
    for (int i=0; i < testDocuments.size(); i++) {
      if (i >= startTest && i < endTest) {
        test.add(testDocuments.get(i));
      }
 else {
        train.add(testDocuments.get(i));
      }
    }
    long startTime=System.currentTimeMillis();
    MauiFilter mauiFilter=modelBuilder.buildModel(train);
    long stopTime=System.currentTimeMillis();
    long elapsedTime=stopTime - startTime;
    log.info("String_Node_Str" + elapsedTime + "String_Node_Str");
    topicExtractor.setModel(mauiFilter);
    List<MauiTopics> topics=topicExtractor.extractTopics(test);
    allTopics.addAll(topics);
  }
  Evaluator.evaluateConsistency(indexersTopics,allTopics);
}

Fixed version (ground truth):
public void testIndexingConsistency() throws MauiFilterException {
  String vocabularyFormat="String_Node_Str";
  String vocabularyPath="String_Node_Str";
  String datasetPath="String_Node_Str";
  String indexers="String_Node_Str";
  Stemmer stemmer=new PorterStemmer();
  String language="String_Node_Str";
  String encoding="String_Node_Str";
  Stopwords stopwords=StopwordsFactory.makeStopwords(language);
  Vocabulary vocabulary=new Vocabulary();
  vocabulary.setStemmer(stemmer);
  vocabulary.setLanguage(language);
  vocabulary.setStopwords(stopwords);
  vocabulary.setSerialize(true);
  vocabulary.initializeVocabulary(vocabularyPath,vocabularyFormat);
  MauiTopicExtractor topicExtractor=new MauiTopicExtractor();
  MauiModelBuilder modelBuilder=new MauiModelBuilder();
  modelBuilder.stemmer=stemmer;
  modelBuilder.stopwords=stopwords;
  modelBuilder.documentLanguage=language;
  modelBuilder.documentEncoding=encoding;
  topicExtractor.stemmer=stemmer;
  topicExtractor.stopwords=stopwords;
  topicExtractor.documentEncoding=encoding;
  topicExtractor.documentLanguage=language;
  modelBuilder.setBasicFeatures(true);
  modelBuilder.setKeyphrasenessFeature(true);
  modelBuilder.setFrequencyFeatures(true);
  modelBuilder.setPositionsFeatures(true);
  modelBuilder.setLengthFeature(true);
  modelBuilder.setThesaurusFeatures(true);
  modelBuilder.setWikipediaFeatures(false);
  modelBuilder.setVocabulary(vocabulary);
  modelBuilder.setVocabularyName(vocabularyPath);
  modelBuilder.modelName="String_Node_Str";
  List<MauiDocument> testDocuments=DataLoader.loadTestDocuments(datasetPath);
  List<IndexerTopics> indexersTopics=DataLoader.readIndexersTopics(indexers);
  DataLoader.addTopicsFromIndexers(testDocuments,indexersTopics);
  int numDocs=testDocuments.size();
  int fold=numDocs - 1;
  int part=numDocs / fold;
  int startTest, endTest;
  List<MauiTopics> allTopics=new ArrayList<MauiTopics>();
  for (int run=1; run <= fold; run++) {
    startTest=(run - 1) * part;
    endTest=startTest + part;
    log.info("String_Node_Str" + run + "String_Node_Str"+ startTest+ "String_Node_Str"+ endTest);
    List<MauiDocument> test=new ArrayList<MauiDocument>();
    List<MauiDocument> train=new ArrayList<MauiDocument>();
    for (int i=0; i < testDocuments.size(); i++) {
      if (i >= startTest && i < endTest) {
        test.add(testDocuments.get(i));
      }
 else {
        train.add(testDocuments.get(i));
      }
    }
    long startTime=System.currentTimeMillis();
    MauiFilter mauiFilter=modelBuilder.buildModel(train);
    long stopTime=System.currentTimeMillis();
    long elapsedTime=stopTime - startTime;
    log.info("String_Node_Str" + elapsedTime + "String_Node_Str");
    topicExtractor.setModel(mauiFilter);
    List<MauiTopics> topics=topicExtractor.extractTopics(test);
    allTopics.addAll(topics);
  }
  Evaluator.evaluateConsistency(indexersTopics,allTopics);
}