Program: 178500
Project: 178500
Buggy source:
/** 
 * {@inheritDoc}
 * @see CommandListener#onBeforeCommand(CommandManager,Command,String)
 */
public boolean onBeforeCommand(CommandManager sender,Command command,String param){
  commandOperationCall=null;
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !IGNORED_COMMANDS.contains(command)) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      commandOperationCall=new OperationCall(command.toString(),param,getTarget(range));
      log.info(commandOperationCall.toString());
      String realTag="String_Node_Str";
      if ("String_Node_Str".equals(command.toString())) {
        realTag="String_Node_Str";
      }
 else       if ("String_Node_Str".equals(command.toString())) {
        realTag="String_Node_Str";
      }
 else       if ("String_Node_Str".equals(command.toString())) {
        realTag="String_Node_Str";
      }
 else       if ("String_Node_Str".equals(command.toString())) {
        realTag="String_Node_Str";
      }
      final OperationTarget target=getTarget(range);
      int[] path=convertPath(target.getStartContainer());
      boolean addStyle=true;
      if (path.length == 2) {
        addStyle=true;
      }
 else {
        addStyle=false;
      }
      int start=range.getStartOffset();
      boolean splitLeft;
      if (start == 0) {
        splitLeft=false;
      }
 else {
        splitLeft=true;
      }
      Text textNode=Text.as(TreeHelper.getChildNodeFromLocator(bodyNode,convertPath(target.getStartContainer())));
      boolean splitRight;
      int end=range.getEndOffset();
      if (end == textNode.getLength()) {
        splitRight=false;
      }
 else {
        splitRight=true;
      }
      TreeOperation op=new TreeStyle(clientJupiter.getSiteId(),path,start,end,realTag,"String_Node_Str",addStyle,splitLeft,splitRight);
      clientJupiter.generate(op);
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see CommandListener#onBeforeCommand(CommandManager,Command,String)
 */
public boolean onBeforeCommand(CommandManager sender,Command command,String param){
  commandOperationCall=null;
  if (getTextArea().isAttached() && getTextArea().isEnabled() && !IGNORED_COMMANDS.contains(command)) {
    Selection selection=getTextArea().getDocument().getSelection();
    if (selection.getRangeCount() > 0) {
      Range range=selection.getRangeAt(0);
      commandOperationCall=new OperationCall(command.toString(),param,getTarget(range));
      log.info(commandOperationCall.toString());
      String realTag="String_Node_Str";
      if ("String_Node_Str".equals(command.toString())) {
        realTag="String_Node_Str";
      }
 else       if ("String_Node_Str".equals(command.toString())) {
        realTag="String_Node_Str";
      }
 else       if ("String_Node_Str".equals(command.toString())) {
        realTag="String_Node_Str";
      }
 else       if ("String_Node_Str".equals(command.toString())) {
        realTag="String_Node_Str";
      }
      final OperationTarget target=getTarget(range);
      int[] path=convertPath(target.getStartContainer());
      boolean addStyle=true;
      if (path.length == 2) {
        addStyle=true;
      }
 else {
        addStyle=false;
      }
      int start=range.getStartOffset();
      boolean splitLeft;
      if (start == 0) {
        splitLeft=false;
      }
 else {
        splitLeft=true;
      }
      Text textNode=Text.as(TreeHelper.getChildNodeFromLocator(TreeClientCallback.getUpdatedNativeNode(),convertPath(target.getStartContainer())));
      boolean splitRight;
      int end=range.getEndOffset();
      if (end == textNode.getLength()) {
        splitRight=false;
      }
 else {
        splitRight=true;
      }
      TreeOperation op=new TreeStyle(clientJupiter.getSiteId(),path,start,end,realTag,"String_Node_Str",addStyle,splitLeft,splitRight);
      clientJupiter.generate(op);
    }
  }
  return false;
}