Program: 10175
Project: 10175
Buggy source:
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Element action=scriptEntry.getElement("String_Node_Str");
  Element elTitle=scriptEntry.getElement("String_Node_Str");
  Element elLines=scriptEntry.getElement("String_Node_Str");
  Element elValue=scriptEntry.getElement("String_Node_Str");
  Element elIncrement=scriptEntry.getElement("String_Node_Str");
  Element elStart=scriptEntry.getElement("String_Node_Str");
  Element elPlayers=scriptEntry.getElement("String_Node_Str");
  Element elPerPlayer=scriptEntry.getElement("String_Node_Str");
  dList players=dList.valueOf(TagManager.tag(elPlayers.asString(),new BukkitTagContext(scriptEntry,false)));
  boolean per_player=elPerPlayer.asBoolean();
  String perTitle=null;
  String perLines=null;
  String perValue=null;
  String perIncrement=null;
  String perStart=null;
  Element title=null;
  dList lines=null;
  dList value=null;
  Element increment=null;
  Element start=null;
  String debug;
  if (per_player) {
    if (elTitle != null) {
      perTitle=elTitle.asString();
    }
    if (elLines != null) {
      perLines=elLines.asString();
    }
    if (elValue != null) {
      perValue=elValue.asString();
    }
    if (elIncrement != null) {
      perIncrement=elIncrement.asString();
    }
    if (elStart != null) {
      perStart=start.asString();
    }
    debug=action.debug() + (elTitle != null ? elTitle.debug() : "String_Node_Str") + (elLines != null ? elLines.debug() : "String_Node_Str")+ (elValue != null ? elValue.debug() : "String_Node_Str")+ (elIncrement != null ? elIncrement.debug() : "String_Node_Str")+ (elStart != null ? elStart.debug() : "String_Node_Str")+ players.debug();
  }
 else {
    BukkitTagContext context=new BukkitTagContext(scriptEntry,false);
    if (elTitle != null) {
      title=new Element(TagManager.tag(elTitle.asString(),context));
    }
    if (elLines != null) {
      lines=dList.valueOf(TagManager.tag(elLines.asString(),context));
    }
    if (elValue != null) {
      value=dList.valueOf(TagManager.tag(elValue.asString(),context));
    }
    if (elIncrement != null) {
      increment=new Element(TagManager.tag(elIncrement.asString(),context));
    }
    if (elStart != null) {
      start=new Element(TagManager.tag(elStart.asString(),context));
    }
    debug=action.debug() + (title != null ? title.debug() : "String_Node_Str") + (lines != null ? lines.debug() : "String_Node_Str")+ (value != null ? value.debug() : "String_Node_Str")+ (increment != null ? increment.debug() : "String_Node_Str")+ (start != null ? start.debug() : "String_Node_Str")+ players.debug();
  }
  dB.report(scriptEntry,getName(),debug);
