Program: 28149
Project: 28149
Buggy source:
/** 
 * <p> This handler creates a Map&lt;String, String&gt; which contains the QUERY_STRING parameters that should be passed to the REST logging endpoint to make a query with the given constraints.</p>
 * @param context	The HandlerContext.
 */
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=List.class,required=true),@HandlerInput(name="String_Node_Str",type=Boolean.class,defaultValue="String_Node_Str"),@HandlerInput(name="String_Node_Str",type=Integer.class,defaultValue="String_Node_Str")},output={@HandlerOutput(name="String_Node_Str",type=List.class),@HandlerOutput(name="String_Node_Str",type=Integer.class),@HandlerOutput(name="String_Node_Str",type=Integer.class)}) public static void processLogRecords(HandlerContext handlerCtx){
  List<Map<String,Object>> records=(List<Map<String,Object>>)handlerCtx.getInputValue("String_Node_Str");
  if (records != null) {
    boolean truncate=(Boolean)handlerCtx.getInputValue("String_Node_Str");
    int truncLen=(Integer)handlerCtx.getInputValue("String_Node_Str");
    Locale locale=GuiUtil.getLocale();
    for (    Map<String,Object> record : records) {
      record.put("String_Node_Str",formatDateForDisplay(locale,new Date(new Long(record.get("String_Node_Str").toString()))));
      String message=((String)record.get("String_Node_Str")).trim();
      if (truncate && (message.length() > truncLen)) {
        message=message.substring(0,truncLen).concat("String_Node_Str");
      }
      record.put("String_Node_Str",Util.htmlEscape(message));
    }
  }
  if ((records != null) && (records.size() > 0)) {
    handlerCtx.setOutputValue("String_Node_Str",records.get(0).get("String_Node_Str"));
    handlerCtx.setOutputValue("String_Node_Str",records.get(records.size() - 1).get("String_Node_Str"));
  }
 else {
    handlerCtx.setOutputValue("String_Node_Str","String_Node_Str");
    handlerCtx.setOutputValue("String_Node_Str","String_Node_Str");
  }
  handlerCtx.setOutputValue("String_Node_Str",records);
}

Fixed version (ground truth):
/** 
 * <p> This handler creates a Map&lt;String, String&gt; which contains the QUERY_STRING parameters that should be passed to the REST logging endpoint to make a query with the given constraints.</p>
 * @param context	The HandlerContext.
 */
@Handler(id="String_Node_Str",input={@HandlerInput(name="String_Node_Str",type=List.class,required=true),@HandlerInput(name="String_Node_Str",type=Boolean.class,defaultValue="String_Node_Str"),@HandlerInput(name="String_Node_Str",type=Integer.class,defaultValue="String_Node_Str")},output={@HandlerOutput(name="String_Node_Str",type=List.class),@HandlerOutput(name="String_Node_Str",type=Integer.class),@HandlerOutput(name="String_Node_Str",type=Integer.class)}) public static void processLogRecords(HandlerContext handlerCtx){
  List<Map<String,Object>> records=(List<Map<String,Object>>)handlerCtx.getInputValue("String_Node_Str");
  if (records != null) {
    boolean truncate=(Boolean)handlerCtx.getInputValue("String_Node_Str");
    int truncLen=(Integer)handlerCtx.getInputValue("String_Node_Str");
    Locale locale=GuiUtil.getLocale();
    for (    Map<String,Object> record : records) {
      record.put("String_Node_Str",formatDateForDisplay(locale,new Date(Long.parseLong(record.get("String_Node_Str").toString()))));
      String message=((String)record.get("String_Node_Str")).trim();
      if (truncate && (message.length() > truncLen)) {
        message=message.substring(0,truncLen).concat("String_Node_Str");
      }
      record.put("String_Node_Str",Util.htmlEscape(message));
    }
  }
  if ((records != null) && (records.size() > 0)) {
    handlerCtx.setOutputValue("String_Node_Str",records.get(0).get("String_Node_Str"));
    handlerCtx.setOutputValue("String_Node_Str",records.get(records.size() - 1).get("String_Node_Str"));
  }
 else {
    handlerCtx.setOutputValue("String_Node_Str","String_Node_Str");
    handlerCtx.setOutputValue("String_Node_Str","String_Node_Str");
  }
  handlerCtx.setOutputValue("String_Node_Str",records);
}