nus-yam/ex-repair huggingface dataset:
Program: 167613
Project: 167613
Buggy source:
public int getPubsuberPort(){
  if (this.pubsuberPort == 0)   this.pubsuberPort=2181;
  return pubsuberPort;
}

Fixed version (ground truth):
public int getPubsuberPort(){
  if (this.pubsuberPort == 0) {
    throw new RuntimeException("String_Node_Str");
  }
  return pubsuberPort;
}
Program: 167614
Project: 167614
Buggy source:
protected void init() throws IOException {
  this.connectionFactory=new ConnectionFactory();
  this.connectionFactory.setHost(this.host);
  this.connection=this.connectionFactory.newConnection();
  this.channel=this.connection.createChannel();
}

Fixed version (ground truth):
protected void init(){
  try {
    this.connectionFactory=new ConnectionFactory();
    this.connectionFactory.setHost(this.host);
    this.connection=this.connectionFactory.newConnection();
    this.channel=this.connection.createChannel();
  }
 catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + e.toString());
  }
}
Program: 167615
Project: 167615
Buggy source:
public synchronized boolean isAlive(){
  try {
    ShellHelper.ExecResult result=ShellHelper.exec("String_Node_Str");
    return result.getInfo().contains("String_Node_Str");
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + e.getMessage());
    return false;
  }
catch (  InterruptedException e) {
    return false;
  }
}

Fixed version (ground truth):
public static boolean isAlive(String mqHost){
  if (!comeFromSameHost(mqHost)) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  try {
    ShellHelper.ExecResult result=ShellHelper.exec("String_Node_Str");
    return result.getInfo().contains("String_Node_Str");
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + e.getMessage());
    return false;
  }
catch (  InterruptedException e) {
    return false;
  }
}
Program: 167616
Project: 167616
Buggy source:
public void stop(){
  logger.info("String_Node_Str");
  String mqServerStopCmdStr="String_Node_Str";
  try {
    ShellHelper.exec("String_Node_Str" + mqServerStopCmdStr);
  }
 catch (  IOException|InterruptedException e) {
    logger.error("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
public static void stop(String mqHost){
  if (!comeFromSameHost(mqHost)) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  logger.info("String_Node_Str");
  String mqServerStopCmdStr="String_Node_Str";
  try {
    ShellHelper.exec("String_Node_Str" + mqServerStopCmdStr);
  }
 catch (  IOException|InterruptedException e) {
    logger.error("String_Node_Str" + e.getMessage());
    throw new RuntimeException("String_Node_Str" + e.getMessage());
  }
}
Program: 167617
Project: 167617
Buggy source:
public void start(){
  logger.info("String_Node_Str");
  String mqServerStartupCmdStr="String_Node_Str";
  try {
    ShellHelper.exec("String_Node_Str" + mqServerStartupCmdStr);
  }
 catch (  IOException|InterruptedException e) {
    logger.error("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
public static void start(String mqHost){
  if (!comeFromSameHost(mqHost)) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  logger.info("String_Node_Str");
  String mqServerStartupCmdStr="String_Node_Str";
  try {
    ShellHelper.exec("String_Node_Str" + mqServerStartupCmdStr);
  }
 catch (  IOException|InterruptedException e) {
    logger.error("String_Node_Str" + e.getMessage());
  }
}
Program: 167618
Project: 167618
Buggy source:
public static void stop(){
  RabbitmqServerManager serverManager=RabbitmqServerManager.defaultManager(config);
  if (serverManager.isAlive()) {
    App app=new App();
    broadcastEvent(CONSTS.MESSAGEBUS_SERVER_EVENT_STOPPED,app);
    serverManager.stop();
    destroy(null);
  }
}

Fixed version (ground truth):
public static void stop(){
  App app=new App();
  broadcastEvent(CONSTS.MESSAGEBUS_SERVER_EVENT_STOPPED,app);
  destroy(null);
}
Program: 167619
Project: 167619
Buggy source:
public static void startup(){
  logger.debug("String_Node_Str");
  RabbitmqInitializer rabbitmqInitializer=RabbitmqInitializer.getInstance(config);
  try {
    rabbitmqInitializer.launch();
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + e.getMessage());
    System.exit(1);
  }
  logger.debug("String_Node_Str");
  Map<String,Object> context=null;
  context=buildContext(config);
  logger.info("String_Node_Str");
  PubSuberInitializer pubSuberInitializer=PubSuberInitializer.getInstance(context);
  try {
    pubSuberInitializer.launch();
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + e.getMessage());
    return;
  }
catch (  InterruptedException e) {
    logger.error("String_Node_Str" + e.getMessage());
  }
  try {
    buildCommonClient(context);
  }
 catch (  MessagebusConnectedFailedException e) {
    ExceptionHelper.logException(logger,e,"String_Node_Str");
    logger.error("String_Node_Str");
    System.exit(1);
  }
  boolean mqIsAlive=RabbitmqServerManager.defaultManager(config).isAlive();
  logger.debug("String_Node_Str" + mqIsAlive);
  if (mqIsAlive) {
    App app=new App();
    broadcastEvent(CONSTS.MESSAGEBUS_SERVER_EVENT_STARTED,app);
    logger.debug("String_Node_Str");
    ServiceLoader serviceLoader=ServiceLoader.getInstance(context);
    serviceLoader.launch();
synchronized (app) {
      try {
        app.wait(0);
      }
 catch (      InterruptedException e) {
        logger.info("String_Node_Str");
      }
 finally {
        destroy(context);
      }
    }
  }
 else {
    logger.error("String_Node_Str" + "String_Node_Str");
    System.exit(1);
  }
}

Fixed version (ground truth):
public static void startup(){
  logger.debug("String_Node_Str");
  RabbitmqInitializer rabbitmqInitializer=RabbitmqInitializer.getInstance(config);
  try {
    rabbitmqInitializer.launch();
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + e.getMessage());
    System.exit(1);
  }
  logger.debug("String_Node_Str");
  Map<String,Object> context=null;
  context=buildContext(config);
  logger.info("String_Node_Str");
  PubSuberInitializer pubSuberInitializer=PubSuberInitializer.getInstance(context);
  try {
    pubSuberInitializer.launch();
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + e.getMessage());
    return;
  }
catch (  InterruptedException e) {
    logger.error("String_Node_Str" + e.getMessage());
  }
  try {
    buildCommonClient(context);
  }
 catch (  MessagebusConnectedFailedException e) {
    ExceptionHelper.logException(logger,e,"String_Node_Str");
    logger.error("String_Node_Str");
    System.exit(1);
  }
  App app=new App();
  broadcastEvent(CONSTS.MESSAGEBUS_SERVER_EVENT_STARTED,app);
  logger.debug("String_Node_Str");
  ServiceLoader serviceLoader=ServiceLoader.getInstance(context);
  serviceLoader.launch();
synchronized (app) {
    try {
      app.wait(0);
    }
 catch (    InterruptedException e) {
      logger.info("String_Node_Str");
    }
 finally {
      destroy(context);
    }
  }
}
Program: 167620
Project: 167620
Buggy source:
public synchronized void launch() throws IOException {
  RabbitmqServerManager serverManager=RabbitmqServerManager.defaultManager(properties);
  logger.info("String_Node_Str" + (serverManager.isAlive() ? "String_Node_Str" : "String_Node_Str"));
  if (!serverManager.isAlive())   serverManager.start();
  this.initTopologyComponent();
}

Fixed version (ground truth):
public synchronized void launch() throws IOException {
  this.initTopologyComponent();
}
Program: 167621
Project: 167621
Buggy source:
@NotNull public IResponser getResponser() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return responser;
}

Fixed version (ground truth):
@NotNull public synchronized IResponser getResponser() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return responser;
}
Program: 167622
Project: 167622
Buggy source:
private void initChannelPool(){
  Map<String,Config> clientConfigs=this.configManager.getClientConfigMap();
  ChannelPoolConfig config=new ChannelPoolConfig();
  config.setMaxTotal(Integer.valueOf(clientConfigs.get("String_Node_Str").getValue()));
  config.setMaxIdle(Integer.valueOf(clientConfigs.get("String_Node_Str").getValue()));
  config.setMaxWaitMillis(Long.valueOf(clientConfigs.get("String_Node_Str").getValue()));
  config.setTestOnBorrow(Boolean.valueOf(clientConfigs.get("String_Node_Str").getValue()));
  config.setTestOnReturn(Boolean.valueOf(clientConfigs.get("String_Node_Str").getValue()));
  pool=new ChannelPool(config,new ChannelFactory(this.connection));
}

