Program: 10237
Project: 10237
Buggy source:
@SuppressWarnings("String_Node_Str") @Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Element stop=scriptEntry.getElement("String_Node_Str");
  Element next=scriptEntry.getElement("String_Node_Str");
  Element callback=scriptEntry.getElement("String_Node_Str");
  if (stop != null && stop.asBoolean()) {
    dB.report(scriptEntry,getName(),stop.debug());
    boolean hasnext=false;
    for (int i=0; i < scriptEntry.getResidingQueue().getQueueSize(); i++) {
      ScriptEntry entry=scriptEntry.getResidingQueue().getEntry(i);
      List<String> args=entry.getOriginalArguments();
      if (entry.getCommandName().equalsIgnoreCase("String_Node_Str") && args.size() > 0 && args.get(0).equalsIgnoreCase("String_Node_Str")) {
        hasnext=true;
        break;
      }
    }
    if (hasnext) {
      while (scriptEntry.getResidingQueue().getQueueSize() > 0) {
        ScriptEntry entry=scriptEntry.getResidingQueue().getEntry(0);
        List<String> args=entry.getOriginalArguments();
        if (entry.getCommandName().equalsIgnoreCase("String_Node_Str") && args.size() > 0 && args.get(0).equalsIgnoreCase("String_Node_Str")) {
          scriptEntry.getResidingQueue().removeEntry(0);
          break;
        }
        scriptEntry.getResidingQueue().removeEntry(0);
      }
    }
 else {
      dB.echoError("String_Node_Str");
    }
    return;
  }
 else   if (next != null && next.asBoolean()) {
    dB.report(scriptEntry,getName(),next.debug());
    boolean hasnext=false;
    for (int i=0; i < scriptEntry.getResidingQueue().getQueueSize(); i++) {
      ScriptEntry entry=scriptEntry.getResidingQueue().getEntry(i);
      List<String> args=entry.getOriginalArguments();
      if (entry.getCommandName().equalsIgnoreCase("String_Node_Str") && args.size() > 0 && args.get(0).equalsIgnoreCase("String_Node_Str")) {
        hasnext=true;
        break;
      }
    }
    if (hasnext) {
      while (scriptEntry.getResidingQueue().getQueueSize() > 0) {
        ScriptEntry entry=scriptEntry.getResidingQueue().getEntry(0);
        List<String> args=entry.getOriginalArguments();
        if (entry.getCommandName().equalsIgnoreCase("String_Node_Str") && args.size() > 0 && args.get(0).equalsIgnoreCase("String_Node_Str")) {
          break;
        }
        scriptEntry.getResidingQueue().removeEntry(0);
      }
    }
 else {
      dB.echoError("String_Node_Str");
    }
    return;
  }
 else   if (callback != null && callback.asBoolean()) {
    if (scriptEntry.getOwner() != null && (scriptEntry.getOwner().getCommandName().equalsIgnoreCase("String_Node_Str") || scriptEntry.getOwner().getBracedSet() == null || scriptEntry.getOwner().getBracedSet().size() == 0 || scriptEntry.getBracedSet().get("String_Node_Str").get(scriptEntry.getBracedSet().get("String_Node_Str").size() - 1) != scriptEntry)) {
      WhileData data=(WhileData)scriptEntry.getOwner().getData();
      data.index++;
      int max=Settings.WhileMaxLoops();
      if (data.index > max && max != 0)       return;
      if (TagManager.tag(scriptEntry.getPlayer(),scriptEntry.getNPC(),data.value,false,scriptEntry).equalsIgnoreCase("String_Node_Str")) {
        dB.echoDebug(scriptEntry,dB.DebugElement.Header,"String_Node_Str" + data.index);
        scriptEntry.getResidingQueue().addDefinition("String_Node_Str",String.valueOf(data.index));
        ArrayList<ScriptEntry> bracedCommands=BracedCommand.getBracedCommands(scriptEntry.getOwner()).get("String_Node_Str");
        ScriptEntry callbackEntry=null;
        try {
          callbackEntry=new ScriptEntry("String_Node_Str",new String[]{"String_Node_Str"},(scriptEntry.getScript() != null ? scriptEntry.getScript().getContainer() : null));
        }
 catch (        ScriptEntryCreationException e) {
          dB.echoError(e);
        }
        callbackEntry.setOwner(scriptEntry.getOwner());
        bracedCommands.add(callbackEntry);
        for (int i=0; i < bracedCommands.size(); i++) {
          bracedCommands.get(i).setInstant(true);
        }
        scriptEntry.getResidingQueue().injectEntries(bracedCommands,0);
      }
    }
 else {
      dB.echoError("String_Node_Str");
    }
  }
 else {
    Element value=scriptEntry.getElement("String_Node_Str");
    ArrayList<ScriptEntry> bracedCommandsList=((LinkedHashMap<String,ArrayList<ScriptEntry>>)scriptEntry.getObject("String_Node_Str")).get("String_Node_Str");
    if (bracedCommandsList == null || bracedCommandsList.isEmpty()) {
      dB.echoError("String_Node_Str");
      return;
    }
    dB.report(scriptEntry,getName(),value.debug());
    if (!TagManager.tag(scriptEntry.getPlayer(),scriptEntry.getNPC(),value.asString(),false,scriptEntry).equalsIgnoreCase("String_Node_Str"))     return;
    WhileData datum=new WhileData();
    datum.index=1;
    datum.value=value.asString();
    scriptEntry.setData(datum);
    ScriptEntry callbackEntry=null;
    try {
      callbackEntry=new ScriptEntry("String_Node_Str",new String[]{"String_Node_Str"},(scriptEntry.getScript() != null ? scriptEntry.getScript().getContainer() : null));
    }
 catch (    ScriptEntryCreationException e) {
      dB.echoError(e);
    }
    callbackEntry.setOwner(scriptEntry);
    bracedCommandsList.add(callbackEntry);
    scriptEntry.getResidingQueue().addDefinition("String_Node_Str","String_Node_Str");
    for (int i=0; i < bracedCommandsList.size(); i++) {
      bracedCommandsList.get(i).setInstant(true);
    }
    scriptEntry.getResidingQueue().injectEntries(bracedCommandsList,0);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Element stop=scriptEntry.getElement("String_Node_Str");
  Element next=scriptEntry.getElement("String_Node_Str");
  Element callback=scriptEntry.getElement("String_Node_Str");
  if (stop != null && stop.asBoolean()) {
    dB.report(scriptEntry,getName(),stop.debug());
    boolean hasnext=false;
    for (int i=0; i < scriptEntry.getResidingQueue().getQueueSize(); i++) {
      ScriptEntry entry=scriptEntry.getResidingQueue().getEntry(i);
      List<String> args=entry.getOriginalArguments();
      if (entry.getCommandName().equalsIgnoreCase("String_Node_Str") && args.size() > 0 && args.get(0).equalsIgnoreCase("String_Node_Str")) {
        hasnext=true;
        break;
      }
    }
    if (hasnext) {
      while (scriptEntry.getResidingQueue().getQueueSize() > 0) {
        ScriptEntry entry=scriptEntry.getResidingQueue().getEntry(0);
        List<String> args=entry.getOriginalArguments();
        if (entry.getCommandName().equalsIgnoreCase("String_Node_Str") && args.size() > 0 && args.get(0).equalsIgnoreCase("String_Node_Str")) {
          scriptEntry.getResidingQueue().removeEntry(0);
          break;
        }
        scriptEntry.getResidingQueue().removeEntry(0);
      }
    }
 else {
      dB.echoError("String_Node_Str");
    }
    return;
  }
 else   if (next != null && next.asBoolean()) {
    dB.report(scriptEntry,getName(),next.debug());
    boolean hasnext=false;
    for (int i=0; i < scriptEntry.getResidingQueue().getQueueSize(); i++) {
      ScriptEntry entry=scriptEntry.getResidingQueue().getEntry(i);
      List<String> args=entry.getOriginalArguments();
      if (entry.getCommandName().equalsIgnoreCase("String_Node_Str") && args.size() > 0 && args.get(0).equalsIgnoreCase("String_Node_Str")) {
        hasnext=true;
        break;
      }
    }
    if (hasnext) {
      while (scriptEntry.getResidingQueue().getQueueSize() > 0) {
        ScriptEntry entry=scriptEntry.getResidingQueue().getEntry(0);
        List<String> args=entry.getOriginalArguments();
        if (entry.getCommandName().equalsIgnoreCase("String_Node_Str") && args.size() > 0 && args.get(0).equalsIgnoreCase("String_Node_Str")) {
          break;
        }
        scriptEntry.getResidingQueue().removeEntry(0);
      }
    }
 else {
      dB.echoError("String_Node_Str");
    }
    return;
  }
 else   if (callback != null && callback.asBoolean()) {
    if (scriptEntry.getOwner() != null && (scriptEntry.getOwner().getCommandName().equalsIgnoreCase("String_Node_Str") || scriptEntry.getOwner().getBracedSet() == null || scriptEntry.getOwner().getBracedSet().size() == 0 || scriptEntry.getBracedSet().get("String_Node_Str").get(scriptEntry.getBracedSet().get("String_Node_Str").size() - 1) != scriptEntry)) {
      WhileData data=(WhileData)scriptEntry.getOwner().getData();
      data.index++;
      int max=Settings.WhileMaxLoops();
      if (data.index > max && max != 0)       return;
      if (TagManager.tag(scriptEntry.getPlayer(),scriptEntry.getNPC(),data.value,false,scriptEntry).equalsIgnoreCase("String_Node_Str")) {
        dB.echoDebug(scriptEntry,dB.DebugElement.Header,"String_Node_Str" + data.index);
        scriptEntry.getResidingQueue().addDefinition("String_Node_Str",String.valueOf(data.index));
        ArrayList<ScriptEntry> bracedCommands=BracedCommand.getBracedCommands(scriptEntry.getOwner()).get("String_Node_Str");
        ScriptEntry callbackEntry=null;
        try {
          callbackEntry=new ScriptEntry("String_Node_Str",new String[]{"String_Node_Str"},(scriptEntry.getScript() != null ? scriptEntry.getScript().getContainer() : null));
          callbackEntry.copyFrom(scriptEntry);
        }
 catch (        ScriptEntryCreationException e) {
          dB.echoError(e);
        }
        callbackEntry.setOwner(scriptEntry.getOwner());
        bracedCommands.add(callbackEntry);
        for (int i=0; i < bracedCommands.size(); i++) {
          bracedCommands.get(i).setInstant(true);
        }
        scriptEntry.getResidingQueue().injectEntries(bracedCommands,0);
      }
    }
 else {
      dB.echoError("String_Node_Str");
    }
  }
 else {
    Element value=scriptEntry.getElement("String_Node_Str");
    ArrayList<ScriptEntry> bracedCommandsList=((LinkedHashMap<String,ArrayList<ScriptEntry>>)scriptEntry.getObject("String_Node_Str")).get("String_Node_Str");
    if (bracedCommandsList == null || bracedCommandsList.isEmpty()) {
      dB.echoError("String_Node_Str");
      return;
    }
    dB.report(scriptEntry,getName(),value.debug());
    if (!TagManager.tag(scriptEntry.getPlayer(),scriptEntry.getNPC(),value.asString(),false,scriptEntry).equalsIgnoreCase("String_Node_Str"))     return;
    WhileData datum=new WhileData();
    datum.index=1;
    datum.value=value.asString();
    scriptEntry.setData(datum);
    ScriptEntry callbackEntry=null;
    try {
      callbackEntry=new ScriptEntry("String_Node_Str",new String[]{"String_Node_Str"},(scriptEntry.getScript() != null ? scriptEntry.getScript().getContainer() : null));
      callbackEntry.copyFrom(scriptEntry);
    }
 catch (    ScriptEntryCreationException e) {
      dB.echoError(e);
    }
    callbackEntry.setOwner(scriptEntry);
    bracedCommandsList.add(callbackEntry);
    scriptEntry.getResidingQueue().addDefinition("String_Node_Str","String_Node_Str");
    for (int i=0; i < bracedCommandsList.size(); i++) {
      bracedCommandsList.get(i).setInstant(true);
    }
    scriptEntry.getResidingQueue().injectEntries(bracedCommandsList,0);
  }
}