Program: 10508
Project: 10508
Buggy source:
public String fillReplaceables(Player thePlayer,DenizenNPC theDenizen,String stringToFill,boolean quickReplaceable){
  if (stringToFill == null)   return null;
  Matcher f=replaceableFlag.matcher(stringToFill);
  String filledString=stringToFill;
  while (f.find()) {
    if (f.group(2).contains("String_Node_Str") && !quickReplaceable)     continue;
    if (!f.group(2).contains("String_Node_Str") && quickReplaceable)     continue;
    String searchPath="String_Node_Str";
    if (f.group(3).startsWith("String_Node_Str"))     searchPath="String_Node_Str";
 else     if (f.group(3).startsWith("String_Node_Str") && theDenizen != null)     searchPath="String_Node_Str" + theDenizen.getName() + "String_Node_Str"+ theDenizen.getId()+ "String_Node_Str";
 else     if (f.group(3).startsWith("String_Node_Str") && thePlayer != null)     searchPath="String_Node_Str" + thePlayer.getName() + "String_Node_Str";
    if (f.group(5).split("String_Node_Str").length > 1) {
      if (plugin.getSaves().contains(searchPath + f.group(5).split("String_Node_Str")[0].toUpperCase())) {
        filledString=f.replaceFirst(plugin.getSaves().getString(searchPath + f.group(5).split("String_Node_Str")[0].toUpperCase()));
        echoDebug(ChatColor.YELLOW + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str",f.group(4));
      }
 else {
        filledString=f.replaceFirst(f.group(5).split("String_Node_Str")[1]);
        echoDebug(ChatColor.YELLOW + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str");
      }
    }
 else {
      if (plugin.getSaves().contains(searchPath + f.group(5).split("String_Node_Str")[0].toUpperCase())) {
        filledString=f.replaceFirst(plugin.getSaves().getString(searchPath + f.group(5).split("String_Node_Str")[0].toUpperCase()));
        echoDebug(ChatColor.YELLOW + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str",f.group(4));
      }
 else {
        filledString=f.replaceFirst(f.group(5).split("String_Node_Str")[1]);
        echoDebug(ChatColor.YELLOW + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str");
      }
    }
  }
  if (thePlayer != null && filledString.contains("String_Node_Str")) {
    String itemInHandMaterial="String_Node_Str";
    if (thePlayer.getItemInHand() != null)     itemInHandMaterial=thePlayer.getItemInHand().getType().name();
    String itemInHandQty="String_Node_Str";
    if (thePlayer.getItemInHand() != null)     itemInHandQty=String.valueOf(thePlayer.getItemInHand().getAmount());
    String itemInHandId="String_Node_Str";
    if (thePlayer.getItemInHand() != null)     itemInHandId=String.valueOf(thePlayer.getItemInHand().getTypeId());
    String playerKiller="String_Node_Str";
    if (thePlayer.getKiller() != null)     playerKiller=thePlayer.getKiller().getName();
    String playerHelm="String_Node_Str";
    if (thePlayer.getInventory().getHelmet() != null)     playerHelm=thePlayer.getInventory().getHelmet().getType().name();
    String playerBoots="String_Node_Str";
    if (thePlayer.getInventory().getBoots() != null)     playerBoots=thePlayer.getInventory().getBoots().getType().name();
    String playerChestplate="String_Node_Str";
    if (thePlayer.getInventory().getChestplate() != null)     playerChestplate=thePlayer.getInventory().getChestplate().getType().name();
    String playerLeggings="String_Node_Str";
    if (thePlayer.getInventory().getLeggings() != null)     playerLeggings=thePlayer.getInventory().getLeggings().getType().name();
    String playerMoney="String_Node_Str";
    if (plugin.economy != null)     playerMoney=String.valueOf(plugin.economy.getBalance(thePlayer.getName()));
    if (quickReplaceable)     filledString=filledString.replace("String_Node_Str",itemInHandMaterial).replace("String_Node_Str",itemInHandQty).replace("String_Node_Str",itemInHandId).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",playerKiller).replace("String_Node_Str",String.valueOf(thePlayer.getHealth())).replace("String_Node_Str",playerHelm).replace("String_Node_Str",playerLeggings).replace("String_Node_Str",playerBoots).replace("String_Node_Str",playerChestplate).replace("String_Node_Str",thePlayer.getWorld().getName()).replace("String_Node_Str",playerMoney).replace("String_Node_Str",String.valueOf(thePlayer.getExpToLevel())).replace("String_Node_Str",String.valueOf(thePlayer.getTotalExperience())).replace("String_Node_Str",String.valueOf(thePlayer.getFoodLevel()));
 else     filledString=filledString.replace("String_Node_Str",itemInHandMaterial).replace("String_Node_Str",itemInHandQty).replace("String_Node_Str",itemInHandId).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",playerKiller).replace("String_Node_Str",String.valueOf(thePlayer.getHealth())).replace("String_Node_Str",playerHelm).replace("String_Node_Str",playerLeggings).replace("String_Node_Str",playerBoots).replace("String_Node_Str",playerChestplate).replace("String_Node_Str",thePlayer.getWorld().getName()).replace("String_Node_Str",playerMoney).replace("String_Node_Str",String.valueOf(thePlayer.getExpToLevel())).replace("String_Node_Str",String.valueOf(thePlayer.getTotalExperience())).replace("String_Node_Str",String.valueOf(thePlayer.getFoodLevel()));
  }
  if (theDenizen != null && filledString.contains("String_Node_Str")) {
    if (quickReplaceable)     filledString=filledString.replace("String_Node_Str",String.valueOf(theDenizen.getId())).replace("String_Node_Str",String.valueOf(theDenizen.getId())).replace("String_Node_Str",theDenizen.getName()).replace("String_Node_Str",theDenizen.getName());
 else     filledString=filledString.replace("String_Node_Str",String.valueOf(theDenizen.getId())).replace("String_Node_Str",String.valueOf(theDenizen.getId())).replace("String_Node_Str",theDenizen.getName()).replace("String_Node_Str",theDenizen.getName());
  }
  return filledString;
}

Fixed version (ground truth):
public String fillReplaceables(Player thePlayer,DenizenNPC theDenizen,String stringToFill,boolean quickReplaceable){
  if (stringToFill == null)   return null;
  Matcher f=replaceableFlag.matcher(stringToFill);
  String filledString=stringToFill;
  while (f.find()) {
    if (f.group(2).contains("String_Node_Str") && !quickReplaceable)     continue;
    if (!f.group(2).contains("String_Node_Str") && quickReplaceable)     continue;
    String searchPath="String_Node_Str";
    if (f.group(3).startsWith("String_Node_Str"))     searchPath="String_Node_Str";
 else     if (f.group(3).startsWith("String_Node_Str") && theDenizen != null)     searchPath="String_Node_Str" + theDenizen.getName() + "String_Node_Str"+ theDenizen.getId()+ "String_Node_Str";
 else     if (f.group(3).startsWith("String_Node_Str") && thePlayer != null)     searchPath="String_Node_Str" + thePlayer.getName() + "String_Node_Str";
    if (f.group(5).split("String_Node_Str").length > 1) {
      if (plugin.getSaves().contains(searchPath + f.group(5).split("String_Node_Str")[0].toUpperCase())) {
        filledString=f.replaceFirst(plugin.getSaves().getString(searchPath + f.group(5).split("String_Node_Str")[0].toUpperCase()));
        echoDebug(ChatColor.YELLOW + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str",f.group(4));
      }
 else {
        filledString=f.replaceFirst(f.group(5).split("String_Node_Str")[1]);
        echoDebug(ChatColor.YELLOW + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str");
      }
    }
 else {
      if (plugin.getSaves().contains(searchPath + f.group(5).toUpperCase())) {
        filledString=f.replaceFirst(plugin.getSaves().getString(searchPath + f.group(5).split("String_Node_Str")[0].toUpperCase()));
        echoDebug(ChatColor.YELLOW + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str",f.group(4));
      }
 else {
        filledString=f.replaceFirst("String_Node_Str");
        echoDebug(ChatColor.YELLOW + "String_Node_Str" + ChatColor.WHITE+ "String_Node_Str");
      }
    }
  }
  if (thePlayer != null && filledString.contains("String_Node_Str")) {
    String itemInHandMaterial="String_Node_Str";
    if (thePlayer.getItemInHand() != null)     itemInHandMaterial=thePlayer.getItemInHand().getType().name();
    String itemInHandName="String_Node_Str";
    if (thePlayer.getItemInHand() != null)     itemInHandName=thePlayer.getItemInHand().getType().name().toLowerCase().replace("String_Node_Str","String_Node_Str");
    String itemInHandQty="String_Node_Str";
    if (thePlayer.getItemInHand() != null)     itemInHandQty=String.valueOf(thePlayer.getItemInHand().getAmount());
    String itemInHandId="String_Node_Str";
    if (thePlayer.getItemInHand() != null)     itemInHandId=String.valueOf(thePlayer.getItemInHand().getTypeId());
    String playerKiller="String_Node_Str";
    if (thePlayer.getKiller() != null)     playerKiller=thePlayer.getKiller().getName();
    String playerHelm="String_Node_Str";
    if (thePlayer.getInventory().getHelmet() != null)     playerHelm=thePlayer.getInventory().getHelmet().getType().name();
    String playerBoots="String_Node_Str";
    if (thePlayer.getInventory().getBoots() != null)     playerBoots=thePlayer.getInventory().getBoots().getType().name();
    String playerChestplate="String_Node_Str";
    if (thePlayer.getInventory().getChestplate() != null)     playerChestplate=thePlayer.getInventory().getChestplate().getType().name();
    String playerLeggings="String_Node_Str";
    if (thePlayer.getInventory().getLeggings() != null)     playerLeggings=thePlayer.getInventory().getLeggings().getType().name();
    String playerMoney="String_Node_Str";
    if (plugin.economy != null)     playerMoney=String.valueOf(plugin.economy.getBalance(thePlayer.getName()));
    if (quickReplaceable)     filledString=filledString.replace("String_Node_Str",itemInHandMaterial).replace("String_Node_Str",itemInHandName).replace("String_Node_Str",itemInHandQty).replace("String_Node_Str",itemInHandId).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",playerKiller).replace("String_Node_Str",String.valueOf(thePlayer.getHealth())).replace("String_Node_Str",playerHelm).replace("String_Node_Str",playerLeggings).replace("String_Node_Str",playerBoots).replace("String_Node_Str",playerChestplate).replace("String_Node_Str",thePlayer.getWorld().getName()).replace("String_Node_Str",playerMoney).replace("String_Node_Str",String.valueOf(thePlayer.getExpToLevel())).replace("String_Node_Str",String.valueOf(thePlayer.getTotalExperience())).replace("String_Node_Str",String.valueOf(thePlayer.getFoodLevel()));
 else     filledString=filledString.replace("String_Node_Str",itemInHandMaterial).replace("String_Node_Str",itemInHandQty).replace("String_Node_Str",itemInHandId).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",playerKiller).replace("String_Node_Str",String.valueOf(thePlayer.getHealth())).replace("String_Node_Str",playerHelm).replace("String_Node_Str",playerLeggings).replace("String_Node_Str",playerBoots).replace("String_Node_Str",playerChestplate).replace("String_Node_Str",thePlayer.getWorld().getName()).replace("String_Node_Str",playerMoney).replace("String_Node_Str",String.valueOf(thePlayer.getExpToLevel())).replace("String_Node_Str",String.valueOf(thePlayer.getTotalExperience())).replace("String_Node_Str",String.valueOf(thePlayer.getFoodLevel()));
  }
  if (theDenizen != null && filledString.contains("String_Node_Str")) {
    if (quickReplaceable)     filledString=filledString.replace("String_Node_Str",String.valueOf(theDenizen.getId())).replace("String_Node_Str",String.valueOf(theDenizen.getId())).replace("String_Node_Str",theDenizen.getName()).replace("String_Node_Str",theDenizen.getName());
 else     filledString=filledString.replace("String_Node_Str",String.valueOf(theDenizen.getId())).replace("String_Node_Str",String.valueOf(theDenizen.getId())).replace("String_Node_Str",theDenizen.getName()).replace("String_Node_Str",theDenizen.getName());
  }
  return filledString;
}