nus-yam/ex-repair huggingface dataset:
Program: 12486
Project: 12486
Buggy source:
public void add(final Product product){
  if (product == null) {
    return;
  }
  product.setKey(UUID.randomUUID().toString().replace("String_Node_Str","String_Node_Str"));
  product.setSecret(UUID.randomUUID().toString().replace("String_Node_Str","String_Node_Str"));
  final String sql="String_Node_Str";
  KeyHolder holder=new GeneratedKeyHolder();
  this.mainJdbc.update(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);
      ps.setObject(0,product.getTitle());
      ps.setObject(1,product.getKey());
      ps.setObject(2,product.getSecret());
      ps.setObject(3,product.getClientTypeid());
      ps.setObject(4,product.getCertPath());
      ps.setObject(5,product.getDevCertPath());
      return ps;
    }
  }
,holder);
  product.setId(holder.getKey().intValue());
}

Fixed version (ground truth):
public void add(final Product product){
  if (product == null) {
    return;
  }
  product.setKey(UUID.randomUUID().toString().replace("String_Node_Str","String_Node_Str"));
  product.setSecret(UUID.randomUUID().toString().replace("String_Node_Str","String_Node_Str"));
  final String sql="String_Node_Str";
  KeyHolder holder=new GeneratedKeyHolder();
  this.mainJdbc.update(new PreparedStatementCreator(){
    @Override public PreparedStatement createPreparedStatement(    Connection connection) throws SQLException {
      PreparedStatement ps=connection.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);
      ps.setObject(1,product.getTitle());
      ps.setObject(2,product.getKey());
      ps.setObject(3,product.getSecret());
      ps.setObject(4,product.getClientTypeid());
      ps.setObject(5,product.getCertPath());
      ps.setObject(6,product.getDevCertPath());
      return ps;
    }
  }
,holder);
  product.setId(holder.getKey().intValue());
}
Program: 12487
Project: 12487
Buggy source:
@Override public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
  PreparedStatement ps=connection.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);
  ps.setObject(0,product.getTitle());
  ps.setObject(1,product.getKey());
  ps.setObject(2,product.getSecret());
  ps.setObject(3,product.getClientTypeid());
  ps.setObject(4,product.getCertPath());
  ps.setObject(5,product.getDevCertPath());
  return ps;
}

Fixed version (ground truth):
@Override public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
  PreparedStatement ps=connection.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);
  ps.setObject(1,product.getTitle());
  ps.setObject(2,product.getKey());
  ps.setObject(3,product.getSecret());
  ps.setObject(4,product.getClientTypeid());
  ps.setObject(5,product.getCertPath());
  ps.setObject(6,product.getDevCertPath());
  return ps;
}
Program: 12488
Project: 12488
Buggy source:
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  System.out.println("String_Node_Str" + ctx.channel());
  printMsg(msg);
  ctx.fireChannelRead(msg);
}

Fixed version (ground truth):
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  String jsonString=new String((byte[])msg);
  System.out.println("String_Node_Str" + ctx.channel() + "String_Node_Str"+ jsonString);
  ctx.fireChannelRead(msg);
}
Program: 12489
Project: 12489
Buggy source:
@Override public void initChannel(SocketChannel ch) throws Exception {
  ch.pipeline().addLast(new ClientConnectHandler());
}

Fixed version (ground truth):
@Override public void initChannel(SocketChannel ch) throws Exception {
  ChannelPipeline pipeline=ch.pipeline();
  pipeline.addLast("String_Node_Str",new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE,0,4,0,4));
  pipeline.addLast("String_Node_Str",new ByteArrayDecoder());
  pipeline.addLast("String_Node_Str",new LengthFieldPrepender(4,false));
  pipeline.addLast("String_Node_Str",new ByteArrayEncoder());
  pipeline.addLast("String_Node_Str",new ClientConnectHandler());
}
Program: 12490
Project: 12490
Buggy source:
private static void connect(){
  final int port=Integer.parseInt(props.getProperty("String_Node_Str","String_Node_Str"));
  final int pool=Integer.parseInt(props.getProperty("String_Node_Str","String_Node_Str"));
  final String host=props.getProperty("String_Node_Str","String_Node_Str");
  logger.info("String_Node_Str" + host + "String_Node_Str"+ port);
  workerGroup=new NioEventLoopGroup(pool);
  try {
    b.group(workerGroup);
    b.channel(NioSocketChannel.class);
    b.option(ChannelOption.SO_KEEPALIVE,true);
    b.option(ChannelOption.TCP_NODELAY,true);
    b.handler(new ChannelInitializer<SocketChannel>(){
      @Override public void initChannel(      SocketChannel ch) throws Exception {
        ch.pipeline().addLast(new ClientConnectHandler());
      }
    }
);
    final List<ChannelFuture> fs=new ArrayList<ChannelFuture>();
    for (int i=0; i < pool; i++) {
      ChannelFuture f=b.connect(host,port);
      if (f.cause() != null) {
        f.cause().printStackTrace();
        continue;
      }
      fs.add(f);
    }
    for (    ChannelFuture f : fs) {
      if (!f.isDone()) {
        f.get();
      }
    }
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    workerGroup.shutdownGracefully();
  }
}

