Program: 171289
Project: 171289
Buggy source:
private void manageRightListeners(){
  documentRight=(Document)webEngineRight.executeScript("String_Node_Str");
  EventListenerDataMap.put(documentRight,new ArrayList<>());
  List<InventorySlot> concealedSlots=new ArrayList<>();
  if (RenderingEngine.getCharacterToRender() != null) {
    concealedSlots=RenderingEngine.getCharacterToRender().getInventorySlotsConcealed();
  }
  String id;
  for (  InventorySlot invSlot : InventorySlot.values()) {
    id=invSlot.toString() + "String_Node_Str";
    if (invSlot != InventorySlot.WEAPON_MAIN && invSlot != InventorySlot.WEAPON_OFFHAND) {
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        if (concealedSlots.contains(invSlot)) {
          addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el2=new TooltipInformationEventListener().setInformation(Util.capitaliseSentence(invSlot.getName()) + "String_Node_Str","String_Node_Str");
          addEventListener(documentRight,id,"String_Node_Str",el2,false);
        }
 else {
          InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setClothingEquipped(RenderingEngine.getCharacterToRender(),invSlot);
          addEventListener(documentRight,id,"String_Node_Str",el,false);
          addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
          InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setInventorySlot(invSlot,RenderingEngine.getCharacterToRender());
          addEventListener(documentRight,id,"String_Node_Str",el2,false);
        }
      }
    }
 else {
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setWeaponEquipped(RenderingEngine.getCharacterToRender(),invSlot);
        addEventListener(documentRight,id,"String_Node_Str",el,false);
        addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setInventorySlot(invSlot,RenderingEngine.getCharacterToRender());
        addEventListener(documentRight,id,"String_Node_Str",el2,false);
      }
    }
  }
  for (  NPC character : Main.game.getCharactersPresent()) {
    id="String_Node_Str" + character.getId();
    if (((EventTarget)documentRight.getElementById(id)) != null) {
      ((EventTarget)documentRight.getElementById(id)).addEventListener("String_Node_Str",e -> {
        openCharactersPresent(Main.game.getNPCById(character.getId()));
      }
,false);
    }
  }
  if (Main.game.getPlayer() != null) {
    for (    Entry<AbstractWeapon,Integer> entry : Main.game.getPlayerCell().getInventory().getMapOfDuplicateWeapons().entrySet()) {
      id="String_Node_Str" + entry.getKey().hashCode();
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setWeaponInventory(entry.getKey(),null);
        addEventListener(documentRight,id,"String_Node_Str",el,false);
        addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setWeapon(entry.getKey(),null);
        addEventListener(documentRight,id,"String_Node_Str",el2,false);
      }
    }
    for (    Entry<AbstractClothing,Integer> entry : Main.game.getPlayerCell().getInventory().getMapOfDuplicateClothing().entrySet()) {
      id="String_Node_Str" + entry.getKey().hashCode();
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setClothingInventory(entry.getKey(),null);
        addEventListener(documentRight,id,"String_Node_Str",el,false);
        addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setClothing(entry.getKey(),null,null);
        addEventListener(documentRight,id,"String_Node_Str",el2,false);
      }
    }
    for (    Entry<AbstractItem,Integer> entry : Main.game.getPlayerCell().getInventory().getMapOfDuplicateItems().entrySet()) {
      id="String_Node_Str" + entry.getKey().hashCode();
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setItemInventory(entry.getKey(),null);
        addEventListener(documentRight,id,"String_Node_Str",el,false);
        addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setItem(entry.getKey(),null,null);
        addEventListener(documentRight,id,"String_Node_Str",el2,false);
      }
    }
  }
  if (RenderingEngine.getCharacterToRender() != null) {
    Attribute[] attributes={Attribute.HEALTH_MAXIMUM,Attribute.MANA_MAXIMUM,Attribute.EXPERIENCE,Attribute.MAJOR_PHYSIQUE,Attribute.MAJOR_ARCANE,Attribute.MAJOR_CORRUPTION,Attribute.AROUSAL,Attribute.LUST};
    List<GameCharacter> charactersBeingRendered=new ArrayList<>();
    if (Main.game.isInSex()) {
      charactersBeingRendered.addAll(Sex.getDominantParticipants().keySet());
      charactersBeingRendered.addAll(Sex.getSubmissiveParticipants().keySet());
    }
 else     if (Main.game.isInCombat()) {
      charactersBeingRendered.addAll(Combat.getEnemies());
    }
 else {
      charactersBeingRendered.add(RenderingEngine.getCharacterToRender());
    }
    charactersBeingRendered.remove(Main.game.getPlayer());
    for (    GameCharacter character : charactersBeingRendered) {
      String idModifier=character.getId() + "String_Node_Str";
      for (      Attribute a : attributes) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + a.getName())) != null) {
          if (a == Attribute.EXPERIENCE) {
            ((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + a.getName())).addEventListener("String_Node_Str",e -> {
              openCharactersPresent(character);
            }
,false);
          }
          addEventListener(documentRight,"String_Node_Str" + idModifier + a.getName(),"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + a.getName(),"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setAttribute(a,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + a.getName(),"String_Node_Str",el,false);
        }
      }
      if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + "String_Node_Str")) != null) {
        addEventListener(documentRight,"String_Node_Str" + idModifier + "String_Node_Str","String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,"String_Node_Str" + idModifier + "String_Node_Str","String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setExtraAttributes(character);
        addEventListener(documentRight,"String_Node_Str" + idModifier + "String_Node_Str","String_Node_Str",el,false);
      }
      for (      StatusEffect se : character.getStatusEffects()) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + se)) != null) {
          addEventListener(documentRight,"String_Node_Str" + idModifier + se,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + se,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setStatusEffect(se,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + se,"String_Node_Str",el,false);
        }
      }
      for (      Perk p : character.getMajorPerks()) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + p)) != null) {
          addEventListener(documentRight,"String_Node_Str" + idModifier + p,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + p,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setPerk(p,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + p,"String_Node_Str",el,false);
        }
      }
      for (      Fetish f : character.getFetishes()) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + f)) != null) {
          addEventListener(documentRight,"String_Node_Str" + idModifier + f,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + f,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setFetish(f,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + f,"String_Node_Str",el,false);
        }
      }
      for (      SpecialAttack sa : character.getSpecialAttacks()) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + sa)) != null) {
          addEventListener(documentRight,"String_Node_Str" + idModifier + sa,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + sa,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setSpecialAttack(sa,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + sa,"String_Node_Str",el,false);
        }
      }
      if (character.getMainWeapon() != null) {
        for (        Spell s : character.getMainWeapon().getSpells()) {
          if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + s)) != null) {
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",moveTooltipListener,false);
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",hideTooltipListener,false);
            TooltipInformationEventListener el=new TooltipInformationEventListener().setSpell(s,character.getLevel(),character);
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",el,false);
          }
        }
      }
      if (character.getOffhandWeapon() != null) {
        for (        Spell s : character.getOffhandWeapon().getSpells()) {
          if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + s)) != null) {
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",moveTooltipListener,false);
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",hideTooltipListener,false);
            TooltipInformationEventListener el=new TooltipInformationEventListener().setSpell(s,character.getLevel(),character);
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",el,false);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
private void manageRightListeners(){
  documentRight=(Document)webEngineRight.executeScript("String_Node_Str");
  EventListenerDataMap.put(documentRight,new ArrayList<>());
  List<InventorySlot> concealedSlots=new ArrayList<>();
  if (RenderingEngine.getCharacterToRender() != null) {
    concealedSlots=RenderingEngine.getCharacterToRender().getInventorySlotsConcealed();
  }
  String id;
  for (  InventorySlot invSlot : InventorySlot.values()) {
    id=invSlot.toString() + "String_Node_Str";
    if (invSlot != InventorySlot.WEAPON_MAIN && invSlot != InventorySlot.WEAPON_OFFHAND) {
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        if (concealedSlots.contains(invSlot)) {
          addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el2=new TooltipInformationEventListener().setInformation(Util.capitaliseSentence(invSlot.getName()) + "String_Node_Str","String_Node_Str");
          addEventListener(documentRight,id,"String_Node_Str",el2,false);
        }
 else {
          InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setClothingEquipped(RenderingEngine.getCharacterToRender(),invSlot);
          addEventListener(documentRight,id,"String_Node_Str",el,false);
          addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
          InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setInventorySlot(invSlot,RenderingEngine.getCharacterToRender());
          addEventListener(documentRight,id,"String_Node_Str",el2,false);
        }
      }
    }
 else {
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setWeaponEquipped(RenderingEngine.getCharacterToRender(),invSlot);
        addEventListener(documentRight,id,"String_Node_Str",el,false);
        addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setInventorySlot(invSlot,RenderingEngine.getCharacterToRender());
        addEventListener(documentRight,id,"String_Node_Str",el2,false);
      }
    }
  }
  for (  NPC character : Main.game.getCharactersPresent()) {
    id="String_Node_Str" + character.getId();
    if (((EventTarget)documentRight.getElementById(id)) != null) {
      ((EventTarget)documentRight.getElementById(id)).addEventListener("String_Node_Str",e -> {
        openCharactersPresent(Main.game.getNPCById(character.getId()));
      }
,false);
    }
  }
  if (Main.game.getPlayer() != null) {
    for (    Entry<AbstractWeapon,Integer> entry : Main.game.getPlayerCell().getInventory().getMapOfDuplicateWeapons().entrySet()) {
      id="String_Node_Str" + entry.getKey().hashCode();
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        if (!Main.game.getCurrentDialogueNode().isInventoryDisabled()) {
          InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setWeaponInventory(entry.getKey(),null);
          addEventListener(documentRight,id,"String_Node_Str",el,false);
        }
        addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setWeapon(entry.getKey(),null);
        addEventListener(documentRight,id,"String_Node_Str",el2,false);
      }
    }
    for (    Entry<AbstractClothing,Integer> entry : Main.game.getPlayerCell().getInventory().getMapOfDuplicateClothing().entrySet()) {
      id="String_Node_Str" + entry.getKey().hashCode();
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        if (!Main.game.getCurrentDialogueNode().isInventoryDisabled()) {
          InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setClothingInventory(entry.getKey(),null);
          addEventListener(documentRight,id,"String_Node_Str",el,false);
        }
        addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setClothing(entry.getKey(),null,null);
        addEventListener(documentRight,id,"String_Node_Str",el2,false);
      }
    }
    for (    Entry<AbstractItem,Integer> entry : Main.game.getPlayerCell().getInventory().getMapOfDuplicateItems().entrySet()) {
      id="String_Node_Str" + entry.getKey().hashCode();
      if (((EventTarget)documentRight.getElementById(id)) != null) {
        if (!Main.game.getCurrentDialogueNode().isInventoryDisabled()) {
          InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setItemInventory(entry.getKey(),null);
          addEventListener(documentRight,id,"String_Node_Str",el,false);
        }
        addEventListener(documentRight,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setItem(entry.getKey(),null,null);
        addEventListener(documentRight,id,"String_Node_Str",el2,false);
      }
    }
  }
  if (RenderingEngine.getCharacterToRender() != null) {
    Attribute[] attributes={Attribute.HEALTH_MAXIMUM,Attribute.MANA_MAXIMUM,Attribute.EXPERIENCE,Attribute.MAJOR_PHYSIQUE,Attribute.MAJOR_ARCANE,Attribute.MAJOR_CORRUPTION,Attribute.AROUSAL,Attribute.LUST};
    List<GameCharacter> charactersBeingRendered=new ArrayList<>();
    if (Main.game.isInSex()) {
      charactersBeingRendered.addAll(Sex.getDominantParticipants().keySet());
      charactersBeingRendered.addAll(Sex.getSubmissiveParticipants().keySet());
    }
 else     if (Main.game.isInCombat()) {
      charactersBeingRendered.addAll(Combat.getEnemies());
    }
 else {
      charactersBeingRendered.add(RenderingEngine.getCharacterToRender());
    }
    charactersBeingRendered.remove(Main.game.getPlayer());
    for (    GameCharacter character : charactersBeingRendered) {
      String idModifier=character.getId() + "String_Node_Str";
      for (      Attribute a : attributes) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + a.getName())) != null) {
          if (a == Attribute.EXPERIENCE) {
            ((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + a.getName())).addEventListener("String_Node_Str",e -> {
              openCharactersPresent(character);
            }
,false);
          }
          addEventListener(documentRight,"String_Node_Str" + idModifier + a.getName(),"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + a.getName(),"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setAttribute(a,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + a.getName(),"String_Node_Str",el,false);
        }
      }
      if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + "String_Node_Str")) != null) {
        addEventListener(documentRight,"String_Node_Str" + idModifier + "String_Node_Str","String_Node_Str",moveTooltipListener,false);
        addEventListener(documentRight,"String_Node_Str" + idModifier + "String_Node_Str","String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setExtraAttributes(character);
        addEventListener(documentRight,"String_Node_Str" + idModifier + "String_Node_Str","String_Node_Str",el,false);
      }
      for (      StatusEffect se : character.getStatusEffects()) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + se)) != null) {
          addEventListener(documentRight,"String_Node_Str" + idModifier + se,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + se,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setStatusEffect(se,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + se,"String_Node_Str",el,false);
        }
      }
      for (      Perk p : character.getMajorPerks()) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + p)) != null) {
          addEventListener(documentRight,"String_Node_Str" + idModifier + p,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + p,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setPerk(p,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + p,"String_Node_Str",el,false);
        }
      }
      for (      Fetish f : character.getFetishes()) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + f)) != null) {
          addEventListener(documentRight,"String_Node_Str" + idModifier + f,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + f,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setFetish(f,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + f,"String_Node_Str",el,false);
        }
      }
      for (      SpecialAttack sa : character.getSpecialAttacks()) {
        if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + sa)) != null) {
          addEventListener(documentRight,"String_Node_Str" + idModifier + sa,"String_Node_Str",moveTooltipListener,false);
          addEventListener(documentRight,"String_Node_Str" + idModifier + sa,"String_Node_Str",hideTooltipListener,false);
          TooltipInformationEventListener el=new TooltipInformationEventListener().setSpecialAttack(sa,character);
          addEventListener(documentRight,"String_Node_Str" + idModifier + sa,"String_Node_Str",el,false);
        }
      }
      if (character.getMainWeapon() != null) {
        for (        Spell s : character.getMainWeapon().getSpells()) {
          if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + s)) != null) {
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",moveTooltipListener,false);
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",hideTooltipListener,false);
            TooltipInformationEventListener el=new TooltipInformationEventListener().setSpell(s,character.getLevel(),character);
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",el,false);
          }
        }
      }
      if (character.getOffhandWeapon() != null) {
        for (        Spell s : character.getOffhandWeapon().getSpells()) {
          if (((EventTarget)documentRight.getElementById("String_Node_Str" + idModifier + s)) != null) {
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",moveTooltipListener,false);
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",hideTooltipListener,false);
            TooltipInformationEventListener el=new TooltipInformationEventListener().setSpell(s,character.getLevel(),character);
            addEventListener(documentRight,"String_Node_Str" + idModifier + s,"String_Node_Str",el,false);
          }
        }
      }
    }
  }
}