Program: 145798
Project: 145798
Buggy source:
public void handleMatch(StringBuffer buffer,MatchResult result,FilterContext context){
  String command=result.group(1);
  if (!command.startsWith("String_Node_Str")) {
    MacroParameter mParams=context.getMacroParameter();
    if (result.group(1).equals(result.group(result.groups() - 1))) {
      if (!"String_Node_Str".equals(result.group(2))) {
        mParams.setParams(result.group(2));
      }
      mParams.setContent(result.group(3));
    }
 else {
      if (result.groups() > 1) {
        mParams.setParams(result.group(2));
      }
    }
    try {
      if (macros.containsKey(command)) {
        Macro macro=(Macro)macros.get(command);
        if (null != mParams.getContent()) {
          mParams.setContent(filter(mParams.getContent(),context));
        }
        Writer writer=new StringBufferWriter(buffer);
        macro.execute(writer,mParams);
      }
 else       if (command.startsWith("String_Node_Str")) {
        EngineManager engine=context.getRenderEngine();
        if (engine instanceof IncludeRenderEngine) {
          String include=((IncludeRenderEngine)engine).include(command.substring(1));
          if (null != include) {
            buffer.append(include);
          }
 else {
            buffer.append(command.substring(1) + "String_Node_Str");
          }
        }
        return;
      }
 else {
        buffer.append(result.group(0));
        return;
      }
    }
 catch (    IllegalArgumentException e) {
      buffer.append("String_Node_Str" + command + "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
    }
catch (    Exception e) {
      Logger.warn("String_Node_Str" + result.group(1),e);
      buffer.append("String_Node_Str" + command + "String_Node_Str");
      return;
    }
  }
 else {
    buffer.append("String_Node_Str");
    buffer.append(command.substring(1));
    buffer.append("String_Node_Str");
  }
}

Fixed version (ground truth):
public void handleMatch(StringBuffer buffer,MatchResult result,FilterContext context){
  String command=result.group(1);
  if (!command.startsWith("String_Node_Str")) {
    MacroParameter mParams=context.getMacroParameter();
    if (result.group(1).equals(result.group(result.groups() - 1))) {
      if (!"String_Node_Str".equals(result.group(2))) {
        mParams.setParams(result.group(2));
      }
      mParams.setContent(result.group(3));
    }
 else {
      if (result.groups() > 1) {
        mParams.setParams(result.group(2));
      }
    }
    try {
      if (macros.containsKey(command)) {
        Macro macro=(Macro)macros.get(command);
        if (null != mParams.getContent()) {
          mParams.setContent(filter(mParams.getContent(),context));
        }
        Writer writer=new StringBufferWriter(buffer);
        macro.execute(writer,mParams);
      }
 else       if (command.startsWith("String_Node_Str")) {
        RenderEngine engine=context.getRenderEngine();
        if (engine instanceof IncludeRenderEngine) {
          String include=((IncludeRenderEngine)engine).include(command.substring(1));
          if (null != include) {
            buffer.append(include);
          }
 else {
            buffer.append(command.substring(1) + "String_Node_Str");
          }
        }
        return;
      }
 else {
        buffer.append(result.group(0));
        return;
      }
    }
 catch (    IllegalArgumentException e) {
      buffer.append("String_Node_Str" + command + "String_Node_Str"+ e.getMessage()+ "String_Node_Str");
    }
catch (    Exception e) {
      Logger.warn("String_Node_Str" + result.group(1),e);
      buffer.append("String_Node_Str" + command + "String_Node_Str");
      return;
    }
  }
 else {
    buffer.append("String_Node_Str");
    buffer.append(command.substring(1));
    buffer.append("String_Node_Str");
  }
}