Program: 49828
Project: 49828
Buggy source:
/** 
 * Returns all patterns from the index and their factFeatures for reverb and the wordnet distance and the overall boa-boaScore.
 * @param propertyUri
 * @param language 
 * @return a list of patterns
 */
public List<Pattern> querySolrIndex(String propertyUri,int numberOfBoaPatterns,double scoreThreshold,String language){
  this.logger.debug("String_Node_Str" + propertyUri + "String_Node_Str"+ language+ "String_Node_Str");
  Map<String,Pattern> patterns=new HashMap<String,Pattern>();
  try {
    if (propertyUri.equals("String_Node_Str"))     propertyUri="String_Node_Str";
    SolrQuery query=new SolrQuery("String_Node_Str" + propertyUri + "String_Node_Str");
    query.addField("String_Node_Str");
    query.addField("String_Node_Str");
    query.addField("String_Node_Str");
    query.addField("String_Node_Str");
    query.addField("String_Node_Str");
    query.addSortField("String_Node_Str",ORDER.desc);
    if (numberOfBoaPatterns > 0)     query.setRows(numberOfBoaPatterns);
    String key=propertyUri + numberOfBoaPatterns + language;
    if (!this.queryCache.containsKey(key)) {
      if (language.equals("String_Node_Str"))       this.queryCache.put(key,enIndex.query(query));
 else       if (language.equals("String_Node_Str"))       this.queryCache.put(key,deIndex.query(query));
 else       if (language.equals("String_Node_Str"))       this.queryCache.put(key,frIndex.query(query));
    }
    SolrDocumentList docList=this.queryCache.get(key).getResults();
    for (    SolrDocument d : docList) {
      Pattern pattern=new Pattern();
      pattern.naturalLanguageRepresentation=(String)d.get("String_Node_Str");
      pattern.generalized=(String)d.get("String_Node_Str");
      pattern.naturalLanguageRepresentationWithoutVariables=(String)d.get("String_Node_Str");
      pattern.posTags=(String)d.get("String_Node_Str");
      pattern.boaScore=(Double)d.get("String_Node_Str");
      pattern.language=language;
      this.logger.debug("String_Node_Str" + pattern.naturalLanguageRepresentation);
      if (!patterns.containsKey(pattern.normalize()) && patterns.size() < Defacto.DEFACTO_CONFIG.getIntegerSetting("String_Node_Str","String_Node_Str"))       patterns.put(pattern.normalize(),pattern);
    }
  }
 catch (  SolrServerException e) {
    System.out.println("String_Node_Str" + e);
    e.printStackTrace();
  }
  List<Pattern> patternList=new ArrayList<Pattern>(patterns.values());
  Collections.sort(patternList,new Comparator<Pattern>(){
    @Override public int compare(    Pattern pattern1,    Pattern pattern2){
      double difference=pattern1.boaScore - pattern2.boaScore;
      if (difference > 0)       return -1;
      if (difference < 0)       return 1;
      return pattern1.naturalLanguageRepresentation.compareTo(pattern2.naturalLanguageRepresentation);
    }
  }
);
  return patternList;
}

Fixed version (ground truth):
/** 
 * Returns all patterns from the index and their factFeatures for reverb and the wordnet distance and the overall boa-boaScore.
 * @param propertyUri
 * @param language 
 * @return a list of patterns
 */
public List<Pattern> querySolrIndex(String propertyUri,int numberOfBoaPatterns,double scoreThreshold,String language){
  this.logger.debug("String_Node_Str" + propertyUri + "String_Node_Str"+ language+ "String_Node_Str");
  Map<String,Pattern> patterns=new HashMap<String,Pattern>();
  try {
    if (propertyUri.equals("String_Node_Str"))     propertyUri="String_Node_Str";
    SolrQuery query=new SolrQuery("String_Node_Str" + propertyUri + "String_Node_Str");
    query.addField("String_Node_Str");
    query.addField("String_Node_Str");
    query.addField("String_Node_Str");
    query.addField("String_Node_Str");
    query.addField("String_Node_Str");
    query.addSortField("String_Node_Str",ORDER.desc);
    if (numberOfBoaPatterns > 0)     query.setRows(numberOfBoaPatterns);
    String key=propertyUri + numberOfBoaPatterns + language;
    System.out.println(query);
    if (!this.queryCache.containsKey(key)) {
      if (language.equals("String_Node_Str"))       this.queryCache.put(key,enIndex.query(query));
 else       if (language.equals("String_Node_Str"))       this.queryCache.put(key,deIndex.query(query));
 else       if (language.equals("String_Node_Str"))       this.queryCache.put(key,frIndex.query(query));
    }
    SolrDocumentList docList=this.queryCache.get(key).getResults();
    for (    SolrDocument d : docList) {
      Pattern pattern=new Pattern();
      pattern.naturalLanguageRepresentation=(String)d.get("String_Node_Str");
      pattern.generalized=(String)d.get("String_Node_Str");
      pattern.naturalLanguageRepresentationWithoutVariables=(String)d.get("String_Node_Str");
      pattern.posTags=(String)d.get("String_Node_Str");
      pattern.boaScore=(Double)d.get("String_Node_Str");
      pattern.language=language;
      this.logger.debug("String_Node_Str" + pattern.naturalLanguageRepresentation);
      if (!patterns.containsKey(pattern.normalize()) && patterns.size() < Defacto.DEFACTO_CONFIG.getIntegerSetting("String_Node_Str","String_Node_Str"))       patterns.put(pattern.normalize(),pattern);
    }
  }
 catch (  SolrServerException e) {
    System.out.println("String_Node_Str" + e);
    e.printStackTrace();
  }
  List<Pattern> patternList=new ArrayList<Pattern>(patterns.values());
  Collections.sort(patternList,new Comparator<Pattern>(){
    @Override public int compare(    Pattern pattern1,    Pattern pattern2){
      double difference=pattern1.boaScore - pattern2.boaScore;
      if (difference > 0)       return -1;
      if (difference < 0)       return 1;
      return pattern1.naturalLanguageRepresentation.compareTo(pattern2.naturalLanguageRepresentation);
    }
  }
);
  return patternList;
}