switch (Action.valueOf(action.asString())) {
case ADD:
    for (    dPlayer player : players.filter(dPlayer.class)) {
      Sidebar sidebar=createSidebar(player);
      if (sidebar == null) {
        continue;
      }
      List<String> current=sidebar.getLines();
      if (per_player) {
        TagContext context=new BukkitTagContext(player,null,false,scriptEntry,scriptEntry.shouldDebug(),scriptEntry.getScript());
        value=dList.valueOf(TagManager.tag(perValue,context));
        if (perLines != null) {
          lines=dList.valueOf(TagManager.tag(perLines,context));
        }
      }
      if (lines != null) {
        try {
          for (int i=0; i < lines.size(); i++) {
            int index=Integer.valueOf(lines.get(i)) - 1;
            String line=value.get(i);
            current.add(index,line);
          }
        }
 catch (        Exception e) {
          dB.echoError(e);
          continue;
        }
      }
 else {
        current.addAll(value);
      }
      sidebar.setLines(current);
      sidebar.sendUpdate();
    }
  break;
case REMOVE:
for (dPlayer player : players.filter(dPlayer.class)) {
  Sidebar sidebar=createSidebar(player);
  if (sidebar == null) {
    continue;
  }
  List<String> current=sidebar.getLines();
  if (per_player) {
    TagContext context=new BukkitTagContext(player,null,false,scriptEntry,scriptEntry.shouldDebug(),scriptEntry.getScript());
    if (perValue != null) {
      value=dList.valueOf(TagManager.tag(perValue,context));
    }
    if (perLines != null) {
      lines=dList.valueOf(TagManager.tag(perLines,context));
    }
  }
  if (lines != null) {
    try {
      int offset=0;
      for (      String line : lines) {
        int index=Integer.valueOf(line) - 1 - offset;
        current.remove(index);
        offset++;
      }
    }
 catch (    Exception e) {
      dB.echoError(e);
      continue;
    }
    sidebar.setLines(current);
    sidebar.sendUpdate();
  }
 else   if (value != null) {
    try {
      Iterator<String> it=current.iterator();
      while (it.hasNext()) {
        String next=it.next();
        for (        String line : value) {
          if (next.equalsIgnoreCase(line)) {
            it.remove();
          }
        }
      }
      for (      String line : value) {
        for (int i=0; i < current.size(); i++) {
          if (current.get(i).equalsIgnoreCase(line)) {
            current.remove(i);
          }
        }
      }
    }
 catch (    Exception e) {
      dB.echoError(e);
      continue;
    }
    sidebar.setLines(current);
    sidebar.sendUpdate();
  }
 else {
    sidebar.remove();
  }
}
break;
case SET:
for (dPlayer player : players.filter(dPlayer.class)) {
Sidebar sidebar=createSidebar(player);
if (sidebar == null) {
continue;
}
List<String> current=sidebar.getLines();
boolean currEdited=false;
if (per_player) {
TagContext context=new BukkitTagContext(player,null,false,scriptEntry,scriptEntry.shouldDebug(),scriptEntry.getScript());
if (perValue != null) {
  value=dList.valueOf(TagManager.tag(perValue,context));
}
if (perLines != null) {
  lines=dList.valueOf(TagManager.tag(perLines,context));
}
if (perStart != null) {
  start=new Element(TagManager.tag(perStart,context));
}
if (perIncrement != null) {
  increment=new Element(TagManager.tag(perIncrement,context));
}
if (perTitle != null) {
  title=new Element(TagManager.tag(perTitle,context));
}
}
if (lines != null) {
try {
  for (int i=0; i < lines.size(); i++) {
    int index=Integer.valueOf(lines.get(i)) - 1;
    String line=value.get(i);
    if (index > current.size()) {
      current.add(line);
    }
 else {
      current.set(index,line);
    }
  }
}
 catch (Exception e) {
  dB.echoError(e);
  continue;
}
currEdited=true;
}
 else if (value != null) {
current=value;
currEdited=true;
}
if (start != null) {
sidebar.setStart(start.asInt());
currEdited=true;
}
if (increment != null) {
sidebar.setIncrement(increment.asInt());
currEdited=true;
}
if (title != null) {
sidebar.setTitle(title.asString());
}
if (currEdited) {
sidebar.setLines(current);
}
sidebar.sendUpdate();
}
break;
}
}

