Program: 10550
Project: 10550
Buggy source:
public String[] formatChatText(String theMessage,String messageType,Player thePlayer,NPC theDenizen){
  String playerMessageFormat=null;
  String bystanderMessageFormat=null;
  boolean toPlayer;
  if (thePlayer == null)   toPlayer=false;
 else   toPlayer=true;
  if (messageType.equalsIgnoreCase("String_Node_Str")) {
    playerMessageFormat=Denizen.settings.NpcShoutToPlayer();
    bystanderMessageFormat=Denizen.settings.NpcShoutToPlayerBystander();
    if (!toPlayer)     bystanderMessageFormat=Denizen.settings.NpcShoutToBystanders();
  }
 else   if (messageType.equalsIgnoreCase("String_Node_Str")) {
    playerMessageFormat=Denizen.settings.NpcWhisperToPlayer();
    bystanderMessageFormat=Denizen.settings.NpcWhisperToPlayerBystander();
    if (!toPlayer)     bystanderMessageFormat=Denizen.settings.NpcWhisperToBystanders();
  }
 else   if (messageType.equalsIgnoreCase("String_Node_Str")) {
    toPlayer=false;
    bystanderMessageFormat="String_Node_Str";
  }
 else   if (messageType.equalsIgnoreCase("String_Node_Str")) {
    playerMessageFormat="String_Node_Str";
  }
 else {
    playerMessageFormat=Denizen.settings.NpcChatToPlayer();
    bystanderMessageFormat=Denizen.settings.NpcChatToPlayerBystander();
    if (!toPlayer)     bystanderMessageFormat=Denizen.settings.NpcChatToBystanders();
  }
  if (playerMessageFormat != null)   playerMessageFormat=playerMessageFormat.replace("String_Node_Str",theDenizen.getName()).replace("String_Node_Str",theMessage).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",thePlayer.getDisplayName()).replace("String_Node_Str",thePlayer.getWorld().getName()).replace("String_Node_Str",String.valueOf(thePlayer.getHealth()));
  if (bystanderMessageFormat != null)   bystanderMessageFormat=bystanderMessageFormat.replace("String_Node_Str",theDenizen.getName()).replace("String_Node_Str",theMessage).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",thePlayer.getDisplayName()).replace("String_Node_Str",thePlayer.getWorld().getName()).replace("String_Node_Str",String.valueOf(thePlayer.getHealth()));
  String[] returnedText={playerMessageFormat,bystanderMessageFormat};
  return returnedText;
}

Fixed version (ground truth):
public String[] formatChatText(String theMessage,String messageType,Player thePlayer,NPC theDenizen){
  String playerMessageFormat=null;
  String bystanderMessageFormat=null;
  boolean toPlayer;
  if (thePlayer == null)   toPlayer=false;
 else   toPlayer=true;
  if (messageType.equalsIgnoreCase("String_Node_Str")) {
    playerMessageFormat=Denizen.settings.NpcShoutToPlayer();
    bystanderMessageFormat=Denizen.settings.NpcShoutToPlayerBystander();
    if (!toPlayer)     bystanderMessageFormat=Denizen.settings.NpcShoutToBystanders();
  }
 else   if (messageType.equalsIgnoreCase("String_Node_Str")) {
    playerMessageFormat=Denizen.settings.NpcWhisperToPlayer();
    bystanderMessageFormat=Denizen.settings.NpcWhisperToPlayerBystander();
    if (!toPlayer)     bystanderMessageFormat=Denizen.settings.NpcWhisperToBystanders();
  }
 else   if (messageType.equalsIgnoreCase("String_Node_Str")) {
    toPlayer=false;
    bystanderMessageFormat="String_Node_Str";
  }
 else   if (messageType.equalsIgnoreCase("String_Node_Str")) {
    playerMessageFormat="String_Node_Str";
  }
 else {
    playerMessageFormat=Denizen.settings.NpcChatToPlayer();
    bystanderMessageFormat=Denizen.settings.NpcChatToPlayerBystander();
    if (!toPlayer)     bystanderMessageFormat=Denizen.settings.NpcChatToBystanders();
  }
  if (playerMessageFormat != null)   playerMessageFormat=playerMessageFormat.replace("String_Node_Str",theDenizen.getName()).replace("String_Node_Str",theMessage).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",thePlayer.getDisplayName()).replace("String_Node_Str",thePlayer.getWorld().getName()).replace("String_Node_Str",String.valueOf(thePlayer.getHealth()).replace("String_Node_Str","String_Node_Str"));
  if (bystanderMessageFormat != null)   bystanderMessageFormat=bystanderMessageFormat.replace("String_Node_Str",theDenizen.getName()).replace("String_Node_Str",theMessage).replace("String_Node_Str",thePlayer.getName()).replace("String_Node_Str",thePlayer.getDisplayName()).replace("String_Node_Str",thePlayer.getWorld().getName()).replace("String_Node_Str",String.valueOf(thePlayer.getHealth()));
  String[] returnedText={playerMessageFormat,bystanderMessageFormat};
  return returnedText;
}