Fixed version (ground truth):
private static void connect(){
  final int port=Integer.parseInt(props.getProperty("String_Node_Str","String_Node_Str"));
  final int pool=Integer.parseInt(props.getProperty("String_Node_Str","String_Node_Str"));
  final String host=props.getProperty("String_Node_Str","String_Node_Str");
  logger.info("String_Node_Str" + host + "String_Node_Str"+ port);
  workerGroup=new NioEventLoopGroup(pool);
  try {
    b.group(workerGroup);
    b.channel(NioSocketChannel.class);
    b.option(ChannelOption.SO_KEEPALIVE,true);
    b.option(ChannelOption.TCP_NODELAY,true);
    b.handler(new ChannelInitializer<SocketChannel>(){
      @Override public void initChannel(      SocketChannel ch) throws Exception {
        ChannelPipeline pipeline=ch.pipeline();
        pipeline.addLast("String_Node_Str",new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE,0,4,0,4));
        pipeline.addLast("String_Node_Str",new ByteArrayDecoder());
        pipeline.addLast("String_Node_Str",new LengthFieldPrepender(4,false));
        pipeline.addLast("String_Node_Str",new ByteArrayEncoder());
        pipeline.addLast("String_Node_Str",new ClientConnectHandler());
      }
    }
);
    final List<ChannelFuture> fs=new ArrayList<ChannelFuture>();
    for (int i=0; i < pool; i++) {
      ChannelFuture f=b.connect(host,port);
      if (f.cause() != null) {
        f.cause().printStackTrace();
        continue;
      }
      fs.add(f);
    }
    for (    ChannelFuture f : fs) {
      if (!f.isDone()) {
        f.get();
      }
    }
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
    workerGroup.shutdownGracefully();
  }
}
Program: 12491
Project: 12491
Buggy source:
public void start(){
  Thread thread=new Thread(new Runnable(){
    @Override public void run(){
      connect();
    }
  }
);
  thread.start();
  Thread pingThread=new Thread(new Runnable(){
    @Override public void run(){
      while (true) {
        try {
          ping();
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
        try {
          Thread.sleep(10 * 1000);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
);
  pingThread.start();
  try {
    Thread.sleep(10 * 1000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void start(){
  Thread thread=new Thread(new Runnable(){
    @Override public void run(){
      connect();
    }
  }
);
  thread.start();
  Thread pingThread=new Thread(new Runnable(){
    @Override public void run(){
      while (true) {
        try {
          ping();
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
        try {
          Thread.sleep(10 * 1000);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
  }
);
  pingThread.start();
}
Program: 12492
Project: 12492
Buggy source:
@Override public void initChannel(SocketChannel ch) throws Exception {
  ch.pipeline().addLast(new MobileAppClientHandler());
}

Fixed version (ground truth):
@Override public void initChannel(SocketChannel ch) throws Exception {
  ChannelPipeline pipeline=ch.pipeline();
  pipeline.addLast("String_Node_Str",new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE,0,4,0,4));
  pipeline.addLast("String_Node_Str",new ByteArrayDecoder());
  pipeline.addLast("String_Node_Str",new LengthFieldPrepender(4,false));
  pipeline.addLast("String_Node_Str",new ByteArrayEncoder());
  pipeline.addLast("String_Node_Str",new MobileAppClientHandler());
}
Program: 12493
Project: 12493
Buggy source:
protected void printMsg(ChannelHandlerContext ctx,Object msg){
  ByteBuf b=(ByteBuf)msg;
  byte[] dd=new byte[b.readableBytes()];
  b.readBytes(dd);
  try {
    APNSMessage event=MessageUtils.asT(APNSMessage.class,dd);
    if (event != null && event.aps != null) {
      System.out.println("String_Node_Str" + ctx.channel() + "String_Node_Str"+ event);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
protected void printMsg(ChannelHandlerContext ctx,Object msg){
  byte[] dd=(byte[])msg;
  System.out.println("String_Node_Str" + dd.length);
  try {
    APNSMessage event=MessageUtils.asT(APNSMessage.class,dd);
    if (event != null && event.aps != null) {
      System.out.println("String_Node_Str" + dd.length + "String_Node_Str"+ event);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 12494
Project: 12494
Buggy source:
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  System.out.println("String_Node_Str" + ctx.channel());
  printMsg(ctx,msg);
  ctx.fireChannelRead(msg);
}

Fixed version (ground truth):
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  System.out.println("String_Node_Str" + ctx.channel());
  printMsg(ctx,msg);
  ReferenceCountUtil.release(msg);
}
Program: 12495
Project: 12495
Buggy source:
private void connect(){
  final int port=8080;
  final int pool=2;
  final String host="String_Node_Str";
  workerGroup=new NioEventLoopGroup(pool);
  try {
    b.group(workerGroup);
    b.channel(NioSocketChannel.class);
    b.option(ChannelOption.SO_KEEPALIVE,true);
    b.option(ChannelOption.TCP_NODELAY,true);
    b.handler(new ChannelInitializer<SocketChannel>(){
      @Override public void initChannel(      SocketChannel ch) throws Exception {
        ch.pipeline().addLast(new MobileAppClientHandler());
      }
    }
);
    final List<ChannelFuture> fs=new ArrayList<ChannelFuture>();
    for (int i=0; i < pool; i++) {
      ChannelFuture f=b.connect(host,port);
      if (f.cause() != null) {
        f.cause().printStackTrace();
        continue;
      }
      fs.add(f);
    }
    for (    ChannelFuture f : fs) {
      if (!f.isDone()) {
        f.get();
      }
    }
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
    workerGroup.shutdownGracefully();
  }
}

Fixed version (ground truth):
private void connect(){
  final int port=8080;
  final int pool=2;
  final String host="String_Node_Str";
  workerGroup=new NioEventLoopGroup(pool);
  try {
    b.group(workerGroup);
    b.channel(NioSocketChannel.class);
    b.option(ChannelOption.SO_KEEPALIVE,true);
    b.option(ChannelOption.TCP_NODELAY,true);
    b.handler(new ChannelInitializer<SocketChannel>(){
      @Override public void initChannel(      SocketChannel ch) throws Exception {
        ChannelPipeline pipeline=ch.pipeline();
        pipeline.addLast("String_Node_Str",new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE,0,4,0,4));
        pipeline.addLast("String_Node_Str",new ByteArrayDecoder());
        pipeline.addLast("String_Node_Str",new LengthFieldPrepender(4,false));
        pipeline.addLast("String_Node_Str",new ByteArrayEncoder());
        pipeline.addLast("String_Node_Str",new MobileAppClientHandler());
      }
    }
);
    final List<ChannelFuture> fs=new ArrayList<ChannelFuture>();
    for (int i=0; i < pool; i++) {
      ChannelFuture f=b.connect(host,port);
      if (f.cause() != null) {
        f.cause().printStackTrace();
        continue;
      }
      fs.add(f);
    }
    for (    ChannelFuture f : fs) {
      if (!f.isDone()) {
        f.get();
      }
    }
    System.out.println("String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
    workerGroup.shutdownGracefully();
  }
}
Program: 12496
Project: 12496
Buggy source:
/** 
 * 启动推送服务 8080端口
 */
public static void start(Properties prop){
  String actSize=prop.getProperty("String_Node_Str","String_Node_Str");
  String workerSize=prop.getProperty("String_Node_Str","String_Node_Str");
  port=Integer.parseInt(prop.getProperty("String_Node_Str","String_Node_Str"));
  EventLoopGroup parentGroup=new NioEventLoopGroup(Integer.parseInt(actSize));
  EventLoopGroup childGroup=new NioEventLoopGroup(Integer.parseInt(workerSize));
  try {
    ServerBootstrap serverBootstrap=new ServerBootstrap();
    serverBootstrap.group(parentGroup,childGroup).channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>(){
      @Override public void initChannel(      SocketChannel ch) throws Exception {
        ch.pipeline().addLast(new MobileMessageHandler());
      }
    }
);
    serverBootstrap.option(ChannelOption.SO_KEEPALIVE,true);
    serverBootstrap.option(ChannelOption.TCP_NODELAY,true);
    serverBootstrap.option(ChannelOption.SO_REUSEADDR,true);
    System.out.println("String_Node_Str" + port + "String_Node_Str");
    ChannelFuture f=serverBootstrap.bind(port).sync();
    f.channel().closeFuture().sync();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    childGroup.shutdownGracefully();
    parentGroup.shutdownGracefully();
  }
}

Fixed version (ground truth):
/** 
 * 启动推送服务 8080端口
 */
public static void start(Properties prop){
  String actSize=prop.getProperty("String_Node_Str","String_Node_Str");
  String workerSize=prop.getProperty("String_Node_Str","String_Node_Str");
  port=Integer.parseInt(prop.getProperty("String_Node_Str","String_Node_Str"));
  EventLoopGroup parentGroup=new NioEventLoopGroup(Integer.parseInt(actSize));
  EventLoopGroup childGroup=new NioEventLoopGroup(Integer.parseInt(workerSize));
  try {
    ServerBootstrap serverBootstrap=new ServerBootstrap();
    serverBootstrap.group(parentGroup,childGroup).channel(NioServerSocketChannel.class).childHandler(new ChannelInitializer<SocketChannel>(){
      @Override public void initChannel(      SocketChannel ch) throws Exception {
        ChannelPipeline pipeline=ch.pipeline();
        pipeline.addLast("String_Node_Str",new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE,0,4,0,4));
        pipeline.addLast("String_Node_Str",new ByteArrayDecoder());
        pipeline.addLast("String_Node_Str",new LengthFieldPrepender(4,false));
        pipeline.addLast("String_Node_Str",new ByteArrayEncoder());
        pipeline.addLast("String_Node_Str",new MobileMessageHandler());
      }
    }
);
    serverBootstrap.option(ChannelOption.SO_KEEPALIVE,true);
    serverBootstrap.option(ChannelOption.TCP_NODELAY,true);
    serverBootstrap.option(ChannelOption.SO_REUSEADDR,true);
    System.out.println("String_Node_Str" + port + "String_Node_Str");
    ChannelFuture f=serverBootstrap.bind(port).sync();
    f.channel().closeFuture().sync();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    childGroup.shutdownGracefully();
    parentGroup.shutdownGracefully();
  }
}
Program: 12497
Project: 12497
Buggy source:
@Override public void initChannel(SocketChannel ch) throws Exception {
  ch.pipeline().addLast(new MobileMessageHandler());
}

Fixed version (ground truth):
@Override public void initChannel(SocketChannel ch) throws Exception {
  ChannelPipeline pipeline=ch.pipeline();
  pipeline.addLast("String_Node_Str",new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE,0,4,0,4));
  pipeline.addLast("String_Node_Str",new ByteArrayDecoder());
  pipeline.addLast("String_Node_Str",new LengthFieldPrepender(4,false));
  pipeline.addLast("String_Node_Str",new ByteArrayEncoder());
  pipeline.addLast("String_Node_Str",new MobileMessageHandler());
}
Program: 12498
Project: 12498
Buggy source:
@Override public Integer call() throws Exception {
  if (message == null) {
    return 0;
  }
  if (message.getClients() == null || message.getClients().size() == 0) {
    List<Client> clients=ClientService.instance.findOfflineByType(this.product.getId(),ClientType.iOS,this.start,this.limit);
    SentProgress progress=new SentProgress(clients.size());
    for (    Client c : clients) {
      APNSKeeper.push(progress,this.product,c,message);
    }
    progress.getCountDownLatch().wait();
    int total=progress.getSuccess().get();
    try {
      PayloadService.instance.updateSendStatus(message,total);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (total > 0) {
      MetricBuilder.pushMeter.mark(total);
      MetricBuilder.boradcastMeter.mark(total);
    }
    logger.info("String_Node_Str" + total);
    return total;
  }
  return 0;
}

Fixed version (ground truth):
@Override public Integer call() throws Exception {
  if (message == null) {
    return 0;
  }
  if (message.getClients() == null || message.getClients().size() == 0) {
    List<Client> clients=ClientService.instance.findOfflineByType(this.product.getId(),ClientType.iOS,this.start,this.limit);
    SentProgress progress=new SentProgress(clients.size());
    for (    Client c : clients) {
      APNSKeeper.push(progress,this.product,c,message);
    }
    try {
      progress.getCountDownLatch().await();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    int total=progress.getSuccess().get();
    try {
      PayloadService.instance.updateSendStatus(message,total);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (total > 0) {
      MetricBuilder.pushMeter.mark(total);
      MetricBuilder.boradcastMeter.mark(total);
    }
    logger.info("String_Node_Str" + total);
    return total;
  }
  return 0;
}
Program: 12499
Project: 12499
Buggy source:
@Override public Integer call() throws Exception {
  if (message == null) {
    return 0;
  }
  if (message.getClients() == null || message.getClients().size() == 0) {
    Collection<Integer> cids=ClientKeeper.gets(product.getAppKey());
    int s=start * limit;
    if (cids.size() < limit) {
      limit=cids.size();
    }
    Integer[] temp=cids.toArray(new Integer[0]);
    SentProgress progress=new SentProgress(limit);
    for (int i=0; i < limit; i++) {
      int cid=temp[s + i];
      Connection c=ConnectionKeeper.get(cid);
      if (c != null) {
        c.send(progress,message);
      }
 else {
        progress.incrFailed();
      }
    }
    progress.getCountDownLatch().wait();
    int t0=progress.getSuccess().get();
    try {
      PayloadService.instance.updateSendStatus(message,t0);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (t0 > 0) {
      MetricBuilder.pushMeter.mark(t0);
      MetricBuilder.boradcastMeter.mark(t0);
    }
    return t0;
  }
  return 0;
}

Fixed version (ground truth):
@Override public Integer call() throws Exception {
  if (message == null) {
    return 0;
  }
  if (message.getClients() == null || message.getClients().size() == 0) {
    Collection<Integer> cids=ClientKeeper.gets(product.getAppKey());
    int s=start * limit;
    if (cids.size() < limit) {
      limit=cids.size();
    }
    Integer[] temp=cids.toArray(new Integer[0]);
    SentProgress progress=new SentProgress(limit);
    for (int i=0; i < limit; i++) {
      int cid=temp[s + i];
      Connection c=ConnectionKeeper.get(cid);
      if (c != null) {
        c.send(progress,message);
      }
 else {
        progress.incrFailed();
      }
    }
    try {
      progress.getCountDownLatch().await();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    int t0=progress.getSuccess().get();
    try {
      PayloadService.instance.updateSendStatus(message,t0);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (t0 > 0) {
      MetricBuilder.pushMeter.mark(t0);
      MetricBuilder.boradcastMeter.mark(t0);
    }
    return t0;
  }
  return 0;
}
Program: 12500
Project: 12500
Buggy source:
@Override public Integer call() throws Exception {
  Payload message=PayloadService.instance.findLatest(product.getId(),userId);
  if (message == null) {
    return 0;
  }
  if (message.getClients() != null) {
    SentProgress progress=new SentProgress(message.getClients().size());
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getAppKey(),client);
      if (c != null) {
        c.send(progress,message);
      }
 else {
        progress.incrFailed();
      }
    }
    try {
      progress.getCountDownLatch().wait();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    int total=progress.getSuccess().get();
    try {
      PayloadService.instance.updateSendStatus(message,total);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return total;
  }
  return 0;
}

Fixed version (ground truth):
@Override public Integer call() throws Exception {
  Payload message=PayloadService.instance.findLatest(product.getId(),userId);
  if (message == null) {
    return 0;
  }
  if (message.getClients() != null) {
    SentProgress progress=new SentProgress(message.getClients().size());
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getAppKey(),client);
      if (c != null) {
        c.send(progress,message);
      }
 else {
        progress.incrFailed();
      }
    }
    try {
      progress.getCountDownLatch().await();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    int total=progress.getSuccess().get();
    try {
      PayloadService.instance.updateSendStatus(message,total);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return total;
  }
  return 0;
}
Program: 12501
Project: 12501
Buggy source:
@Override public Integer call() throws Exception {
  if (message == null) {
    return 0;
  }
  if (message.getClients() != null) {
    SentProgress progress=new SentProgress(message.getClients().size());
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getAppKey(),client);
      if (c != null) {
        c.send(progress,message);
      }
 else {
        if (product.getClientTypeid().intValue() != ClientType.iOS) {
          continue;
        }
        Client cc=ClientService.instance.findByUserId(client);
        if (cc == null) {
          logger.warn("String_Node_Str" + client);
          continue;
        }
        if (!cc.isDevice(ClientType.iOS)) {
          continue;
        }
        if (StringUtils.isBlank(cc.getDeviceToken())) {
          logger.error("String_Node_Str" + client);
          continue;
        }
        APNSKeeper.push(progress,this.product,cc,message);
      }
    }
    try {
      progress.getCountDownLatch().wait();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    int total=progress.getSuccess().get();
    if (total > 0) {
      MetricBuilder.pushMeter.mark(total);
      MetricBuilder.pushSingleMeter.mark(total);
    }
    try {
      PayloadService.instance.updateSendStatus(message,total);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return total;
  }
  return 0;
}

Fixed version (ground truth):
@Override public Integer call() throws Exception {
  if (message == null) {
    return 0;
  }
  if (message.getClients() != null) {
    SentProgress progress=new SentProgress(message.getClients().size());
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getAppKey(),client);
      if (c != null) {
        c.send(progress,message);
      }
 else {
        if (product.getClientTypeid().intValue() != ClientType.iOS) {
          continue;
        }
        Client cc=ClientService.instance.findByUserId(client);
        if (cc == null) {
          logger.warn("String_Node_Str" + client);
          continue;
        }
        if (!cc.isDevice(ClientType.iOS)) {
          continue;
        }
        if (StringUtils.isBlank(cc.getDeviceToken())) {
          logger.error("String_Node_Str" + client);
          continue;
        }
        APNSKeeper.push(progress,this.product,cc,message);
      }
    }
    try {
      progress.getCountDownLatch().await();
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    int total=progress.getSuccess().get();
    if (total > 0) {
      MetricBuilder.pushMeter.mark(total);
      MetricBuilder.pushSingleMeter.mark(total);
    }
    try {
      PayloadService.instance.updateSendStatus(message,total);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    return total;
  }
  return 0;
}
Program: 12502
Project: 12502
Buggy source:
@Override public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
  logger.info("String_Node_Str" + ctx.channel().hashCode());
}

Fixed version (ground truth):
@Override public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
  logger.info("String_Node_Str" + ctx.channel().hashCode());
  ctx.flush();
}
Program: 12503
Project: 12503
Buggy source:
/** 
 * 读取新消息 LengthFieldBasedFrameDecoder 自动解包
 */
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  logger.info("String_Node_Str" + ctx.channel().hashCode());
  MetricBuilder.requestMeter.mark();
  ByteBuf b=(ByteBuf)msg;
  byte[] dd=new byte[b.readableBytes()];
  b.readBytes(dd);
  ctx.fireChannelRead(msg);
  final APNSEvent cc;
  try {
    cc=MessageUtils.asT(APNSEvent.class,dd);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
    ack(ctx,null);
    return;
  }
  if (cc.typeId.intValue() == ClientType.Android) {
    MetricBuilder.clientAndroidMeter.mark();
  }
 else   if (cc.typeId.intValue() == ClientType.iOS) {
    MetricBuilder.clientIOSMeter.mark();
  }
  if (cc.op.intValue() == Commands.GO_ONLINE) {
    ConnectionKeeper.add(cc.appKey,cc.userId,new Connection(ctx.channel()));
    poolTaskExecutor.submit(new OnNewlyAddThread(cc));
    ack(ctx,cc);
  }
 else   if (cc.op.intValue() == Commands.KEEP_ALIVE) {
    ack(ctx,cc);
  }
 else   if (cc.op.intValue() == Commands.PUSH_ACK) {
    ack(ctx,cc);
  }
 else   if (cc.op.intValue() == Commands.GO_OFFLINE) {
    poolTaskExecutor.submit(new Runnable(){
      @Override public void run(){
        Client c0=ClientService.instance.findByUserId(cc.userId);
        if (c0 != null) {
          ClientService.instance.updateOnlineTs(c0.getId());
        }
      }
    }
);
    ctx.close();
  }
}

Fixed version (ground truth):
/** 
 * 读取新消息 LengthFieldBasedFrameDecoder 自动解包
 */
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  logger.info("String_Node_Str" + ctx.channel().hashCode());
  MetricBuilder.requestMeter.mark();
  final APNSEvent cc;
  try {
    cc=MessageUtils.asT(APNSEvent.class,(byte[])msg);
  }
 catch (  IOException e) {
    logger.error("String_Node_Str",e);
    ack(ctx,null);
    return;
  }
  ReferenceCountUtil.release(msg);
  if (cc.typeId.intValue() == ClientType.Android) {
    MetricBuilder.clientAndroidMeter.mark();
  }
 else   if (cc.typeId.intValue() == ClientType.iOS) {
    MetricBuilder.clientIOSMeter.mark();
  }
  if (cc.op.intValue() == Commands.GO_ONLINE) {
    ConnectionKeeper.add(cc.appKey,cc.userId,new Connection(ctx.channel()));
    poolTaskExecutor.submit(new OnNewlyAddThread(cc));
    ack(ctx,cc);
  }
 else   if (cc.op.intValue() == Commands.KEEP_ALIVE) {
    ack(ctx,cc);
  }
 else   if (cc.op.intValue() == Commands.PUSH_ACK) {
    ack(ctx,cc);
  }
 else   if (cc.op.intValue() == Commands.GO_OFFLINE) {
    poolTaskExecutor.submit(new Runnable(){
      @Override public void run(){
        Client c0=ClientService.instance.findByUserId(cc.userId);
        if (c0 != null) {
          ClientService.instance.updateOnlineTs(c0.getId());
        }
      }
    }
);
    ctx.close();
  }
}
Program: 12505
Project: 12505
Buggy source:
@Override public void initChannel(SocketChannel ch) throws Exception {
  ch.pipeline().addLast(new PublisherConnHandler());
}

Fixed version (ground truth):
@Override public void initChannel(SocketChannel ch) throws Exception {
  ChannelPipeline pipeline=ch.pipeline();
  pipeline.addLast("String_Node_Str",new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE,0,4,0,4));
  pipeline.addLast("String_Node_Str",new ByteArrayDecoder());
  pipeline.addLast("String_Node_Str",new LengthFieldPrepender(4,false));
  pipeline.addLast("String_Node_Str",new ByteArrayEncoder());
  pipeline.addLast("String_Node_Str",new PublisherConnHandler());
}
Program: 12506
Project: 12506
Buggy source:
/** 
 * 读取新消息
 */
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  logger.info("String_Node_Str" + ctx.channel().hashCode());
  MetricBuilder.recvMeter.mark();
  ByteBuf b=(ByteBuf)msg;
  byte[] dd=new byte[b.readableBytes()];
  b.readBytes(dd);
  try {
    PayloadMessage message=MessageUtils.asT(PayloadMessage.class,dd);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",message);
    }
    DisruptorContext.producer.push(message);
    ack(ctx,"String_Node_Str");
  }
 catch (  IOException e) {
    logger.error(e.getMessage(),e);
    ack(ctx,"String_Node_Str");
  }
 finally {
    ctx.fireChannelRead(msg);
  }
}

Fixed version (ground truth):
/** 
 * 读取新消息
 */
@Override public void channelRead(ChannelHandlerContext ctx,Object msg){
  logger.info("String_Node_Str" + ctx.channel().hashCode());
  MetricBuilder.recvMeter.mark();
  byte[] dd=(byte[])msg;
  try {
    PayloadMessage message=MessageUtils.asT(PayloadMessage.class,dd);
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",message);
    }
    DisruptorContext.producer.push(message);
    ack(ctx,"String_Node_Str");
  }
 catch (  IOException e) {
    logger.error(e.getMessage(),e);
    ack(ctx,"String_Node_Str");
  }
 finally {
    ctx.fireChannelRead(msg);
  }
}
Program: 12507
Project: 12507
Buggy source:
@Override public void run(){
  logger.info("String_Node_Str" + this.product);
  int min=Integer.parseInt(this.conf.getProperty(DISPATCHER_INTERVAL,"String_Node_Str"));
  while (!this.stopping) {
    doSinglePush();
    doBroadcastPush();
    try {
      Thread.sleep(min * 1000);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  logger.info("String_Node_Str" + this.product);
}

Fixed version (ground truth):
@Override public void run(){
  logger.info("String_Node_Str" + this.product);
  int min=Integer.parseInt(this.conf.getProperty(DISPATCHER_INTERVAL,"String_Node_Str"));
  while (!this.stopping) {
    int total=ClientKeeper.count(product.getKey());
    if (total > 0) {
      doSinglePush();
      doBroadcastPush();
    }
    try {
      Thread.sleep(min * 1000);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  logger.info("String_Node_Str" + this.product);
}
Program: 12508
Project: 12508
Buggy source:
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.get(this.messageId);
  if (message == null) {
    return true;
  }
  if (message.getClients() == null || message.getClients().size() == 0) {
    List<Client> clients=ClientService.instance.findOfflineByType(this.product.getId(),ClientType.iOS,this.start,this.limit);
    for (    Client c : clients) {
      this.pushToApple(c,message);
    }
    try {
      PayloadService.instance.addHisotry(message,null,clients.size(),true);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (clients.size() > 0) {
      MetricBuilder.pushMeter.mark(clients.size());
      MetricBuilder.boradcastMeter.mark(clients.size());
    }
    logger.info("String_Node_Str" + clients.size());
  }
  return true;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.get(this.messageId);
  if (message == null) {
    return true;
  }
  if (message.getClients() == null || message.getClients().size() == 0) {
    List<Client> clients=ClientService.instance.findOfflineByType(this.product.getId(),ClientType.iOS,this.start,this.limit);
    for (    Client c : clients) {
      APNSKeeper.push(this.product,c,message);
    }
    try {
      PayloadService.instance.addHisotry(message,null,clients.size(),true);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    if (clients.size() > 0) {
      MetricBuilder.pushMeter.mark(clients.size());
      MetricBuilder.boradcastMeter.mark(clients.size());
    }
    logger.info("String_Node_Str" + clients.size());
  }
  return true;
}
Program: 12509
Project: 12509
Buggy source:
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.findLatest(product.getId(),userId);
  if (message == null) {
    return true;
  }
  boolean ok=false;
  if (message.getClients() != null) {
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getKey(),client);
      ok=c.send(message);
    }
    try {
      PayloadService.instance.addHisotry(message,null,message.getClients().size(),ok);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return ok;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.findLatest(product.getId(),userId);
  if (message == null) {
    return true;
  }
  boolean ok=false;
  if (message.getClients() != null) {
    int total=0;
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getKey(),client);
      if (c != null) {
        ok=c.send(message);
        total++;
      }
    }
    try {
      PayloadService.instance.addHisotry(message,null,total,ok);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return ok;
}
Program: 12510
Project: 12510
Buggy source:
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.get(this.messageId);
  if (message == null) {
    return true;
  }
  boolean ok=false;
  if (message.getClients() != null) {
    int total=0;
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getKey(),client);
      if (c != null) {
        ok=c.send(message);
        total++;
      }
 else {
        if (product.getClientTypeid().intValue() != ClientType.iOS) {
          continue;
        }
        Client cc=ClientService.instance.findByUserId(client);
        if (cc == null) {
          logger.warn("String_Node_Str" + client);
          continue;
        }
        if (!cc.isDevice(ClientType.iOS)) {
          continue;
        }
        if (StringUtils.isBlank(cc.getDeviceToken())) {
          logger.error("String_Node_Str" + client);
          continue;
        }
        this.pushToApple(cc,message);
        total++;
      }
    }
    if (total > 0) {
      MetricBuilder.pushMeter.mark(total);
      MetricBuilder.pushSingleMeter.mark(total);
    }
    try {
      PayloadService.instance.addHisotry(message,null,total,ok);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return ok;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.get(this.messageId);
  if (message == null) {
    return true;
  }
  boolean ok=false;
  if (message.getClients() != null) {
    int total=0;
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getKey(),client);
      if (c != null) {
        ok=c.send(message);
        total++;
      }
 else {
        if (product.getClientTypeid().intValue() != ClientType.iOS) {
          continue;
        }
        Client cc=ClientService.instance.findByUserId(client);
        if (cc == null) {
          logger.warn("String_Node_Str" + client);
          continue;
        }
        if (!cc.isDevice(ClientType.iOS)) {
          continue;
        }
        if (StringUtils.isBlank(cc.getDeviceToken())) {
          logger.error("String_Node_Str" + client);
          continue;
        }
        APNSKeeper.push(this.product,cc,message);
        total++;
      }
    }
    if (total > 0) {
      MetricBuilder.pushMeter.mark(total);
      MetricBuilder.pushSingleMeter.mark(total);
    }
    try {
      PayloadService.instance.addHisotry(message,null,total,ok);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return ok;
}
Program: 12511
Project: 12511
Buggy source:
/** 
 * 添加连接
 * @param productId:   Product Id
 * @param token
 * @param conn
 */
public static void add(String productId,String token,Connection conn){
  Integer cid=ClientKeeper.get(productId,token);
  if (cid != null) {
    Connection c=pools.get(cid);
    if (c != null) {
      c.close();
      ServerMetrics.decrConnection();
    }
  }
  cid=conn.getChannel().hashCode();
  ClientKeeper.add(productId,token,cid);
  pools.put(cid,conn);
  ServerMetrics.incrConnection();
}

Fixed version (ground truth):
/** 
 * 添加连接
 * @param productId:   Product Id
 * @param token
 * @param conn
 */
public static void add(String productId,String token,Connection conn){
  Integer cid=ClientKeeper.get(productId,token);
  if (cid != null) {
    Connection c=pools.remove(cid);
    if (c != null) {
      c.close();
      ServerMetrics.decrConnection();
    }
  }
  cid=conn.getChannel().hashCode();
  ClientKeeper.add(productId,token,cid);
  pools.put(cid,conn);
  ServerMetrics.incrConnection();
}
Program: 12512
Project: 12512
Buggy source:
/** 
 * 移除所有链接.
 * @param productId
 */
public static void removeAll(String productId){
  int t=0;
  Collection<Integer> cs=ClientKeeper.gets(productId);
  for (  Integer cid : cs) {
    Connection c=pools.get(cid);
    if (c != null) {
      c.close();
      pools.remove(cid);
      t++;
    }
  }
  if (t > 0) {
    ServerMetrics.updateConnection(-1 * t);
    ClientKeeper.unregistry(productId);
  }
}

Fixed version (ground truth):
/** 
 * 移除所有链接.
 * @param productId
 */
public static void removeAll(String productId){
  int t=0;
  Collection<Integer> cs=ClientKeeper.gets(productId);
  for (  Integer cid : cs) {
    Connection c=pools.remove(cid);
    if (c != null) {
      c.close();
      t++;
    }
  }
  if (t > 0) {
    ServerMetrics.updateConnection(-1 * t);
    ClientKeeper.unregistry(productId);
  }
}
Program: 12513
Project: 12513
Buggy source:
public boolean send(byte[] msg){
  final ByteBuf data=channel.config().getAllocator().buffer(msg.length);
  data.writeBytes(msg);
  ChannelFuture cf=channel.writeAndFlush(data);
  if (cf.isDone() && cf.cause() != null) {
    ServerMetrics.incrPushTotal(false);
    logger.error("String_Node_Str",cf.cause());
    return false;
  }
  long total=ServerMetrics.incrPushTotal(true);
  logger.error("String_Node_Str" + total);
  return true;
}

Fixed version (ground truth):
public boolean send(byte[] msg){
  final ByteBuf data=channel.config().getAllocator().buffer(msg.length);
  data.writeBytes(msg);
  ChannelFuture cf=channel.writeAndFlush(data);
  if (cf.isDone() && cf.cause() != null) {
    ServerMetrics.incrPushTotal(false);
    logger.error("String_Node_Str",cf.cause());
    return false;
  }
  ReferenceCountUtil.release(data);
  long total=ServerMetrics.incrPushTotal(true);
  logger.error("String_Node_Str" + total);
  return true;
}
Program: 12514
Project: 12514
Buggy source:
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.get(this.messageId);
  if (message == null) {
    return true;
  }
  if (message.getClients() == null || message.getClients().size() == 0) {
    Collection<Integer> cids=ClientKeeper.gets(product.getKey());
    int s=start * limit;
    if (cids.size() < limit) {
      limit=cids.size();
    }
    Integer[] temp=cids.toArray(new Integer[0]);
    int t0=0;
    for (int i=0; i < limit; i++) {
      int cid=temp[s + i];
      Connection c=ConnectionKeeper.get(cid);
      if (c != null) {
        c.send(message);
        t0++;
      }
    }
    PayloadService.instance.addHisotry(message,null,limit,true);
    MetricBuilder.pushMeter.mark();
    MetricBuilder.boradcastMeter.mark();
  }
  return true;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.get(this.messageId);
  if (message == null) {
    return true;
  }
  if (message.getClients() == null || message.getClients().size() == 0) {
    Collection<Integer> cids=ClientKeeper.gets(product.getKey());
    int s=start * limit;
    if (cids.size() < limit) {
      limit=cids.size();
    }
    Integer[] temp=cids.toArray(new Integer[0]);
    int t0=0;
    for (int i=0; i < limit; i++) {
      int cid=temp[s + i];
      Connection c=ConnectionKeeper.get(cid);
      if (c != null) {
        c.send(message);
        t0++;
      }
    }
    try {
      PayloadService.instance.addHisotry(message,null,limit,true);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    MetricBuilder.pushMeter.mark();
    MetricBuilder.boradcastMeter.mark();
  }
  return true;
}
Program: 12515
Project: 12515
Buggy source:
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.findLatest(product.getId(),userId);
  if (message == null) {
    return true;
  }
  boolean ok=false;
  if (message.getClients() != null) {
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getKey(),client);
      ok=c.send(message);
    }
    PayloadService.instance.addHisotry(message,null,message.getClients().size(),ok);
  }
  return ok;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.findLatest(product.getId(),userId);
  if (message == null) {
    return true;
  }
  boolean ok=false;
  if (message.getClients() != null) {
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getKey(),client);
      ok=c.send(message);
    }
    try {
      PayloadService.instance.addHisotry(message,null,message.getClients().size(),ok);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return ok;
}
Program: 12516
Project: 12516
Buggy source:
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.get(this.messageId);
  if (message == null) {
    return true;
  }
  boolean ok=false;
  if (message.getClients() != null) {
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getKey(),client);
      ok=c.send(message);
      MetricBuilder.pushMeter.mark();
      MetricBuilder.pushSingleMeter.mark();
    }
    PayloadService.instance.addHisotry(message,null,message.getClients().size(),ok);
  }
  return ok;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  Payload message=PayloadService.instance.get(this.messageId);
  if (message == null) {
    return true;
  }
  boolean ok=false;
  if (message.getClients() != null) {
    for (    String client : message.getClients()) {
      Connection c=ConnectionKeeper.get(product.getKey(),client);
      ok=c.send(message);
      MetricBuilder.pushMeter.mark();
      MetricBuilder.pushSingleMeter.mark();
    }
    try {
      PayloadService.instance.addHisotry(message,null,message.getClients().size(),ok);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return ok;
}
Program: 12517
Project: 12517
Buggy source:
@Override public Boolean call() throws Exception {
  Client client=ClientService.instance.findByUserId(cc.getUserId());
  boolean isnew=false;
  if (client == null) {
    client=new Client();
    Product product=ProductService.instance.findByKey(cc.getAppKey());
    client.setProductId(product.getId());
    client.setUserId(cc.getUserId());
    client.setTypeId(cc.getTypeId());
    client.setDeviceToken(cc.getToken());
    ClientService.instance.add(client);
    isnew=true;
  }
  if (!isnew) {
    Dispatcher dispatcher=DispatcherRunner.instance.get(cc.getAppKey());
    if (dispatcher != null) {
      dispatcher.pushOfflinePayload(cc.getUserId());
    }
    ClientService.instance.updateOnlineTs(client.getId());
  }
  return true;
}

Fixed version (ground truth):
@Override public Boolean call() throws Exception {
  Client client=ClientService.instance.findByUserId(cc.getUserId());
  boolean isnew=false;
  if (client == null) {
    client=new Client();
    Product product=ProductService.instance.findByKey(cc.getAppKey());
    client.setProductId(product.getId());
    client.setUserId(cc.getUserId());
    client.setTypeId(cc.getTypeId());
    client.setDeviceToken(cc.getToken());
    try {
      ClientService.instance.add(client);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
    isnew=true;
  }
  if (!isnew) {
    Dispatcher dispatcher=DispatcherRunner.instance.get(cc.getAppKey());
    if (dispatcher != null) {
      dispatcher.pushOfflinePayload(cc.getUserId());
    }
    try {
      ClientService.instance.updateOnlineTs(client.getId());
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return true;
}
Program: 12518
Project: 12518
Buggy source:
public Payload findLatest(int productId,String userId){
  String sql="String_Node_Str";
  List<Long> list=this.mainJdbc.queryForList(sql,Long.class,productId,userId);
  if (list.size() == 0) {
    return null;
  }
  return this.get(list.get(0));
}

Fixed version (ground truth):
public Payload findLatest(int productId,String userId){
  String sql="String_Node_Str";
  List<Long> list=this.mainJdbc.queryForList(sql,Long.class,productId,userId,PayloadStatus.Pending);
  if (list.size() == 0) {
    return null;
  }
  return this.get(list.get(0));
}
Program: 12519
Project: 12519
Buggy source:
public void addHisotry(Payload message,String userId,int counting,boolean ok){
  String sql="String_Node_Str";
  this.mainJdbc.update(sql,message.getId(),message.getTitle(),message.getProductId(),userId,counting,new Date().getTime() / 1000);
  sql="String_Node_Str";
  this.mainJdbc.update(sql,PayloadStatus.Sent,message.getId());
}

Fixed version (ground truth):
public void addHisotry(Payload message,String userId,int counting,boolean ok){
  String sql="String_Node_Str";
  this.mainJdbc.update(sql,message.getId(),message.getTitle(),message.getProductId(),userId,counting,new Date().getTime() / 1000);
  sql="String_Node_Str";
  this.mainJdbc.update(sql,PayloadStatus.Sent,message.getId());
  sql="String_Node_Str";
  this.mainJdbc.update(sql,PayloadStatus.Sent,message.getId());
}
Program: 12520
Project: 12520
Buggy source:
/** 
 * @param aClassLoader The class loader to be used. May be <code>null</code> indicating that the default class loader should be used.
 * @return The resources from which the XSD can be read. Never<code>null</code> nor empty.
 */
@Nonnull @Nonempty @ReturnsMutableCopy default List<IReadableResource> getAllXSDResources(@Nullable final ClassLoader aClassLoader){
  return CollectionHelper.newList(getAllXSDPaths(),s -> new ClassPathResource(s,aClassLoader));
}

Fixed version (ground truth):
/** 
 * @param aClassLoader The class loader to be used. May be <code>null</code> indicating that the default class loader should be used.
 * @return The resources from which the XSD can be read. Never<code>null</code> nor empty.
 */
@Nonnull @Nonempty @ReturnsMutableCopy default List<? extends IReadableResource> getAllXSDResources(@Nullable final ClassLoader aClassLoader){
  return CollectionHelper.newList(getAllXSDPaths(),s -> new ClassPathResource(s,aClassLoader));
}