Program: 190593
Project: 190593
Buggy source:
public ArrayList<Wordform> generateInflections(Lexeme lexeme,String lemma){
  String trešāSakne=null, vārds;
  ArrayList<Wordform> inflections=new ArrayList<Wordform>(1);
  if (lexeme.getParadigm().getStems() == 3) {
    trešāSakne=lexeme.getStem(2);
  }
  if (lexeme.getParadigm().getID() == 29 || lexeme.getParadigm().getID() == 25) {
    Ending ending=lexeme.getParadigm().getLemmaEnding();
    for (    Lexeme formLexeme : this.hardcodedForms.get(lemma)) {
      Wordform wf=new Wordform(formLexeme.getStem(0),formLexeme,ending);
      if (wf.isMatchingWeak(AttributeNames.i_Generate,AttributeNames.v_Yes))       inflections.add(wf);
    }
    return inflections;
  }
  for (  Ending ending : lexeme.getParadigm().endings) {
    if (ending.getValue(AttributeNames.i_PartOfSpeech) == null || ending.getValue(AttributeNames.i_PartOfSpeech).equals(lexeme.getValue(AttributeNames.i_PartOfSpeech)) || lexeme.getValue(AttributeNames.i_PartOfSpeech) == null) {
      boolean vispārākāPak=ending.isMatchingStrong(AttributeNames.i_Definiteness,AttributeNames.v_Definite) || ending.isMatchingStrong(AttributeNames.i_PartOfSpeech,AttributeNames.v_Adverb);
      boolean properName=lexeme.isMatchingStrong(AttributeNames.i_NounType,AttributeNames.v_ProperNoun);
      ArrayList<Variants> celmi=Mijas.MijasLocīšanai(lexeme.getStem(ending.stemID - 1),ending.getMija(),trešāSakne,vispārākāPak,properName);
      for (      Variants celms : celmi) {
        vārds=celms.celms + ending.getEnding();
        vārds=recapitalize(vārds,lemma);
        Wordform locījums=new Wordform(vārds,lexeme,ending);
        locījums.addAttributes(celms);
        boolean validOption=locījums.isMatchingWeak(AttributeNames.i_Generate,AttributeNames.v_Yes);
        if (locījums.isMatchingStrong(AttributeNames.i_NumberSpecial,AttributeNames.v_PlurareTantum) && locījums.isMatchingStrong(AttributeNames.i_Number,AttributeNames.v_Singular))         validOption=false;
        if (locījums.isMatchingStrong(AttributeNames.i_NumberSpecial,AttributeNames.v_SingulareTantum) && locījums.isMatchingStrong(AttributeNames.i_Number,AttributeNames.v_Plural))         validOption=false;
        if (locījums.isMatchingStrong(AttributeNames.i_Declension,AttributeNames.v_InflexibleGenitive) && !locījums.isMatchingStrong(AttributeNames.i_Case,AttributeNames.v_Genitive))         validOption=false;
        if (GenerationBlacklist.blacklist(locījums))         validOption=false;
        if (validOption)         inflections.add(locījums);
      }
    }
  }
  for (  Lexeme formLexeme : this.hardcodedForms.get(lemma)) {
    Ending ending=formLexeme.getParadigm().getLemmaEnding();
    Wordform hardcoded=new Wordform(formLexeme.getStem(0),formLexeme,ending);
    Wordform override=null;
    for (    Wordform form : inflections) {
      if (form.isMatchingWeak(formLexeme)) {
        override=form;
      }
    }
    if (override != null) {
      inflections.remove(override);
    }
    inflections.add(hardcoded);
  }
  return inflections;
}

Fixed version (ground truth):
public ArrayList<Wordform> generateInflections(Lexeme lexeme,String lemma){
  String trešāSakne=null, vārds;
  ArrayList<Wordform> inflections=new ArrayList<Wordform>(1);
  if (lexeme.getParadigm().getStems() == 3) {
    trešāSakne=lexeme.getStem(2);
  }
  if (lexeme.getParadigm().getID() == 29 || lexeme.getParadigm().getID() == 25) {
    Ending ending=lexeme.getParadigm().getLemmaEnding();
    for (    Lexeme formLexeme : this.hardcodedForms.get(lemma)) {
      Wordform wf=new Wordform(formLexeme.getStem(0),formLexeme,ending);
      if (wf.isMatchingWeak(AttributeNames.i_Generate,AttributeNames.v_Yes))       inflections.add(wf);
    }
    return inflections;
  }
  for (  Ending ending : lexeme.getParadigm().endings) {
    if (ending.getValue(AttributeNames.i_PartOfSpeech) == null || ending.getValue(AttributeNames.i_PartOfSpeech).equals(lexeme.getValue(AttributeNames.i_PartOfSpeech)) || lexeme.getValue(AttributeNames.i_PartOfSpeech) == null) {
      boolean vispārākāPak=ending.isMatchingStrong(AttributeNames.i_Definiteness,AttributeNames.v_Definite) || ending.isMatchingStrong(AttributeNames.i_PartOfSpeech,AttributeNames.v_Adverb);
      boolean properName=lexeme.isMatchingStrong(AttributeNames.i_NounType,AttributeNames.v_ProperNoun);
      ArrayList<Variants> celmi=Mijas.MijasLocīšanai(lexeme.getStem(ending.stemID - 1),ending.getMija(),trešāSakne,vispārākāPak,properName);
      for (      Variants celms : celmi) {
        vārds=celms.celms + ending.getEnding();
        vārds=recapitalize(vārds,lemma);
        Wordform locījums=new Wordform(vārds,lexeme,ending);
        locījums.addAttributes(celms);
        boolean validOption=locījums.isMatchingWeak(AttributeNames.i_Generate,AttributeNames.v_Yes);
        if (locījums.isMatchingStrong(AttributeNames.i_NumberSpecial,AttributeNames.v_PlurareTantum) && locījums.isMatchingStrong(AttributeNames.i_Number,AttributeNames.v_Singular))         validOption=false;
        if (locījums.isMatchingStrong(AttributeNames.i_NumberSpecial,AttributeNames.v_SingulareTantum) && locījums.isMatchingStrong(AttributeNames.i_Number,AttributeNames.v_Plural))         validOption=false;
        if (locījums.isMatchingStrong(AttributeNames.i_Declension,AttributeNames.v_InflexibleGenitive) && !locījums.isMatchingStrong(AttributeNames.i_Case,AttributeNames.v_Genitive))         validOption=false;
        if (GenerationBlacklist.blacklist(locījums))         validOption=false;
        if (validOption)         inflections.add(locījums);
      }
    }
  }
  for (  Lexeme formLexeme : this.hardcodedForms.get(lemma)) {
    Ending ending=formLexeme.getParadigm().getLemmaEnding();
    Wordform hardcoded=new Wordform(formLexeme.getStem(0),formLexeme,ending);
    if (!lexeme.getParadigm().isMatchingWeak(AttributeNames.i_PartOfSpeech,hardcoded.getValue(AttributeNames.i_PartOfSpeech)))     continue;
    Wordform override=null;
    for (    Wordform form : inflections) {
      if (form.isMatchingWeak(formLexeme)) {
        override=form;
      }
    }
    if (override != null) {
      inflections.remove(override);
    }
    inflections.add(hardcoded);
  }
  return inflections;
}