Fixed version (ground truth):
private void initChannelPool(){
  Map<String,Config> clientConfigs=this.configManager.getClientConfigMap();
  ChannelPoolConfig config=new ChannelPoolConfig();
  config.setMaxTotal(Integer.parseInt(clientConfigs.get("String_Node_Str").getValue()));
  config.setMaxIdle(Integer.parseInt(clientConfigs.get("String_Node_Str").getValue()));
  config.setMaxWaitMillis(Long.parseLong(clientConfigs.get("String_Node_Str").getValue()));
  config.setTestOnBorrow(Boolean.valueOf(clientConfigs.get("String_Node_Str").getValue()));
  config.setTestOnReturn(Boolean.valueOf(clientConfigs.get("String_Node_Str").getValue()));
  pool=new ChannelPool(config,new ChannelFactory(this.connection));
}
Program: 167623
Project: 167623
Buggy source:
@NotNull public IRequester getRequester() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return requester;
}

Fixed version (ground truth):
@NotNull public synchronized IRequester getRequester() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return requester;
}
Program: 167624
Project: 167624
Buggy source:
@NotNull public IProducer getProducer() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return producer;
}

Fixed version (ground truth):
@NotNull public synchronized IProducer getProducer() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return producer;
}
Program: 167625
Project: 167625
Buggy source:
@NotNull public IConsumer getConsumer() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return consumer;
}

Fixed version (ground truth):
@NotNull public synchronized IConsumer getConsumer() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return consumer;
}
Program: 167626
Project: 167626
Buggy source:
@NotNull public ISubscriber getSubscriber() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return subscriber;
}

Fixed version (ground truth):
@NotNull public synchronized ISubscriber getSubscriber() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return subscriber;
}
Program: 167627
Project: 167627
Buggy source:
@NotNull public IPublisher getPublisher() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return publisher;
}

Fixed version (ground truth):
@NotNull public synchronized IPublisher getPublisher() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return publisher;
}
Program: 167628
Project: 167628
Buggy source:
@NotNull public IBroadcaster getBroadcaster() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return broadcaster;
}

