Program: 10235
Project: 10235
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");
  dList list=(dList)scriptEntry.getObject("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)) {
      ForeachData data=(ForeachData)scriptEntry.getOwner().getData();
      data.index++;
      if (data.index <= data.list.size()) {
        dB.echoDebug(scriptEntry,dB.DebugElement.Header,"String_Node_Str" + data.index);
        scriptEntry.getResidingQueue().addDefinition("String_Node_Str",String.valueOf(data.index));
        scriptEntry.getResidingQueue().addDefinition("String_Node_Str",String.valueOf(data.list.get(data.index - 1)));
        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 {
    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(),list.debug());
    int target=list.size();
    if (target <= 0) {
      dB.echoDebug(scriptEntry,"String_Node_Str");
      return;
    }
    ForeachData datum=new ForeachData();
    datum.list=list;
    datum.index=1;
    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",list.get(0));
    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");
  dList list=(dList)scriptEntry.getObject("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)) {
      ForeachData data=(ForeachData)scriptEntry.getOwner().getData();
      data.index++;
      if (data.index <= data.list.size()) {
        dB.echoDebug(scriptEntry,dB.DebugElement.Header,"String_Node_Str" + data.index);
        scriptEntry.getResidingQueue().addDefinition("String_Node_Str",String.valueOf(data.index));
        scriptEntry.getResidingQueue().addDefinition("String_Node_Str",String.valueOf(data.list.get(data.index - 1)));
        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 {
    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(),list.debug());
    int target=list.size();
    if (target <= 0) {
      dB.echoDebug(scriptEntry,"String_Node_Str");
      return;
    }
    ForeachData datum=new ForeachData();
    datum.list=list;
    datum.index=1;
    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",list.get(0));
    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);
  }
}