Program: 171344
Project: 171344
Buggy source:
private void manageAttributeListeners(){
  documentAttributes=(Document)webEngineAttributes.executeScript("String_Node_Str");
  EventListenerDataMap.put(documentAttributes,new ArrayList<>());
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveNorthListener,true);
  }
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveSouthListener,true);
  }
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveWestListener,true);
  }
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveEastListener,true);
  }
  String id;
  for (  InventorySlot invSlot : InventorySlot.values()) {
    id=invSlot.toString() + "String_Node_Str";
    if (invSlot != InventorySlot.WEAPON_MAIN && invSlot != InventorySlot.WEAPON_OFFHAND) {
      if (((EventTarget)documentAttributes.getElementById(id)) != null) {
        InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setClothingEquipped(Main.game.getPlayer(),invSlot);
        addEventListener(documentAttributes,id,"String_Node_Str",el,false);
        addEventListener(documentAttributes,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setInventorySlot(invSlot,Main.game.getPlayer());
        addEventListener(documentAttributes,id,"String_Node_Str",el2,false);
      }
    }
  }
  Attribute[] attributes={Attribute.HEALTH_MAXIMUM,Attribute.MANA_MAXIMUM,Attribute.STAMINA_MAXIMUM,Attribute.EXPERIENCE,Attribute.STRENGTH,Attribute.INTELLIGENCE,Attribute.CORRUPTION,Attribute.FITNESS,Attribute.AROUSAL};
  for (  Attribute a : attributes) {
    if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + a.getName())) != null) {
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",moveTooltipListener,false);
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",hideTooltipListener,false);
      TooltipInformationEventListener el=new TooltipInformationEventListener().setAttribute(a,Main.game.getPlayer());
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",el,false);
      if (a == Attribute.EXPERIENCE) {
        ((EventTarget)documentAttributes.getElementById("String_Node_Str" + a.getName())).addEventListener("String_Node_Str",e -> {
          if (Main.game.getCurrentDialogueNode().getMapDisplay() == MapDisplay.PHONE) {
            if (Main.game.getCurrentDialogueNode() == PhoneDialogue.CHARACTER_LEVEL_UP) {
              openPhone();
            }
 else {
              Main.game.setContent(new Response("String_Node_Str","String_Node_Str",PhoneDialogue.CHARACTER_LEVEL_UP){
                @Override public void effects(){
                  PhoneDialogue.strengthPoints=0;
                  PhoneDialogue.intelligencePoints=0;
                  PhoneDialogue.fitnessPoints=0;
                  PhoneDialogue.spendingPoints=Main.game.getPlayer().getPerkPoints();
                  PhoneDialogue.levelUpPerks.clear();
                }
              }
);
            }
          }
 else           if (!Main.game.getCurrentDialogueNode().isOptionsDisabled()) {
            if (Main.game.getCurrentDialogueNode().getMapDisplay() == MapDisplay.NORMAL)             Main.game.saveDialogueNode();
            Main.game.setContent(new Response("String_Node_Str","String_Node_Str",PhoneDialogue.CHARACTER_LEVEL_UP){
              @Override public void effects(){
                PhoneDialogue.strengthPoints=0;
                PhoneDialogue.intelligencePoints=0;
                PhoneDialogue.fitnessPoints=0;
                PhoneDialogue.spendingPoints=Main.game.getPlayer().getPerkPoints();
                PhoneDialogue.levelUpPerks.clear();
              }
            }
);
          }
        }
,false);
      }
    }
    if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + a.getName())) != null) {
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",moveTooltipListener,false);
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",hideTooltipListener,false);
      TooltipInformationEventListener el=new TooltipInformationEventListener().setAttribute(a,Sex.getPartner());
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",el,false);
    }
  }
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveTooltipListener,false);
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",hideTooltipListener,false);
    TooltipInformationEventListener el=new TooltipInformationEventListener().setExtraAttributes(Main.game.getPlayer());
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",el,false);
  }
  if (Main.game.getPlayer() != null) {
    for (    StatusEffect se : Main.game.getPlayer().getStatusEffects()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + se)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setStatusEffect(se,Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.isInSex()) {
    for (    StatusEffect se : Sex.getPartner().getStatusEffects()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + se)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setStatusEffect(se,Sex.getPartner());
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.getPlayer() != null) {
    for (    PerkInterface p : Main.game.getPlayer().getPerks()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + p)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setPerk(p,Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",el,false);
      }
    }
    for (    Fetish f : Main.game.getPlayer().getFetishes()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + f)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setFetish(f,Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.isInSex()) {
    for (    PerkInterface p : Sex.getPartner().getPerks()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + p)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setPerk(p,Sex.getPartner());
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",el,false);
      }
    }
    for (    Fetish f : Sex.getPartner().getFetishes()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + f)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setFetish(f,Sex.getPartner());
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.getPlayer() != null)   for (  SpecialAttack sa : Main.game.getPlayer().getSpecialAttacks()) {
    if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + sa)) != null) {
      addEventListener(documentAttributes,"String_Node_Str" + sa,"String_Node_Str",moveTooltipListener,false);
      addEventListener(documentAttributes,"String_Node_Str" + sa,"String_Node_Str",hideTooltipListener,false);
      TooltipInformationEventListener el=new TooltipInformationEventListener().setSpecialAttack(sa,Main.game.getPlayer());
      addEventListener(documentAttributes,"String_Node_Str" + sa,"String_Node_Str",el,false);
    }
  }
  if (Main.game.getPlayer() != null)   if (Main.game.getPlayer().getMainWeapon() != null) {
    for (    Spell s : Main.game.getPlayer().getMainWeapon().getSpells()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + s)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setSpell(s,Main.game.getPlayer().getLevel(),Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.getPlayer() != null)   if (Main.game.getPlayer().getOffhandWeapon() != null) {
    for (    Spell s : Main.game.getPlayer().getOffhandWeapon().getSpells()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + s)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setSpell(s,Main.game.getPlayer().getLevel(),Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",el,false);
      }
    }
  }
}