Fixed version (ground truth):
@NotNull public synchronized IBroadcaster getBroadcaster() throws MessagebusUnOpenException {
  if (!this.isOpen())   throw new MessagebusUnOpenException("String_Node_Str");
  return broadcaster;
}
Program: 167629
Project: 167629
Buggy source:
private void processReceivePermission(List<ReceivePermission> receivePermissions){
  receivePermissionMap=new ConcurrentHashMap<>(receivePermissions.size());
  int maxReceivePermGrantId=0;
  for (  ReceivePermission receivePermission : receivePermissions) {
    String targetId=String.valueOf(receivePermission.getTargetId());
    if (!receivePermissionMap.containsKey(targetId)) {
      receivePermissionMap.put(targetId,"String_Node_Str");
    }
    String joinedGrantIds=receivePermissionMap.get(targetId);
    String grantId=String.valueOf(receivePermission.getGrantId());
    receivePermissionMap.put(targetId,joinedGrantIds + grantId + "String_Node_Str");
    maxReceivePermGrantId=Math.max(maxReceivePermGrantId,Integer.valueOf(grantId));
  }
  receivePermByteQueryArrMap=new ConcurrentHashMap<>(receivePermissionMap.size());
  for (  Map.Entry<String,String> receivePermItem : receivePermissionMap.entrySet()) {
    receivePermByteQueryArrMap.put(receivePermItem.getKey(),this.buildQueryArray(maxReceivePermGrantId,receivePermItem.getKey(),this.receivePermissionMap));
  }
}

Fixed version (ground truth):
private void processReceivePermission(List<ReceivePermission> receivePermissions){
  receivePermissionMap=new ConcurrentHashMap<>(receivePermissions.size());
  int maxReceivePermGrantId=0;
  for (  ReceivePermission receivePermission : receivePermissions) {
    String targetId=String.valueOf(receivePermission.getTargetId());
    if (!receivePermissionMap.containsKey(targetId)) {
      receivePermissionMap.put(targetId,"String_Node_Str");
    }
    String joinedGrantIds=receivePermissionMap.get(targetId);
    String grantId=String.valueOf(receivePermission.getGrantId());
    receivePermissionMap.put(targetId,joinedGrantIds + grantId + "String_Node_Str");
    maxReceivePermGrantId=Math.max(maxReceivePermGrantId,Integer.parseInt(grantId));
  }
  receivePermByteQueryArrMap=new ConcurrentHashMap<>(receivePermissionMap.size());
  for (  Map.Entry<String,String> receivePermItem : receivePermissionMap.entrySet()) {
    receivePermByteQueryArrMap.put(receivePermItem.getKey(),this.buildQueryArray(maxReceivePermGrantId,receivePermItem.getKey(),this.receivePermissionMap));
  }
}
Program: 167630
Project: 167630
Buggy source:
private void processSendPermission(List<SendPermission> sendPermissions){
  sendPermissionMap=new ConcurrentHashMap<>(sendPermissions.size());
  int maxSendPermGrantId=0;
  for (  SendPermission sendPermission : sendPermissions) {
    String targetId=String.valueOf(sendPermission.getTargetId());
    if (!sendPermissionMap.containsKey(targetId)) {
      sendPermissionMap.put(targetId,"String_Node_Str");
    }
    String joinedGrantIds=sendPermissionMap.get(targetId);
    String grantId=String.valueOf(sendPermission.getGrantId());
    sendPermissionMap.put(targetId,joinedGrantIds + grantId + "String_Node_Str");
    maxSendPermGrantId=Math.max(maxSendPermGrantId,Integer.valueOf(grantId));
  }
  sendPermByteQueryArrMap=new ConcurrentHashMap<>(sendPermissionMap.size());
  for (  Map.Entry<String,String> sendPermItem : this.sendPermissionMap.entrySet()) {
    sendPermByteQueryArrMap.put(sendPermItem.getKey(),this.buildQueryArray(maxSendPermGrantId,sendPermItem.getKey(),this.sendPermissionMap));
  }
}

Fixed version (ground truth):
private void processSendPermission(List<SendPermission> sendPermissions){
  sendPermissionMap=new ConcurrentHashMap<>(sendPermissions.size());
  int maxSendPermGrantId=0;
  for (  SendPermission sendPermission : sendPermissions) {
    String targetId=String.valueOf(sendPermission.getTargetId());
    if (!sendPermissionMap.containsKey(targetId)) {
      sendPermissionMap.put(targetId,"String_Node_Str");
    }
    String joinedGrantIds=sendPermissionMap.get(targetId);
    String grantId=String.valueOf(sendPermission.getGrantId());
    sendPermissionMap.put(targetId,joinedGrantIds + grantId + "String_Node_Str");
    maxSendPermGrantId=Math.max(maxSendPermGrantId,Integer.parseInt(grantId));
  }
  sendPermByteQueryArrMap=new ConcurrentHashMap<>(sendPermissionMap.size());
  for (  Map.Entry<String,String> sendPermItem : this.sendPermissionMap.entrySet()) {
    sendPermByteQueryArrMap.put(sendPermItem.getKey(),this.buildQueryArray(maxSendPermGrantId,sendPermItem.getKey(),this.sendPermissionMap));
  }
}
Program: 167631
Project: 167631
Buggy source:
private byte[] buildQueryArray(int maxGrantId,String targetIdStr,Map<String,String> map){
  byte[] permissionQueryBytes=new byte[maxGrantId + 1];
  String[] grantIds=map.get(targetIdStr).toString().split("String_Node_Str");
  permissionQueryBytes[0]=0;
  for (int i=0; i <= maxGrantId; i++) {
    permissionQueryBytes[i]=0;
    for (int j=0; j < grantIds.length; j++) {
      int current=Integer.valueOf(grantIds[j]);
      if (i == current) {
        permissionQueryBytes[i]=1;
        break;
      }
    }
  }
  return permissionQueryBytes;
}

