Program: 167640
Project: 167640
Buggy source:
public void create() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  node=new Node();
  String pNodeName=req.getParameter("String_Node_Str");
  String pNodeType=req.getParameter("String_Node_Str");
  String pParentId=req.getParameter("String_Node_Str");
  String pRouterType=req.getParameter("String_Node_Str");
  String pNodeLevel=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeName)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  node.setName(pNodeName);
  if (Strings.isNullOrEmpty(pNodeType)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  if (pNodeType.equals(Constants.EXCHANGE_TYPE_OF_STRING)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  node.setType(Short.valueOf(pNodeType));
  if (Strings.isNullOrEmpty(pParentId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  node.setParentId(Integer.valueOf(pParentId));
  if (node.getType() == Constants.EXCHANGE_TYPE) {
    if (Strings.isNullOrEmpty(pRouterType)) {
      responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
      return;
    }
    node.setRouterType(pRouterType);
  }
  if (Strings.isNullOrEmpty(pNodeLevel)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  node.setLevel(Short.valueOf(pNodeLevel));
  try {
    node.setRoutingKey(nodeService.generateRoutingKey(node));
    node.setValue(nodeService.generateNodeValue(node));
  }
 catch (  IllegalStateException e) {
    responseJTableData(resp,generateErrorJSONStr(e.getMessage()));
    return;
  }
  try {
    nodeService.save(node);
    responseJTableData(resp,generateCreateSuccessJSONStr("String_Node_Str"));
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr(e.getMessage()));
  }
}

Fixed version (ground truth):
public void create() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  node=new Node();
  String pNodeName=req.getParameter("String_Node_Str");
  String pNodeType=req.getParameter("String_Node_Str");
  String pParentId=req.getParameter("String_Node_Str");
  String pRouterType=req.getParameter("String_Node_Str");
  String pNodeLevel=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeName)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  node.setName(pNodeName);
  if (Strings.isNullOrEmpty(pNodeType)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  if (pNodeType.equals(Constants.EXCHANGE_TYPE_OF_STRING)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  node.setType(Short.valueOf(pNodeType));
  if (Strings.isNullOrEmpty(pParentId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  node.setParentId(Integer.parseInt(pParentId));
  if (node.getType() == Constants.EXCHANGE_TYPE) {
    if (Strings.isNullOrEmpty(pRouterType)) {
      responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
      return;
    }
    node.setRouterType(pRouterType);
  }
  if (Strings.isNullOrEmpty(pNodeLevel)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  node.setLevel(Short.valueOf(pNodeLevel));
  try {
    node.setRoutingKey(nodeService.generateRoutingKey(node));
    node.setValue(nodeService.generateNodeValue(node));
  }
 catch (  IllegalStateException e) {
    responseJTableData(resp,generateErrorJSONStr(e.getMessage()));
    return;
  }
  try {
    nodeService.save(node);
    responseJTableData(resp,generateCreateSuccessJSONStr("String_Node_Str"));
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr(e.getMessage()));
  }
}