Fixed version (ground truth):
private void manageAttributeListeners(){
  documentAttributes=(Document)webEngineAttributes.executeScript("String_Node_Str");
  EventListenerDataMap.put(documentAttributes,new ArrayList<>());
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveNorthListener,true);
  }
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveSouthListener,true);
  }
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveWestListener,true);
  }
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveEastListener,true);
  }
  String id;
  for (  InventorySlot invSlot : InventorySlot.values()) {
    id=invSlot.toString() + "String_Node_Str";
    if (invSlot != InventorySlot.WEAPON_MAIN && invSlot != InventorySlot.WEAPON_OFFHAND) {
      if (((EventTarget)documentAttributes.getElementById(id)) != null) {
        InventorySelectedItemEventListener el=new InventorySelectedItemEventListener().setClothingEquipped(Main.game.getPlayer(),invSlot);
        addEventListener(documentAttributes,id,"String_Node_Str",el,false);
        addEventListener(documentAttributes,id,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,id,"String_Node_Str",hideTooltipListener,false);
        InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setInventorySlot(invSlot,Main.game.getPlayer());
        addEventListener(documentAttributes,id,"String_Node_Str",el2,false);
      }
    }
  }
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + TFEssence.ARCANE.hashCode())) != null) {
    addEventListener(documentAttributes,"String_Node_Str" + TFEssence.ARCANE.hashCode(),"String_Node_Str",moveTooltipListener,false);
    addEventListener(documentAttributes,"String_Node_Str" + TFEssence.ARCANE.hashCode(),"String_Node_Str",hideTooltipListener,false);
    InventoryTooltipEventListener el2=new InventoryTooltipEventListener().setEssence(TFEssence.ARCANE);
    addEventListener(documentAttributes,"String_Node_Str" + TFEssence.ARCANE.hashCode(),"String_Node_Str",el2,false);
  }
  Attribute[] attributes={Attribute.HEALTH_MAXIMUM,Attribute.MANA_MAXIMUM,Attribute.STAMINA_MAXIMUM,Attribute.EXPERIENCE,Attribute.STRENGTH,Attribute.INTELLIGENCE,Attribute.CORRUPTION,Attribute.FITNESS,Attribute.AROUSAL};
  for (  Attribute a : attributes) {
    if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + a.getName())) != null) {
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",moveTooltipListener,false);
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",hideTooltipListener,false);
      TooltipInformationEventListener el=new TooltipInformationEventListener().setAttribute(a,Main.game.getPlayer());
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",el,false);
      if (a == Attribute.EXPERIENCE) {
        ((EventTarget)documentAttributes.getElementById("String_Node_Str" + a.getName())).addEventListener("String_Node_Str",e -> {
          if (Main.game.getCurrentDialogueNode().getMapDisplay() == MapDisplay.PHONE) {
            if (Main.game.getCurrentDialogueNode() == PhoneDialogue.CHARACTER_LEVEL_UP) {
              openPhone();
            }
 else {
              Main.game.setContent(new Response("String_Node_Str","String_Node_Str",PhoneDialogue.CHARACTER_LEVEL_UP){
                @Override public void effects(){
                  PhoneDialogue.strengthPoints=0;
                  PhoneDialogue.intelligencePoints=0;
                  PhoneDialogue.fitnessPoints=0;
                  PhoneDialogue.spendingPoints=Main.game.getPlayer().getPerkPoints();
                  PhoneDialogue.levelUpPerks.clear();
                }
              }
);
            }
          }
 else           if (!Main.game.getCurrentDialogueNode().isOptionsDisabled()) {
            if (Main.game.getCurrentDialogueNode().getMapDisplay() == MapDisplay.NORMAL)             Main.game.saveDialogueNode();
            Main.game.setContent(new Response("String_Node_Str","String_Node_Str",PhoneDialogue.CHARACTER_LEVEL_UP){
              @Override public void effects(){
                PhoneDialogue.strengthPoints=0;
                PhoneDialogue.intelligencePoints=0;
                PhoneDialogue.fitnessPoints=0;
                PhoneDialogue.spendingPoints=Main.game.getPlayer().getPerkPoints();
                PhoneDialogue.levelUpPerks.clear();
              }
            }
);
          }
        }
,false);
      }
    }
    if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + a.getName())) != null) {
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",moveTooltipListener,false);
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",hideTooltipListener,false);
      TooltipInformationEventListener el=new TooltipInformationEventListener().setAttribute(a,Sex.getPartner());
      addEventListener(documentAttributes,"String_Node_Str" + a.getName(),"String_Node_Str",el,false);
    }
  }
  if (((EventTarget)documentAttributes.getElementById("String_Node_Str")) != null) {
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",moveTooltipListener,false);
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",hideTooltipListener,false);
    TooltipInformationEventListener el=new TooltipInformationEventListener().setExtraAttributes(Main.game.getPlayer());
    addEventListener(documentAttributes,"String_Node_Str","String_Node_Str",el,false);
  }
  if (Main.game.getPlayer() != null) {
    for (    StatusEffect se : Main.game.getPlayer().getStatusEffects()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + se)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setStatusEffect(se,Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.isInSex()) {
    for (    StatusEffect se : Sex.getPartner().getStatusEffects()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + se)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setStatusEffect(se,Sex.getPartner());
        addEventListener(documentAttributes,"String_Node_Str" + se,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.getPlayer() != null) {
    for (    PerkInterface p : Main.game.getPlayer().getPerks()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + p)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setPerk(p,Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",el,false);
      }
    }
    for (    Fetish f : Main.game.getPlayer().getFetishes()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + f)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setFetish(f,Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.isInSex()) {
    for (    PerkInterface p : Sex.getPartner().getPerks()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + p)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setPerk(p,Sex.getPartner());
        addEventListener(documentAttributes,"String_Node_Str" + p,"String_Node_Str",el,false);
      }
    }
    for (    Fetish f : Sex.getPartner().getFetishes()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + f)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setFetish(f,Sex.getPartner());
        addEventListener(documentAttributes,"String_Node_Str" + f,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.getPlayer() != null)   for (  SpecialAttack sa : Main.game.getPlayer().getSpecialAttacks()) {
    if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + sa)) != null) {
      addEventListener(documentAttributes,"String_Node_Str" + sa,"String_Node_Str",moveTooltipListener,false);
      addEventListener(documentAttributes,"String_Node_Str" + sa,"String_Node_Str",hideTooltipListener,false);
      TooltipInformationEventListener el=new TooltipInformationEventListener().setSpecialAttack(sa,Main.game.getPlayer());
      addEventListener(documentAttributes,"String_Node_Str" + sa,"String_Node_Str",el,false);
    }
  }
  if (Main.game.getPlayer() != null)   if (Main.game.getPlayer().getMainWeapon() != null) {
    for (    Spell s : Main.game.getPlayer().getMainWeapon().getSpells()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + s)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setSpell(s,Main.game.getPlayer().getLevel(),Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",el,false);
      }
    }
  }
  if (Main.game.getPlayer() != null)   if (Main.game.getPlayer().getOffhandWeapon() != null) {
    for (    Spell s : Main.game.getPlayer().getOffhandWeapon().getSpells()) {
      if (((EventTarget)documentAttributes.getElementById("String_Node_Str" + s)) != null) {
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",moveTooltipListener,false);
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",hideTooltipListener,false);
        TooltipInformationEventListener el=new TooltipInformationEventListener().setSpell(s,Main.game.getPlayer().getLevel(),Main.game.getPlayer());
        addEventListener(documentAttributes,"String_Node_Str" + s,"String_Node_Str",el,false);
      }
    }
  }
}