Fixed version (ground truth):
private byte[] buildQueryArray(int maxGrantId,String targetIdStr,Map<String,String> map){
  byte[] permissionQueryBytes=new byte[maxGrantId + 1];
  String[] grantIds=map.get(targetIdStr).toString().split("String_Node_Str");
  permissionQueryBytes[0]=0;
  for (int i=0; i <= maxGrantId; i++) {
    permissionQueryBytes[i]=0;
    for (int j=0; j < grantIds.length; j++) {
      int current=Integer.parseInt(grantIds[j]);
      if (i == current) {
        permissionQueryBytes[i]=1;
        break;
      }
    }
  }
  return permissionQueryBytes;
}
Program: 167632
Project: 167632
Buggy source:
public static IMessageHeader unbox(@NotNull AMQP.BasicProperties properties,MessageType msgType,IMessageHeader msgHeader){
  msgHeader.setCorrelationId(properties.getCorrelationId());
  msgHeader.setHeaders(properties.getHeaders());
  msgHeader.setTimestamp(properties.getTimestamp());
  String msgIdStr=properties.getMessageId();
  if (msgIdStr != null && !msgIdStr.isEmpty())   msgHeader.setMessageId(Long.valueOf(msgIdStr));
 else   logger.error("String_Node_Str");
  msgHeader.setContentEncoding(properties.getContentEncoding());
  msgHeader.setContentType(properties.getContentType());
  msgHeader.setAppId(properties.getAppId());
  msgHeader.setReplyTo(properties.getReplyTo());
  return msgHeader;
}

