Program: 135629
Project: 135629
Buggy source:
/** 
 * @param sentence
 * @throws Exception
 */
public void disambiguate(List<Token> sentence) throws Exception {
  execStats=new ExecuteStatistics();
  System.out.println();
  for (int i=0; i < sentence.size(); i++) {
    System.out.print("String_Node_Str");
    Token token=sentence.get(i);
    if (token.isToDisambiguate() && token.getSynsetList().isEmpty()) {
      Map<String,Float> contextBag=buildContext(sentence,i);
      if (token.getPos() != POSenum.OTHER) {
        List<BabelSense> senses=null;
        if (token.getPos() == POSenum.NOUN) {
          senses=lookupSense(language,token.getLemma(),POS.NOUN);
        }
 else         if (token.getPos() == POSenum.VERB) {
          senses=lookupSense(language,token.getLemma(),POS.VERB);
        }
 else         if (token.getPos() == POSenum.ADJ) {
          senses=lookupSense(language,token.getLemma(),POS.ADJECTIVE);
        }
 else         if (token.getPos() == POSenum.ADV) {
          senses=lookupSense(language,token.getLemma(),POS.ADVERB);
        }
        if (senses != null) {
          List<Map<String,Float>> buildGlossBag=buildGlossBag(senses);
          for (int j=0; j < senses.size(); j++) {
            double sim=0;
            Map<String,Float> bag=buildGlossBag.get(j);
            sim=sim(contextBag,bag);
            if (senseFreq != null) {
              if (language.equals(Language.EN)) {
                String lemmakey=token.getLemma() + "String_Node_Str" + convertPosEnum(token.getPos());
                float freq=senseFreq.getFreq(lemmakey,senses.get(j).getWordNetOffset());
                sim=0.5 * sim + 0.5 * freq;
              }
 else {
                String mainSense=senses.get(j).getSynset().getMainSense();
                if (mainSense != null && !mainSense.startsWith("String_Node_Str") && mainSense.length() > 0) {
                  int si=mainSense.lastIndexOf("String_Node_Str");
                  if (si >= 0) {
                    String lemmakey=mainSense.substring(0,si);
                    float maxFreq=0;
                    for (int l=0; l < senses.get(j).getSynset().getWordNetOffsets().size(); l++) {
                      float freq=senseFreq.getFreq(lemmakey,senses.get(j).getSynset().getWordNetOffsets().get(l));
                      if (freq > maxFreq) {
                        maxFreq=freq;
                      }
                    }
                    sim=0.5 * sim + 0.5 * maxFreq;
                  }
                }
              }
            }
            if (outType == OUT_BABELNET) {
              token.getSynsetList().add(new SynsetOut(senses.get(j).getSynset().getId(),sim));
            }
 else             if (outType == OUT_WORDNET) {
              token.getSynsetList().add(new SynsetOut(senses.get(j).getSensekey(),sim));
            }
 else {
              throw new Exception("String_Node_Str" + outType);
            }
          }
          Collections.sort(token.getSynsetList());
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @param sentence
 * @throws Exception
 */
public void disambiguate(List<Token> sentence) throws Exception {
  execStats=new ExecuteStatistics();
  System.out.println();
  for (int i=0; i < sentence.size(); i++) {
    System.out.print("String_Node_Str");
    Token token=sentence.get(i);
    if (token.isToDisambiguate() && token.getSynsetList().isEmpty()) {
      Map<String,Float> contextBag=buildContext(sentence,i);
      if (token.getPos() != POSenum.OTHER) {
        List<BabelSense> senses=null;
        if (token.getPos() == POSenum.NOUN) {
          senses=lookupSense(language,token.getLemma(),POS.NOUN);
        }
 else         if (token.getPos() == POSenum.VERB) {
          senses=lookupSense(language,token.getLemma(),POS.VERB);
        }
 else         if (token.getPos() == POSenum.ADJ) {
          senses=lookupSense(language,token.getLemma(),POS.ADJECTIVE);
        }
 else         if (token.getPos() == POSenum.ADV) {
          senses=lookupSense(language,token.getLemma(),POS.ADVERB);
        }
        if (senses != null) {
          List<Map<String,Float>> buildGlossBag=buildGlossBag(senses);
          for (int j=0; j < senses.size(); j++) {
            double sim=0;
            Map<String,Float> bag=buildGlossBag.get(j);
            sim=sim(contextBag,bag);
            if (senseFreq != null) {
              if (language.equals(Language.EN)) {
                String lemmakey=token.getLemma() + "String_Node_Str" + convertPosEnum(token.getPos());
                float freq=senseFreq.getFreq(lemmakey,senses.get(j).getWordNetOffset());
                sim=0.5 * sim + 0.5 * freq;
              }
 else {
                String mainSense=senses.get(j).getSynset().getMainSense();
                if (mainSense != null && !mainSense.startsWith("String_Node_Str") && mainSense.length() > 0) {
                  int si=mainSense.lastIndexOf("String_Node_Str");
                  if (si >= 0) {
                    String lemmakey=mainSense.substring(0,si);
                    float maxFreq=1 / (float)senses.size();
                    for (int l=0; l < senses.get(j).getSynset().getWordNetOffsets().size(); l++) {
                      float freq=senseFreq.getFreq(lemmakey,senses.get(j).getSynset().getWordNetOffsets().get(l));
                      if (freq > maxFreq) {
                        maxFreq=freq;
                      }
                    }
                    sim=0.5 * sim + 0.5 * maxFreq;
                  }
                }
 else {
                  sim=0.5 * sim + 0.5 / (double)senses.size();
                }
              }
            }
            if (outType == OUT_BABELNET) {
              token.getSynsetList().add(new SynsetOut(senses.get(j).getSynset().getId(),sim));
            }
 else             if (outType == OUT_WORDNET) {
              token.getSynsetList().add(new SynsetOut(senses.get(j).getSensekey(),sim));
            }
 else {
              throw new Exception("String_Node_Str" + outType);
            }
          }
          Collections.sort(token.getSynsetList());
        }
      }
    }
  }
}