Fixed version (ground truth):
@Override public void execute(ScriptEntry scriptEntry) throws CommandExecutionException {
  Element action=scriptEntry.getElement("String_Node_Str");
  Element elTitle=scriptEntry.getElement("String_Node_Str");
  Element elLines=scriptEntry.getElement("String_Node_Str");
  Element elValue=scriptEntry.getElement("String_Node_Str");
  Element elIncrement=scriptEntry.getElement("String_Node_Str");
  Element elStart=scriptEntry.getElement("String_Node_Str");
  Element elPlayers=scriptEntry.getElement("String_Node_Str");
  Element elPerPlayer=scriptEntry.getElement("String_Node_Str");
  dList players=dList.valueOf(TagManager.tag(elPlayers.asString(),new BukkitTagContext(scriptEntry,false)));
  boolean per_player=elPerPlayer.asBoolean();
  String perTitle=null;
  String perLines=null;
  String perValue=null;
  String perIncrement=null;
  String perStart=null;
  Element title=null;
  dList lines=null;
  dList value=null;
  Element increment=null;
  Element start=null;
  String debug;
  if (per_player) {
    if (elTitle != null) {
      perTitle=elTitle.asString();
    }
    if (elLines != null) {
      perLines=elLines.asString();
    }
    if (elValue != null) {
      perValue=elValue.asString();
    }
    if (elIncrement != null) {
      perIncrement=elIncrement.asString();
    }
    if (elStart != null) {
      perStart=elStart.asString();
    }
    debug=action.debug() + (elTitle != null ? elTitle.debug() : "String_Node_Str") + (elLines != null ? elLines.debug() : "String_Node_Str")+ (elValue != null ? elValue.debug() : "String_Node_Str")+ (elIncrement != null ? elIncrement.debug() : "String_Node_Str")+ (elStart != null ? elStart.debug() : "String_Node_Str")+ players.debug();
  }
 else {
    BukkitTagContext context=new BukkitTagContext(scriptEntry,false);
    if (elTitle != null) {
      title=new Element(TagManager.tag(elTitle.asString(),context));
    }
    if (elLines != null) {
      lines=dList.valueOf(TagManager.tag(elLines.asString(),context));
    }
    if (elValue != null) {
      value=dList.valueOf(TagManager.tag(elValue.asString(),context));
    }
    if (elIncrement != null) {
      increment=new Element(TagManager.tag(elIncrement.asString(),context));
    }
    if (elStart != null) {
      start=new Element(TagManager.tag(elStart.asString(),context));
    }
    debug=action.debug() + (title != null ? title.debug() : "String_Node_Str") + (lines != null ? lines.debug() : "String_Node_Str")+ (value != null ? value.debug() : "String_Node_Str")+ (increment != null ? increment.debug() : "String_Node_Str")+ (start != null ? start.debug() : "String_Node_Str")+ players.debug();
  }
  dB.report(scriptEntry,getName(),debug);
switch (Action.valueOf(action.asString())) {
case ADD:
    for (    dPlayer player : players.filter(dPlayer.class)) {
      Sidebar sidebar=createSidebar(player);
      if (sidebar == null) {
        continue;
      }
      List<String> current=sidebar.getLines();
      if (per_player) {
        TagContext context=new BukkitTagContext(player,null,false,scriptEntry,scriptEntry.shouldDebug(),scriptEntry.getScript());
        value=dList.valueOf(TagManager.tag(perValue,context));
        if (perLines != null) {
          lines=dList.valueOf(TagManager.tag(perLines,context));
        }
      }
      if (lines != null) {
        try {
          for (int i=0; i < lines.size(); i++) {
            int index=Integer.valueOf(lines.get(i)) - 1;
            String line=value.get(i);
            current.add(index,line);
          }
        }
 catch (        Exception e) {
          dB.echoError(e);
          continue;
        }
      }
 else {
        current.addAll(value);
      }
      sidebar.setLines(current);
      sidebar.sendUpdate();
    }
  break;
case REMOVE:
for (dPlayer player : players.filter(dPlayer.class)) {
  Sidebar sidebar=createSidebar(player);
  if (sidebar == null) {
    continue;
  }
  List<String> current=sidebar.getLines();
  if (per_player) {
    TagContext context=new BukkitTagContext(player,null,false,scriptEntry,scriptEntry.shouldDebug(),scriptEntry.getScript());
    if (perValue != null) {
      value=dList.valueOf(TagManager.tag(perValue,context));
    }
    if (perLines != null) {
      lines=dList.valueOf(TagManager.tag(perLines,context));
    }
  }
  if (lines != null) {
    try {
      int offset=0;
      for (      String line : lines) {
        int index=Integer.valueOf(line) - 1 - offset;
        current.remove(index);
        offset++;
      }
    }
 catch (    Exception e) {
      dB.echoError(e);
      continue;
    }
    sidebar.setLines(current);
    sidebar.sendUpdate();
  }
 else   if (value != null) {
    try {
      Iterator<String> it=current.iterator();
      while (it.hasNext()) {
        String next=it.next();
        for (        String line : value) {
          if (next.equalsIgnoreCase(line)) {
            it.remove();
          }
        }
      }
      for (      String line : value) {
        for (int i=0; i < current.size(); i++) {
          if (current.get(i).equalsIgnoreCase(line)) {
            current.remove(i);
          }
        }
      }
    }
 catch (    Exception e) {
      dB.echoError(e);
      continue;
    }
    sidebar.setLines(current);
    sidebar.sendUpdate();
  }
 else {
    sidebar.remove();
  }
}
break;
case SET:
for (dPlayer player : players.filter(dPlayer.class)) {
Sidebar sidebar=createSidebar(player);
if (sidebar == null) {
continue;
}
List<String> current=sidebar.getLines();
boolean currEdited=false;
if (per_player) {
TagContext context=new BukkitTagContext(player,null,false,scriptEntry,scriptEntry.shouldDebug(),scriptEntry.getScript());
if (perValue != null) {
  value=dList.valueOf(TagManager.tag(perValue,context));
}
if (perLines != null) {
  lines=dList.valueOf(TagManager.tag(perLines,context));
}
if (perStart != null) {
  start=new Element(TagManager.tag(perStart,context));
}
if (perIncrement != null) {
  increment=new Element(TagManager.tag(perIncrement,context));
}
if (perTitle != null) {
  title=new Element(TagManager.tag(perTitle,context));
}
}
if (lines != null) {
try {
  for (int i=0; i < lines.size(); i++) {
    int index=Integer.valueOf(lines.get(i)) - 1;
    String line=value.get(i);
    if (index > current.size()) {
      current.add(line);
    }
 else {
      current.set(index,line);
    }
  }
}
 catch (Exception e) {
  dB.echoError(e);
  continue;
}
currEdited=true;
}
 else if (value != null) {
current=value;
currEdited=true;
}
if (start != null) {
sidebar.setStart(start.asInt());
currEdited=true;
}
if (increment != null) {
sidebar.setIncrement(increment.asInt());
currEdited=true;
}
if (title != null) {
sidebar.setTitle(title.asString());
}
if (currEdited) {
sidebar.setLines(current);
}
sidebar.sendUpdate();
}
break;
}
}