Fixed version (ground truth):
public static IMessageHeader unbox(@NotNull AMQP.BasicProperties properties,MessageType msgType,IMessageHeader msgHeader){
  msgHeader.setCorrelationId(properties.getCorrelationId());
  msgHeader.setHeaders(properties.getHeaders());
  msgHeader.setTimestamp(properties.getTimestamp());
  String msgIdStr=properties.getMessageId();
  if (msgIdStr != null && !msgIdStr.isEmpty())   msgHeader.setMessageId(Long.parseLong(msgIdStr));
 else   logger.error("String_Node_Str");
  msgHeader.setContentEncoding(properties.getContentEncoding());
  msgHeader.setContentType(properties.getContentType());
  msgHeader.setAppId(properties.getAppId());
  msgHeader.setReplyTo(properties.getReplyTo());
  return msgHeader;
}
Program: 167633
Project: 167633
Buggy source:
@NotNull public static String syncHTTPGet(@NotNull Map<String,Object> requestParamDic,@NotNull AuthInfo authInfo){
  CloseableHttpClient httpClient=HttpClients.createDefault();
  CloseableHttpResponse response=null;
  try {
    URI uri=new URIBuilder().setScheme("String_Node_Str").setHost(requestParamDic.get("String_Node_Str").toString()).setPort(Integer.valueOf(requestParamDic.get("String_Node_Str").toString())).setPath(requestParamDic.get("String_Node_Str").toString()).setUserInfo(authInfo.getUserName(),authInfo.getPassword()).build();
    HttpGet httpGet=new HttpGet(uri);
    response=httpClient.execute(httpGet);
    HttpEntity entity=response.getEntity();
    if (entity != null) {
      long len=entity.getContentLength();
      if (len == -1)       return "String_Node_Str";
      if (len < 2 * 1024 * 1024) {
        return EntityUtils.toString(entity);
      }
 else {
        logger.error("String_Node_Str" + len + "String_Node_Str"+ "String_Node_Str"+ uri.getRawPath());
        return "String_Node_Str";
      }
    }
  }
 catch (  IOException|URISyntaxException e) {
    logger.error("String_Node_Str" + e.getMessage());
  }
 finally {
    if (response != null)     try {
      response.close();
    }
 catch (    IOException e) {
      logger.error("String_Node_Str" + e.getMessage());
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
@NotNull public static String syncHTTPGet(@NotNull Map<String,Object> requestParamDic,@NotNull AuthInfo authInfo){
  CloseableHttpClient httpClient=HttpClients.createDefault();
  CloseableHttpResponse response=null;
  try {
    URI uri=new URIBuilder().setScheme("String_Node_Str").setHost(requestParamDic.get("String_Node_Str").toString()).setPort(Integer.parseInt(requestParamDic.get("String_Node_Str").toString())).setPath(requestParamDic.get("String_Node_Str").toString()).setUserInfo(authInfo.getUserName(),authInfo.getPassword()).build();
    HttpGet httpGet=new HttpGet(uri);
    response=httpClient.execute(httpGet);
    HttpEntity entity=response.getEntity();
    if (entity != null) {
      long len=entity.getContentLength();
      if (len == -1)       return "String_Node_Str";
      if (len < 2 * 1024 * 1024) {
        return EntityUtils.toString(entity);
      }
 else {
        logger.error("String_Node_Str" + len + "String_Node_Str"+ "String_Node_Str"+ uri.getRawPath());
        return "String_Node_Str";
      }
    }
  }
 catch (  IOException|URISyntaxException e) {
    logger.error("String_Node_Str" + e.getMessage());
  }
 finally {
    if (response != null)     try {
      response.close();
    }
 catch (    IOException e) {
      logger.error("String_Node_Str" + e.getMessage());
    }
  }
  return "String_Node_Str";
}
Program: 167635
Project: 167635
Buggy source:
private void syncConsume(HttpServletRequest request,HttpServletResponse response,Messagebus messagebus) throws ServletException, IOException {
  String queueName=request.getRequestURI().split("String_Node_Str")[3];
  String numStr=request.getParameter("String_Node_Str");
  int num=0;
  List<Message> messages=null;
  try {
    if (numStr == null)     throw new NullPointerException("String_Node_Str");
    try {
      num=Integer.valueOf(numStr);
    }
 catch (    NumberFormatException e) {
      throw new InvalidParameterException("String_Node_Str");
    }
    if (num < Constants.MIN_CONSUME_NUM || num > Constants.MAX_CONSUME_NUM)     throw new InvalidParameterException("String_Node_Str" + Constants.MAX_CONSUME_NUM + "String_Node_Str"+ Constants.MIN_CONSUME_NUM);
    IConsumer consumer=messagebus.getConsumer();
    messages=consumer.consume(queueName,num);
    if (messages == null) {
      ResponseUtil.response(response,Constants.HTTP_SUCCESS_CODE,"String_Node_Str","String_Node_Str","String_Node_Str");
    }
 else {
      String msgsStr=MessageJSONSerializer.serializeMessages(messages);
      ResponseUtil.response(response,Constants.HTTP_SUCCESS_CODE,"String_Node_Str","String_Node_Str",msgsStr);
    }
  }
 catch (  Exception e) {
    logger.error(e.getMessage());
    ResponseUtil.response(response,Constants.HTTP_FAILED_CODE,e.getMessage(),"String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
private void syncConsume(HttpServletRequest request,HttpServletResponse response,Messagebus messagebus) throws ServletException, IOException {
  String queueName=request.getRequestURI().split("String_Node_Str")[3];
  String numStr=request.getParameter("String_Node_Str");
  int num=0;
  List<Message> messages=null;
  try {
    if (numStr == null)     throw new NullPointerException("String_Node_Str");
    try {
      num=Integer.parseInt(numStr);
    }
 catch (    NumberFormatException e) {
      throw new InvalidParameterException("String_Node_Str");
    }
    if (num < Constants.MIN_CONSUME_NUM || num > Constants.MAX_CONSUME_NUM)     throw new InvalidParameterException("String_Node_Str" + Constants.MAX_CONSUME_NUM + "String_Node_Str"+ Constants.MIN_CONSUME_NUM);
    IConsumer consumer=messagebus.getConsumer();
    messages=consumer.consume(queueName,num);
    if (messages == null) {
      ResponseUtil.response(response,Constants.HTTP_SUCCESS_CODE,"String_Node_Str","String_Node_Str","String_Node_Str");
    }
 else {
      String msgsStr=MessageJSONSerializer.serializeMessages(messages);
      ResponseUtil.response(response,Constants.HTTP_SUCCESS_CODE,"String_Node_Str","String_Node_Str",msgsStr);
    }
  }
 catch (  Exception e) {
    logger.error(e.getMessage());
    ResponseUtil.response(response,Constants.HTTP_FAILED_CODE,e.getMessage(),"String_Node_Str","String_Node_Str");
  }
}
Program: 167636
Project: 167636
Buggy source:
public void activate() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String pNodeId=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int nodeId=Integer.valueOf(pNodeId);
  try {
    nodeService.activate(nodeId);
    responseJTableData(resp,generateUpdateSuccessJSONStr());
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void activate() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String pNodeId=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int nodeId=Integer.parseInt(pNodeId);
  try {
    nodeService.activate(nodeId);
    responseJTableData(resp,generateUpdateSuccessJSONStr());
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}
Program: 167637
Project: 167637
Buggy source:
public void unactivate() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String pNodeId=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int nodeId=Integer.valueOf(pNodeId);
  try {
    nodeService.unactivate(nodeId);
    responseJTableData(resp,generateUpdateSuccessJSONStr());
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void unactivate() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String pNodeId=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int nodeId=Integer.parseInt(pNodeId);
  try {
    nodeService.unactivate(nodeId);
    responseJTableData(resp,generateUpdateSuccessJSONStr());
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}
Program: 167638
Project: 167638
Buggy source:
public void reset() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String pNodeId=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int nodeId=Integer.valueOf(pNodeId);
  try {
    String appId=nodeService.resetAppId(nodeId);
    responseJTableData(resp,generateCreateSuccessJSONStr(appId));
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void reset() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String pNodeId=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int nodeId=Integer.parseInt(pNodeId);
  try {
    String appId=nodeService.resetAppId(nodeId);
    responseJTableData(resp,generateCreateSuccessJSONStr(appId));
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}
Program: 167639
Project: 167639
Buggy source:
public void list() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  int offset, pageSize;
  List<Node> nodeList=null;
  try {
    offset=Integer.valueOf(req.getParameter("String_Node_Str"));
    pageSize=Integer.valueOf(req.getParameter("String_Node_Str"));
    nodeList=nodeService.getWithType(Constants.QUEUE_TYPE,offset,pageSize);
    String jsonArr=gson.toJson(nodeList);
    jsonArr=generateListWithPagingSuccessJSONStr(jsonArr,nodeService.countAvailableQueues());
    responseJTableData(resp,jsonArr);
  }
 catch (  NumberFormatException e) {
    nodeList=nodeService.getWithType(Constants.QUEUE_TYPE,0,Integer.MAX_VALUE);
    String jsonArr=gson.toJson(nodeList);
    jsonArr=generateListSuccessJSONStr(jsonArr);
    responseJTableData(resp,jsonArr);
  }
}

Fixed version (ground truth):
public void list() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  int offset, pageSize;
  List<Node> nodeList=null;
  try {
    offset=Integer.valueOf(req.getParameter("String_Node_Str"));
    pageSize=Integer.parseInt(req.getParameter("String_Node_Str"));
    nodeList=nodeService.getWithType(Constants.QUEUE_TYPE,offset,pageSize);
    String jsonArr=gson.toJson(nodeList);
    jsonArr=generateListWithPagingSuccessJSONStr(jsonArr,nodeService.countAvailableQueues());
    responseJTableData(resp,jsonArr);
  }
 catch (  NumberFormatException e) {
    nodeList=nodeService.getWithType(Constants.QUEUE_TYPE,0,Integer.MAX_VALUE);
    String jsonArr=gson.toJson(nodeList);
    jsonArr=generateListSuccessJSONStr(jsonArr);
    responseJTableData(resp,jsonArr);
  }
}
Program: 167641
Project: 167641
Buggy source:
public void list() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  int offset, pageSize;
  List<Node> nodeList=null;
  try {
    offset=Integer.valueOf(req.getParameter("String_Node_Str"));
    pageSize=Integer.valueOf(req.getParameter("String_Node_Str"));
    nodeList=nodeService.getWithPaging(offset,pageSize);
    String jsonArr=gson.toJson(nodeList);
    jsonArr=generateListWithPagingSuccessJSONStr(jsonArr,nodeService.countAll());
    responseJTableData(resp,jsonArr);
  }
 catch (  NumberFormatException e) {
    nodeList=nodeService.getAll();
    String jsonArr=gson.toJson(nodeList);
    jsonArr=generateListSuccessJSONStr(jsonArr);
    responseJTableData(resp,jsonArr);
  }
}

Fixed version (ground truth):
public void list() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  int offset, pageSize;
  List<Node> nodeList=null;
  try {
    offset=Integer.parseInt(req.getParameter("String_Node_Str"));
    pageSize=Integer.parseInt(req.getParameter("String_Node_Str"));
    nodeList=nodeService.getWithPaging(offset,pageSize);
    String jsonArr=gson.toJson(nodeList);
    jsonArr=generateListWithPagingSuccessJSONStr(jsonArr,nodeService.countAll());
    responseJTableData(resp,jsonArr);
  }
 catch (  NumberFormatException e) {
    nodeList=nodeService.getAll();
    String jsonArr=gson.toJson(nodeList);
    jsonArr=generateListSuccessJSONStr(jsonArr);
    responseJTableData(resp,jsonArr);
  }
}
Program: 167642
Project: 167642
Buggy source:
public void delete() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String pNodeId=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int nodeId=Integer.valueOf(pNodeId);
  try {
    nodeService.remove(nodeId);
    responseJTableData(resp,generateUpdateSuccessJSONStr());
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr(e.getMessage()));
  }
}

Fixed version (ground truth):
public void delete() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String pNodeId=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(pNodeId)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int nodeId=Integer.parseInt(pNodeId);
  try {
    nodeService.remove(nodeId);
    responseJTableData(resp,generateUpdateSuccessJSONStr());
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr(e.getMessage()));
  }
}
Program: 167643
Project: 167643
Buggy source:
@Override public void contextInitialized(ServletContextEvent servletContextEvent){
  Messagebus messagebus=Messagebus.createClient("String_Node_Str");
  messagebus.setZkHost(Constants.ZK_HOST);
  messagebus.setZkPort(Constants.ZK_PORT);
  try {
    messagebus.open();
    servletContextEvent.getServletContext().setAttribute(Constants.MESSAGEBUS_KEY,messagebus);
    sentinel=new Sentinel(messagebus,servletContextEvent);
    sentinel.startMonitor();
  }
 catch (  MessagebusConnectedFailedException e) {
    logger.error("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void contextInitialized(ServletContextEvent servletContextEvent){
}
Program: 167644
Project: 167644
Buggy source:
public void create() throws IOException {
  HttpServletRequest request=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  Module newModule=new Module();
  newModule.setModuleName(request.getParameter("String_Node_Str"));
  newModule.setModuleValue(request.getParameter("String_Node_Str"));
  newModule.setLinkUrl(request.getParameter("String_Node_Str"));
  newModule.setParentModule(request.getParameter("String_Node_Str"));
  String sortIndexStr=request.getParameter("String_Node_Str");
  if (sortIndexStr == null || sortIndexStr.isEmpty())   sortIndexStr="String_Node_Str";
  newModule.setSortIndex(Integer.valueOf(sortIndexStr));
  Module existsModule=moduleService.getWithModuleValue(newModule.getModuleValue());
  if (existsModule == null) {
    moduleService.create(newModule);
    existsModule=moduleService.getWithModuleValue(newModule.getModuleValue());
    String jsonStr=gson.toJson(existsModule);
    jsonStr=generateCreateSuccessJSONStr(jsonStr);
    super.refreshMenu(ServletActionContext.getRequest().getSession());
    responseJTableData(resp,jsonStr);
  }
 else {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void create() throws IOException {
  HttpServletRequest request=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  Module newModule=new Module();
  newModule.setModuleName(request.getParameter("String_Node_Str"));
  newModule.setModuleValue(request.getParameter("String_Node_Str"));
  newModule.setLinkUrl(request.getParameter("String_Node_Str"));
  newModule.setParentModule(request.getParameter("String_Node_Str"));
  String sortIndexStr=request.getParameter("String_Node_Str");
  if (sortIndexStr == null || sortIndexStr.isEmpty())   sortIndexStr="String_Node_Str";
  newModule.setSortIndex(Integer.parseInt(sortIndexStr));
  Module existsModule=moduleService.getWithModuleValue(newModule.getModuleValue());
  if (existsModule == null) {
    moduleService.create(newModule);
    existsModule=moduleService.getWithModuleValue(newModule.getModuleValue());
    String jsonStr=gson.toJson(existsModule);
    jsonStr=generateCreateSuccessJSONStr(jsonStr);
    super.refreshMenu(ServletActionContext.getRequest().getSession());
    responseJTableData(resp,jsonStr);
  }
 else {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}
Program: 167645
Project: 167645
Buggy source:
public void update() throws IOException {
  HttpServletRequest request=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  Module module=new Module();
  module.setModuleCode(request.getParameter("String_Node_Str"));
  module.setModuleName(request.getParameter("String_Node_Str"));
  module.setModuleValue(request.getParameter("String_Node_Str"));
  module.setLinkUrl(request.getParameter("String_Node_Str"));
  module.setParentModule(request.getParameter("String_Node_Str"));
  String sortIndexStr=request.getParameter("String_Node_Str");
  if (sortIndexStr == null || sortIndexStr.isEmpty())   sortIndexStr="String_Node_Str";
  module.setSortIndex(Integer.valueOf(sortIndexStr));
  moduleService.modify(module);
  super.refreshMenu(ServletActionContext.getRequest().getSession());
  responseJTableData(resp,generateUpdateSuccessJSONStr());
}

Fixed version (ground truth):
public void update() throws IOException {
  HttpServletRequest request=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  Module module=new Module();
  module.setModuleCode(request.getParameter("String_Node_Str"));
  module.setModuleName(request.getParameter("String_Node_Str"));
  module.setModuleValue(request.getParameter("String_Node_Str"));
  module.setLinkUrl(request.getParameter("String_Node_Str"));
  module.setParentModule(request.getParameter("String_Node_Str"));
  String sortIndexStr=request.getParameter("String_Node_Str");
  if (sortIndexStr == null || sortIndexStr.isEmpty())   sortIndexStr="String_Node_Str";
  module.setSortIndex(Integer.parseInt(sortIndexStr));
  moduleService.modify(module);
  super.refreshMenu(ServletActionContext.getRequest().getSession());
  responseJTableData(resp,generateUpdateSuccessJSONStr());
}
Program: 167646
Project: 167646
Buggy source:
public void list() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  int offset, pageSize;
  List<Module> moduleList=null;
  try {
    offset=Integer.valueOf(req.getParameter("String_Node_Str"));
    pageSize=Integer.valueOf(req.getParameter("String_Node_Str"));
    moduleList=moduleService.getWithPaging(offset,pageSize);
    String jsonArr=gson.toJson(moduleList);
    jsonArr=generateListWithPagingSuccessJSONStr(jsonArr,moduleService.countAll());
    responseJTableData(resp,jsonArr);
  }
 catch (  NumberFormatException e) {
    moduleList=moduleService.getAll();
    String jsonArr=gson.toJson(moduleList);
    jsonArr=generateListSuccessJSONStr(jsonArr);
    responseJTableData(resp,jsonArr);
  }
}

Fixed version (ground truth):
public void list() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  int offset, pageSize;
  List<Module> moduleList=null;
  try {
    offset=Integer.parseInt(req.getParameter("String_Node_Str"));
    pageSize=Integer.parseInt(req.getParameter("String_Node_Str"));
    moduleList=moduleService.getWithPaging(offset,pageSize);
    String jsonArr=gson.toJson(moduleList);
    jsonArr=generateListWithPagingSuccessJSONStr(jsonArr,moduleService.countAll());
    responseJTableData(resp,jsonArr);
  }
 catch (  NumberFormatException e) {
    moduleList=moduleService.getAll();
    String jsonArr=gson.toJson(moduleList);
    jsonArr=generateListSuccessJSONStr(jsonArr);
    responseJTableData(resp,jsonArr);
  }
}
Program: 167647
Project: 167647
Buggy source:
public void sendlist() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  List<Node> nodeList=null;
  String targetIdStr=req.getParameter("String_Node_Str");
  int targetId=-1;
  try {
    targetId=Integer.valueOf(targetIdStr);
  }
 catch (  NumberFormatException e) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  Node targetNode=nodeService.get(targetId);
  if (targetNode == null) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str" + targetIdStr));
    return;
  }
  boolean isPubsubQueue=targetNode.getName().contains("String_Node_Str");
  nodeList=nodeService.getQueues(targetId,isPubsubQueue);
  List<SendPermission> sendPermissionList=sendPermissionService.getWithTargetId(targetId);
  int[] sendGrantIds=this.extractSendGrantIds(sendPermissionList);
  String jsonArr=gson.toJson(nodeList);
  jsonArr=generateListSuccessJSONStr(jsonArr,gson.toJson(sendGrantIds));
  responseJTableData(resp,jsonArr);
}

Fixed version (ground truth):
public void sendlist() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  List<Node> nodeList=null;
  String targetIdStr=req.getParameter("String_Node_Str");
  int targetId=-1;
  try {
    targetId=Integer.parseInt(targetIdStr);
  }
 catch (  NumberFormatException e) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  Node targetNode=nodeService.get(targetId);
  if (targetNode == null) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str" + targetIdStr));
    return;
  }
  boolean isPubsubQueue=targetNode.getName().contains("String_Node_Str");
  nodeList=nodeService.getQueues(targetId,isPubsubQueue);
  List<SendPermission> sendPermissionList=sendPermissionService.getWithTargetId(targetId);
  int[] sendGrantIds=this.extractSendGrantIds(sendPermissionList);
  String jsonArr=gson.toJson(nodeList);
  jsonArr=generateListSuccessJSONStr(jsonArr,gson.toJson(sendGrantIds));
  responseJTableData(resp,jsonArr);
}
Program: 167648
Project: 167648
Buggy source:
public void sendpermission() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String joinedGrantIds=req.getParameter("String_Node_Str");
  String targetIdStr=req.getParameter("String_Node_Str");
  String originalGrantIds=req.getParameter("String_Node_Str");
  if (joinedGrantIds == null) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  if (originalGrantIds == null) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  if (Strings.isNullOrEmpty(targetIdStr)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int targetId=Integer.valueOf(targetIdStr);
  Map<String,List<Integer>> filterMap=this.filterGrantIds(originalGrantIds,joinedGrantIds);
  SendPermission sendPermission=new SendPermission();
  sendPermission.setTargetId(targetId);
  try {
    for (    Integer deletingGrantId : filterMap.get("String_Node_Str")) {
      sendPermissionService.remove(targetId,deletingGrantId);
    }
    for (    Integer insertingGrantId : filterMap.get("String_Node_Str")) {
      sendPermission.setGrantId(insertingGrantId);
      sendPermissionService.save(sendPermission);
    }
    responseJTableData(resp,generateUpdateSuccessJSONStr());
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}

Fixed version (ground truth):
public void sendpermission() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  String joinedGrantIds=req.getParameter("String_Node_Str");
  String targetIdStr=req.getParameter("String_Node_Str");
  String originalGrantIds=req.getParameter("String_Node_Str");
  if (joinedGrantIds == null) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  if (originalGrantIds == null) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  if (Strings.isNullOrEmpty(targetIdStr)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  int targetId=Integer.parseInt(targetIdStr);
  Map<String,List<Integer>> filterMap=this.filterGrantIds(originalGrantIds,joinedGrantIds);
  SendPermission sendPermission=new SendPermission();
  sendPermission.setTargetId(targetId);
  try {
    for (    Integer deletingGrantId : filterMap.get("String_Node_Str")) {
      sendPermissionService.remove(targetId,deletingGrantId);
    }
    for (    Integer insertingGrantId : filterMap.get("String_Node_Str")) {
      sendPermission.setGrantId(insertingGrantId);
      sendPermissionService.save(sendPermission);
    }
    responseJTableData(resp,generateUpdateSuccessJSONStr());
  }
 catch (  SQLException e) {
    logger.error("String_Node_Str" + e.getMessage());
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
}
Program: 167649
Project: 167649
Buggy source:
public void receivelist() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  List<Node> nodeList=null;
  String targetIdStr=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(targetIdStr)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
  int targetId=-1;
  try {
    targetId=Integer.valueOf(targetIdStr);
  }
 catch (  NumberFormatException e) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  Node targetNode=nodeService.get(targetId);
  if (targetNode == null) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str" + targetIdStr));
    return;
  }
  boolean isPubsubQueue=targetNode.getName().contains("String_Node_Str");
  nodeList=nodeService.getQueues(targetId,isPubsubQueue);
  List<ReceivePermission> receivePermissionList=receivePermissionService.getWithTargetId(targetId);
  int[] receiveGrantIds=this.extractReceiveGrantIds(receivePermissionList);
  String jsonArr=gson.toJson(nodeList);
  jsonArr=generateListSuccessJSONStr(jsonArr,gson.toJson(receiveGrantIds));
  responseJTableData(resp,jsonArr);
}

Fixed version (ground truth):
public void receivelist() throws IOException {
  HttpServletRequest req=ServletActionContext.getRequest();
  HttpServletResponse resp=ServletActionContext.getResponse();
  List<Node> nodeList=null;
  String targetIdStr=req.getParameter("String_Node_Str");
  if (Strings.isNullOrEmpty(targetIdStr)) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
  }
  int targetId=-1;
  try {
    targetId=Integer.parseInt(targetIdStr);
  }
 catch (  NumberFormatException e) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str"));
    return;
  }
  Node targetNode=nodeService.get(targetId);
  if (targetNode == null) {
    responseJTableData(resp,generateErrorJSONStr("String_Node_Str" + targetIdStr));
    return;
  }
  boolean isPubsubQueue=targetNode.getName().contains("String_Node_Str");
  nodeList=nodeService.getQueues(targetId,isPubsubQueue);
  List<ReceivePermission> receivePermissionList=receivePermissionService.getWithTargetId(targetId);
  int[] receiveGrantIds=this.extractReceiveGrantIds(receivePermissionList);
  String jsonArr=gson.toJson(nodeList);
  jsonArr=generateListSuccessJSONStr(jsonArr,gson.toJson(receiveGrantIds));
  responseJTableData(resp,jsonArr);
}