nus-yam/ex-repair huggingface dataset:
Program: 46450
Project: 46450
Buggy source:
@Override public Xid[] recover(int flag) throws XAException {
  NodeEngine nodeEngine=getNodeEngine();
  XAService xaService=getService();
  OperationService operationService=nodeEngine.getOperationService();
  ClusterService clusterService=nodeEngine.getClusterService();
  Collection<Member> memberList=clusterService.getMembers();
  List<InternalCompletableFuture<SerializableList>> futureList=new ArrayList<InternalCompletableFuture<SerializableList>>();
  for (  Member member : memberList) {
    if (member.localMember()) {
      continue;
    }
    CollectRemoteTransactionsOperation op=new CollectRemoteTransactionsOperation();
    Address address=member.getAddress();
    InternalCompletableFuture<SerializableList> future=operationService.invokeOnTarget(SERVICE_NAME,op,address);
    futureList.add(future);
  }
  HashSet<SerializableXID> xids=new HashSet<SerializableXID>();
  xids.addAll(xaService.getPreparedXids());
  for (  InternalCompletableFuture<SerializableList> future : futureList) {
    SerializableList xidSet=future.getSafely();
    for (    Data xidData : xidSet) {
      SerializableXID xid=nodeEngine.toObject(xidData);
      xids.add(xid);
    }
  }
  return xids.toArray(new SerializableXID[xids.size()]);
}

Fixed version (ground truth):
@Override public Xid[] recover(int flag) throws XAException {
  NodeEngine nodeEngine=getNodeEngine();
  XAService xaService=getService();
  OperationService operationService=nodeEngine.getOperationService();
  ClusterService clusterService=nodeEngine.getClusterService();
  Collection<Member> memberList=clusterService.getMembers();
  List<Future<SerializableList>> futureList=new ArrayList<Future<SerializableList>>();
  for (  Member member : memberList) {
    if (member.localMember()) {
      continue;
    }
    CollectRemoteTransactionsOperation op=new CollectRemoteTransactionsOperation();
    Address address=member.getAddress();
    InternalCompletableFuture<SerializableList> future=operationService.invokeOnTarget(SERVICE_NAME,op,address);
    futureList.add(future);
  }
  HashSet<SerializableXID> xids=new HashSet<SerializableXID>();
  xids.addAll(xaService.getPreparedXids());
  for (  Future<SerializableList> future : futureList) {
    try {
      SerializableList xidSet=future.get();
      for (      Data xidData : xidSet) {
        SerializableXID xid=nodeEngine.toObject(xidData);
        xids.add(xid);
      }
    }
 catch (    InterruptedException e) {
      throw new XAException(XAException.XAER_RMERR);
    }
catch (    MemberLeftException e) {
      logger.warning("String_Node_Str",e);
    }
catch (    ExecutionException e) {
      Throwable cause=e.getCause();
      if (cause instanceof HazelcastInstanceNotActiveException || cause instanceof TargetNotMemberException) {
        logger.warning("String_Node_Str",e);
      }
 else {
        throw new XAException(XAException.XAER_RMERR);
      }
    }
  }
  return xids.toArray(new SerializableXID[xids.size()]);
}
Program: 46451
Project: 46451
Buggy source:
public XAResourceImpl(NodeEngine nodeEngine,XAService service){
  super(nodeEngine,service);
  GroupConfig groupConfig=nodeEngine.getConfig().getGroupConfig();
  groupName=groupConfig.getName();
}

Fixed version (ground truth):
public XAResourceImpl(NodeEngine nodeEngine,XAService service){
  super(nodeEngine,service);
  GroupConfig groupConfig=nodeEngine.getConfig().getGroupConfig();
  groupName=groupConfig.getName();
  logger=nodeEngine.getLogger(getClass());
}
Program: 46452
Project: 46452
Buggy source:
@Override public void end(Xid xid,int flags) throws XAException {
  long threadId=currentThreadId();
  TransactionContext threadContext=threadContextMap.remove(threadId);
  if (threadContext == null && LOGGER.isFinestEnabled()) {
    LOGGER.finest("String_Node_Str" + threadId);
  }
  List<TransactionContext> contexts=xidContextMap.get(xid);
  if (contexts == null && LOGGER.isFinestEnabled()) {
    LOGGER.finest("String_Node_Str" + xid);
  }
}

Fixed version (ground truth):
@Override public void end(Xid xid,int flags) throws XAException {
  long threadId=currentThreadId();
  TransactionContext threadContext=threadContextMap.remove(threadId);
  if (threadContext == null && logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + threadId);
  }
  List<TransactionContext> contexts=xidContextMap.get(xid);
  if (contexts == null && logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + xid);
  }
}
Program: 46453
Project: 46453
Buggy source:
/** 
 * Validates index attribute content
 * @param attribute attribute to validate
 * @return the attribute for fluent assignment
 */
public static String validateIndexAttribute(String attribute){
  checkHasText(attribute,"String_Node_Str");
  String keyPrefix=KEY_ATTRIBUTE_NAME.value();
  if (attribute.startsWith(keyPrefix) & attribute.length() > keyPrefix.length()) {
    if (attribute.charAt(keyPrefix.length()) != '#') {
      LOG.warning(KEY_ATTRIBUTE_NAME.value() + "String_Node_Str" + attribute+ "String_Node_Str");
    }
  }
  return attribute;
}

Fixed version (ground truth):
/** 
 * Validates index attribute content
 * @param attribute attribute to validate
 * @return the attribute for fluent assignment
 */
public static String validateIndexAttribute(String attribute){
  checkHasText(attribute,"String_Node_Str");
  String keyPrefix=KEY_ATTRIBUTE_NAME.value();
  if (attribute.startsWith(keyPrefix) && attribute.length() > keyPrefix.length()) {
    if (attribute.charAt(keyPrefix.length()) != '#') {
      LOG.warning(KEY_ATTRIBUTE_NAME.value() + "String_Node_Str" + attribute+ "String_Node_Str");
    }
  }
  return attribute;
}
Program: 46454
Project: 46454
Buggy source:
private void replicateTxnLog() throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException {
  if (skipBackupLogReplication()) {
    return;
  }
  OperationService operationService=nodeEngine.getOperationService();
  ClusterService clusterService=nodeEngine.getClusterService();
  List<Future> futures=new ArrayList<Future>(backupAddresses.length);
  for (  Address backupAddress : backupAddresses) {
    if (clusterService.getMember(backupAddress) != null) {
      Operation op=createReplicateTxBackupLogOperation();
      Future f=operationService.invokeOnTarget(SERVICE_NAME,op,backupAddress);
      futures.add(f);
    }
  }
  waitWithDeadline(futures,timeoutMillis,MILLISECONDS,RETHROW_TRANSACTION_EXCEPTION);
}

Fixed version (ground truth):
private void replicateTxnLog() throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException {
  if (skipBackupLogReplication()) {
    return;
  }
  OperationService operationService=nodeEngine.getOperationService();
  ClusterService clusterService=nodeEngine.getClusterService();
  List<Future> futures=new ArrayList<Future>(backupAddresses.length);
  for (  Address backupAddress : backupAddresses) {
    if (clusterService.getMember(backupAddress) != null) {
      Operation op=createReplicateTxBackupLogOperation();
      Future f=operationService.invokeOnTarget(SERVICE_NAME,op,backupAddress);
      futures.add(f);
    }
  }
  waitWithDeadline(futures,timeoutMillis,MILLISECONDS,replicationTxExceptionHandler);
}
Program: 46455
Project: 46455
Buggy source:
private void forceCreateBackupLogs(){
  backupLogsCreated=true;
  OperationService operationService=nodeEngine.getOperationService();
  List<Future> futures=new ArrayList<Future>(backupAddresses.length);
  for (  Address backupAddress : backupAddresses) {
    if (nodeEngine.getClusterService().getMember(backupAddress) != null) {
      final CreateTxBackupLogOperation op=createCreateTxBackupLogOperation();
      Future f=operationService.invokeOnTarget(SERVICE_NAME,op,backupAddress);
      futures.add(f);
    }
  }
  for (  Future future : futures) {
    try {
      future.get(timeoutMillis,MILLISECONDS);
    }
 catch (    MemberLeftException e) {
      nodeEngine.getLogger(Transaction.class).warning("String_Node_Str" + e);
    }
catch (    Throwable e) {
      if (e instanceof ExecutionException) {
        e=e.getCause() != null ? e.getCause() : e;
      }
      if (e instanceof TargetNotMemberException) {
        nodeEngine.getLogger(Transaction.class).warning("String_Node_Str" + e);
      }
 else {
        RETHROW_TRANSACTION_EXCEPTION.handleException(e);
      }
    }
  }
}

Fixed version (ground truth):
private void forceCreateBackupLogs(){
  backupLogsCreated=true;
  OperationService operationService=nodeEngine.getOperationService();
  List<Future> futures=new ArrayList<Future>(backupAddresses.length);
  for (  Address backupAddress : backupAddresses) {
    if (nodeEngine.getClusterService().getMember(backupAddress) != null) {
      final CreateTxBackupLogOperation op=createCreateTxBackupLogOperation();
      Future f=operationService.invokeOnTarget(SERVICE_NAME,op,backupAddress);
      futures.add(f);
    }
  }
  waitWithDeadline(futures,timeoutMillis,MILLISECONDS,replicationTxExceptionHandler);
}
Program: 46456
Project: 46456
Buggy source:
TransactionImpl(TransactionManagerServiceImpl transactionManagerService,NodeEngine nodeEngine,String txnId,List<TransactionLogRecord> transactionLog,long timeoutMillis,long startTime,String txOwnerUuid){
  this.transactionLog=new TransactionLog(transactionLog);
  this.transactionManagerService=transactionManagerService;
  this.nodeEngine=nodeEngine;
  this.txnId=txnId;
  this.timeoutMillis=timeoutMillis;
  this.startTime=startTime;
  this.durability=0;
  this.transactionType=TWO_PHASE;
  this.state=PREPARED;
  this.txOwnerUuid=txOwnerUuid;
  this.checkThreadAccess=false;
  this.logger=nodeEngine.getLogger(getClass());
  this.rollbackExceptionHandler=logAllExceptions(logger,"String_Node_Str",Level.FINEST);
  this.rollbackTxExceptionHandler=logAllExceptions(logger,"String_Node_Str",Level.FINEST);
}

Fixed version (ground truth):
TransactionImpl(TransactionManagerServiceImpl transactionManagerService,NodeEngine nodeEngine,String txnId,List<TransactionLogRecord> transactionLog,long timeoutMillis,long startTime,String txOwnerUuid){
  this.transactionLog=new TransactionLog(transactionLog);
  this.transactionManagerService=transactionManagerService;
  this.nodeEngine=nodeEngine;
  this.txnId=txnId;
  this.timeoutMillis=timeoutMillis;
  this.startTime=startTime;
  this.durability=0;
  this.transactionType=TWO_PHASE;
  this.state=PREPARED;
  this.txOwnerUuid=txOwnerUuid;
  this.checkThreadAccess=false;
  this.logger=nodeEngine.getLogger(getClass());
  this.rollbackExceptionHandler=logAllExceptions(logger,"String_Node_Str",Level.FINEST);
  this.rollbackTxExceptionHandler=logAllExceptions(logger,"String_Node_Str",Level.FINEST);
  this.replicationTxExceptionHandler=createReplicationTxExceptionHandler(logger);
}
Program: 46457
Project: 46457
Buggy source:
@Override public Xid[] recover(int flag) throws XAException {
  NodeEngine nodeEngine=getNodeEngine();
  XAService xaService=getService();
  OperationService operationService=nodeEngine.getOperationService();
  ClusterService clusterService=nodeEngine.getClusterService();
  Collection<Member> memberList=clusterService.getMembers();
  List<InternalCompletableFuture<SerializableList>> futureList=new ArrayList<InternalCompletableFuture<SerializableList>>();
  for (  Member member : memberList) {
    if (member.localMember()) {
      continue;
    }
    CollectRemoteTransactionsOperation op=new CollectRemoteTransactionsOperation();
    Address address=member.getAddress();
    InternalCompletableFuture<SerializableList> future=operationService.invokeOnTarget(SERVICE_NAME,op,address);
    futureList.add(future);
  }
  HashSet<SerializableXID> xids=new HashSet<SerializableXID>();
  xids.addAll(xaService.getPreparedXids());
  for (  InternalCompletableFuture<SerializableList> future : futureList) {
    SerializableList xidSet=future.join();
    for (    Data xidData : xidSet) {
      SerializableXID xid=nodeEngine.toObject(xidData);
      xids.add(xid);
    }
  }
  return xids.toArray(new SerializableXID[xids.size()]);
}

Fixed version (ground truth):
@Override public Xid[] recover(int flag) throws XAException {
  NodeEngine nodeEngine=getNodeEngine();
  XAService xaService=getService();
  OperationService operationService=nodeEngine.getOperationService();
  ClusterService clusterService=nodeEngine.getClusterService();
  Collection<Member> memberList=clusterService.getMembers();
  List<Future<SerializableList>> futureList=new ArrayList<Future<SerializableList>>();
  for (  Member member : memberList) {
    if (member.localMember()) {
      continue;
    }
    CollectRemoteTransactionsOperation op=new CollectRemoteTransactionsOperation();
    Address address=member.getAddress();
    InternalCompletableFuture<SerializableList> future=operationService.invokeOnTarget(SERVICE_NAME,op,address);
    futureList.add(future);
  }
  HashSet<SerializableXID> xids=new HashSet<SerializableXID>();
  xids.addAll(xaService.getPreparedXids());
  for (  Future<SerializableList> future : futureList) {
    try {
      SerializableList xidSet=future.get();
      for (      Data xidData : xidSet) {
        SerializableXID xid=nodeEngine.toObject(xidData);
        xids.add(xid);
      }
    }
 catch (    InterruptedException e) {
      throw new XAException(XAException.XAER_RMERR);
    }
catch (    MemberLeftException e) {
      logger.warning("String_Node_Str",e);
    }
catch (    ExecutionException e) {
      Throwable cause=e.getCause();
      if (cause instanceof HazelcastInstanceNotActiveException || cause instanceof TargetNotMemberException) {
        logger.warning("String_Node_Str",e);
      }
 else {
        throw new XAException(XAException.XAER_RMERR);
      }
    }
  }
  return xids.toArray(new SerializableXID[xids.size()]);
}
Program: 46458
Project: 46458
Buggy source:
public XAResourceImpl(NodeEngine nodeEngine,XAService service){
  super(nodeEngine,service);
  GroupConfig groupConfig=nodeEngine.getConfig().getGroupConfig();
  groupName=groupConfig.getName();
}

Fixed version (ground truth):
public XAResourceImpl(NodeEngine nodeEngine,XAService service){
  super(nodeEngine,service);
  GroupConfig groupConfig=nodeEngine.getConfig().getGroupConfig();
  groupName=groupConfig.getName();
  logger=nodeEngine.getLogger(getClass());
}
Program: 46459
Project: 46459
Buggy source:
@Override public void end(Xid xid,int flags) throws XAException {
  long threadId=currentThreadId();
  TransactionContext threadContext=threadContextMap.remove(threadId);
  if (threadContext == null && LOGGER.isFinestEnabled()) {
    LOGGER.finest("String_Node_Str" + threadId);
  }
  List<TransactionContext> contexts=xidContextMap.get(xid);
  if (contexts == null && LOGGER.isFinestEnabled()) {
    LOGGER.finest("String_Node_Str" + xid);
  }
}

Fixed version (ground truth):
@Override public void end(Xid xid,int flags) throws XAException {
  long threadId=currentThreadId();
  TransactionContext threadContext=threadContextMap.remove(threadId);
  if (threadContext == null && logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + threadId);
  }
  List<TransactionContext> contexts=xidContextMap.get(xid);
  if (contexts == null && logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + xid);
  }
}
Program: 46460
Project: 46460
Buggy source:
/** 
 * Populate the LifeOperations
 * @param result the result.
 */
void populate(LiveOperations result);

Fixed version (ground truth):
/** 
 * Populate the LiveOperations
 * @param liveOperations the LiveOperations to populate.
 */
void populate(LiveOperations liveOperations);
Program: 46461
Project: 46461
Buggy source:
public MulticastDiscoverySender(DiscoveryNode discoveryNode,MulticastSocket multicastSocket,ILogger logger) throws IOException {
  this.multicastSocket=multicastSocket;
  this.logger=logger;
  if (discoveryNode != null) {
    Address address=discoveryNode.getPublicAddress();
    multicastMemberInfo=new MulticastMemberInfo(address.getHost(),address.getPort());
  }
  initDatagramPacket();
}

Fixed version (ground truth):
public MulticastDiscoverySender(DiscoveryNode discoveryNode,MulticastSocket multicastSocket,ILogger logger,String group,int port) throws IOException {
  this.multicastSocket=multicastSocket;
  this.logger=logger;
  this.group=group;
  this.port=port;
  if (discoveryNode != null) {
    Address address=discoveryNode.getPublicAddress();
    multicastMemberInfo=new MulticastMemberInfo(address.getHost(),address.getPort());
  }
  initDatagramPacket();
}
Program: 46462
Project: 46462
Buggy source:
private void initDatagramPacket() throws IOException {
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  ObjectOutput out;
  out=new ObjectOutputStream(bos);
  out.writeObject(multicastMemberInfo);
  byte[] yourBytes=bos.toByteArray();
  datagramPacket=new DatagramPacket(yourBytes,yourBytes.length,multicastSocket.getInetAddress(),multicastSocket.getPort());
}

Fixed version (ground truth):
private void initDatagramPacket() throws IOException {
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  ObjectOutput out;
  out=new ObjectOutputStream(bos);
  out.writeObject(multicastMemberInfo);
  byte[] yourBytes=bos.toByteArray();
  datagramPacket=new DatagramPacket(yourBytes,yourBytes.length,InetAddress.getByName(group),port);
}
Program: 46463
Project: 46463
Buggy source:
private void initializeMulticastSocket(){
  try {
    int port=getOrDefault(MulticastProperties.PORT,DEFAULT_MULTICAST_PORT);
    String group=getOrDefault(MulticastProperties.GROUP,DEFAULT_MULTICAST_GROUP);
    multicastSocket=new MulticastSocket(port);
    multicastSocket.setReuseAddress(true);
    multicastSocket.setTimeToLive(SOCKET_TIME_TO_LIVE);
    multicastSocket.setReceiveBufferSize(DATA_OUTPUT_BUFFER_SIZE);
    multicastSocket.setSendBufferSize(DATA_OUTPUT_BUFFER_SIZE);
    multicastSocket.setSoTimeout(SOCKET_TIMEOUT);
    multicastSocket.joinGroup(InetAddress.getByName(group));
    multicastDiscoverySender=new MulticastDiscoverySender(discoveryNode,multicastSocket,logger);
    multicastDiscoveryReceiver=new MulticastDiscoveryReceiver(multicastSocket,logger);
    if (discoveryNode != null) {
      isClient=false;
    }
  }
 catch (  Exception e) {
    logger.finest(e.getMessage());
  }
}

Fixed version (ground truth):
private void initializeMulticastSocket(){
  try {
    int port=getOrDefault(MulticastProperties.PORT,DEFAULT_MULTICAST_PORT);
    MulticastProperties.PortValueValidator validator=new MulticastProperties.PortValueValidator();
    validator.validate(port);
    String group=getOrDefault(MulticastProperties.GROUP,DEFAULT_MULTICAST_GROUP);
    multicastSocket=new MulticastSocket(null);
    multicastSocket.bind(new InetSocketAddress(port));
    multicastSocket.setReuseAddress(true);
    multicastSocket.setTimeToLive(SOCKET_TIME_TO_LIVE);
    multicastSocket.setReceiveBufferSize(DATA_OUTPUT_BUFFER_SIZE);
    multicastSocket.setSendBufferSize(DATA_OUTPUT_BUFFER_SIZE);
    multicastSocket.setSoTimeout(SOCKET_TIMEOUT);
    multicastSocket.joinGroup(InetAddress.getByName(group));
    multicastDiscoverySender=new MulticastDiscoverySender(discoveryNode,multicastSocket,logger,group,port);
    multicastDiscoveryReceiver=new MulticastDiscoveryReceiver(multicastSocket,logger);
    if (discoveryNode != null) {
      isClient=false;
    }
  }
 catch (  Exception e) {
    logger.finest(e.getMessage());
  }
}
Program: 46464
Project: 46464
Buggy source:
@Test public void formClusterWithTwoMembersTest() throws InterruptedException {
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  instances=factory.newInstances(config);
  assertClusterSizeEventually(2,instances[0]);
  factory.shutdownAll();
}

Fixed version (ground truth):
@Test public void formClusterWithTwoMembersTest() throws InterruptedException {
  System.setProperty(TestEnvironment.HAZELCAST_TEST_USE_NETWORK,"String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  instances=factory.newInstances(config);
  assertClusterSizeEventually(2,instances[0]);
  factory.shutdownAll();
}
Program: 46465
Project: 46465
Buggy source:
@Before public void setup() throws Exception {
  ContainerContext cc=CONTAINER_CONTEXT_MAP.get(getClass());
  if (cc == null) {
    ensureInstanceIsUp();
    CONTAINER_CONTEXT_MAP.put(getClass(),new ContainerContext(this,serverXml1,serverXml2,serverPort1,serverPort2,server1,server2,hz));
  }
 else {
    cc.copyInto(this);
    ensureInstanceIsUp();
    cc.copyFrom(this);
  }
  IMap<String,Object> map=hz.getMap(DEFAULT_MAP_NAME);
  map.clear();
}

Fixed version (ground truth):
@Before public void setup() throws Exception {
  ContainerContext cc=CONTAINER_CONTEXT_MAP.get(getClass());
  if (cc != null) {
    if (!cc.serverXml1.equals(serverXml1) || !cc.serverXml2.equals(serverXml2)) {
      cc.server1.stop();
      cc.server2.stop();
      cc=null;
    }
  }
  if (cc == null) {
    ensureInstanceIsUp();
    CONTAINER_CONTEXT_MAP.put(getClass(),new ContainerContext(this,serverXml1,serverXml2,serverPort1,serverPort2,server1,server2,hz));
  }
 else {
    cc.copyInto(this);
    ensureInstanceIsUp();
    cc.copyFrom(this);
  }
  IMap<String,Object> map=hz.getMap(DEFAULT_MAP_NAME);
  map.clear();
}
Program: 46466
Project: 46466
Buggy source:
@ManagedAnnotation("String_Node_Str") @ManagedDescription("String_Node_Str") public String getConfig(){
  return service.instance.getConfig().findMapConfig(managedObject.getName()).toString();
}

Fixed version (ground truth):
@ManagedAnnotation("String_Node_Str") @ManagedDescription("String_Node_Str") public String getConfig(){
  return service.instance.getConfig().findReplicatedMapConfig(managedObject.getName()).toString();
}
Program: 46467
Project: 46467
Buggy source:
@Override public Thread newThread(Runnable r){
  Thread thread=new InvocationMonitorThread(r,threadGroup);
  thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){
    @Override public void uncaughtException(    Thread t,    Throwable e){
      logger.severe(e);
    }
  }
);
  return thread;
}

Fixed version (ground truth):
@Override public Thread newThread(Runnable r){
  return new InvocationMonitorThread(r,threadGroup);
}
Program: 46468
Project: 46468
Buggy source:
@Override public void run(){
  LiveOperations result=populate();
  Set<Address> addresses=result.addresses();
  if (logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + addresses.size() + "String_Node_Str");
  }
  for (  Address address : addresses) {
    sendHeartbeats(address,result.callIds(address));
  }
}

Fixed version (ground truth):
@Override public void run(){
  long currentTimeMillis=System.currentTimeMillis();
  try {
    if (expectedNextMillis + MAX_DELAY_MILLIS < currentTimeMillis) {
      logger.warning(getClass().getSimpleName() + "String_Node_Str" + (currentTimeMillis - expectedNextMillis)+ "String_Node_Str");
      delayedExecutionCount.inc();
    }
    run0();
  }
 catch (  Throwable t) {
    inspectOutOfMemoryError(t);
    logger.severe(t);
  }
 finally {
    expectedNextMillis=currentTimeMillis + periodMillis;
  }
}
Program: 46469
Project: 46469
Buggy source:
private long heartbeatBroadcastPeriodMillis(HazelcastProperties groupProperties){
  int callTimeoutMs=groupProperties.getInteger(OPERATION_CALL_TIMEOUT_MILLIS);
  long periodMs=Math.max(SECONDS.toMillis(1),callTimeoutMs / HEARTBEAT_CALL_TIMEOUT_RATIO);
  if (logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + periodMs + "String_Node_Str");
  }
  return periodMs;
}

Fixed version (ground truth):
private long heartbeatBroadcastPeriodMillis(HazelcastProperties properties){
  int callTimeoutMs=properties.getInteger(OPERATION_CALL_TIMEOUT_MILLIS);
  long periodMs=Math.max(SECONDS.toMillis(1),callTimeoutMs / HEARTBEAT_CALL_TIMEOUT_RATIO);
  if (logger.isFinestEnabled()) {
    logger.finest("String_Node_Str" + periodMs + "String_Node_Str");
  }
  return periodMs;
}
Program: 46470
Project: 46470
Buggy source:
public void start(){
  scheduler.scheduleAtFixedRate(new MonitorInvocationsTask(),0,invocationScanPeriodMillis,MILLISECONDS);
  scheduler.scheduleAtFixedRate(new BroadcastOperationHeartbeatsTask(),0,heartbeatBroadcastPeriodMillis,MILLISECONDS);
}

Fixed version (ground truth):
public void start(){
  MonitorInvocationsTask monitorInvocationsTask=new MonitorInvocationsTask(invocationScanPeriodMillis);
  scheduler.scheduleAtFixedRate(monitorInvocationsTask,0,monitorInvocationsTask.periodMillis,MILLISECONDS);
  BroadcastOperationHeartbeatsTask broadcastOperationHeartbeatsTask=new BroadcastOperationHeartbeatsTask(heartbeatBroadcastPeriodMillis);
  scheduler.scheduleAtFixedRate(broadcastOperationHeartbeatsTask,0,broadcastOperationHeartbeatsTask.periodMillis,MILLISECONDS);
}
Program: 46471
Project: 46471
Buggy source:
private ScheduledExecutorService newScheduler(final HazelcastThreadGroup threadGroup){
  return new ScheduledThreadPoolExecutor(1,new ThreadFactory(){
    @Override public Thread newThread(    Runnable r){
      Thread thread=new InvocationMonitorThread(r,threadGroup);
      thread.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler(){
        @Override public void uncaughtException(        Thread t,        Throwable e){
          logger.severe(e);
        }
      }
);
      return thread;
    }
  }
);
}

Fixed version (ground truth):
private ScheduledExecutorService newScheduler(final HazelcastThreadGroup threadGroup){
  return new ScheduledThreadPoolExecutor(1,new ThreadFactory(){
    @Override public Thread newThread(    Runnable r){
      return new InvocationMonitorThread(r,threadGroup);
    }
  }
);
}
Program: 46472
Project: 46472
Buggy source:
InvocationMonitor(NodeEngineImpl nodeEngine,Address thisAddress,HazelcastThreadGroup threadGroup,HazelcastProperties hazelcastProperties,InvocationRegistry invocationRegistry,ILogger logger,InternalSerializationService serializationService,ServiceManager serviceManager){
  this.nodeEngine=nodeEngine;
  this.thisAddress=thisAddress;
  this.serializationService=serializationService;
  this.serviceManager=serviceManager;
  this.invocationRegistry=invocationRegistry;
  this.logger=logger;
  this.backupTimeoutMillis=backupTimeoutMillis(hazelcastProperties);
  this.invocationTimeoutMillis=invocationTimeoutMillis(hazelcastProperties);
  this.heartbeatBroadcastPeriodMillis=heartbeatBroadcastPeriodMillis(hazelcastProperties);
  this.scheduler=newScheduler(threadGroup);
}

Fixed version (ground truth):
InvocationMonitor(NodeEngineImpl nodeEngine,Address thisAddress,HazelcastThreadGroup threadGroup,HazelcastProperties properties,InvocationRegistry invocationRegistry,ILogger logger,InternalSerializationService serializationService,ServiceManager serviceManager){
  this.nodeEngine=nodeEngine;
  this.thisAddress=thisAddress;
  this.serializationService=serializationService;
  this.serviceManager=serviceManager;
  this.invocationRegistry=invocationRegistry;
  this.logger=logger;
  this.backupTimeoutMillis=backupTimeoutMillis(properties);
  this.invocationTimeoutMillis=invocationTimeoutMillis(properties);
  this.heartbeatBroadcastPeriodMillis=heartbeatBroadcastPeriodMillis(properties);
  this.scheduler=newScheduler(threadGroup);
}
Program: 46473
Project: 46473
Buggy source:
private void process(Object task){
  try {
    if (task.getClass() == Packet.class) {
      Packet packet=(Packet)task;
      currentRunner=getOperationRunner(packet.getPartitionId());
      currentRunner.run(packet);
      completedPacketCount.inc();
    }
 else     if (task instanceof Operation) {
      Operation operation=(Operation)task;
      currentRunner=getOperationRunner(operation.getPartitionId());
      currentRunner.run(operation);
      completedOperationCount.inc();
    }
 else     if (task instanceof PartitionSpecificRunnable) {
      PartitionSpecificRunnable runnable=(PartitionSpecificRunnable)task;
      currentRunner=getOperationRunner(runnable.getPartitionId());
      currentRunner.run(runnable);
      completedPartitionSpecificRunnableCount.inc();
    }
 else     if (task instanceof Runnable) {
      Runnable runnable=(Runnable)task;
      runnable.run();
      completedRunnableCount.inc();
    }
 else {
      throw new IllegalStateException("String_Node_Str" + task);
    }
    completedTotalCount.inc();
  }
 catch (  Throwable t) {
    errorCount.inc();
    inspectOutputMemoryError(t);
    logger.severe("String_Node_Str" + task + "String_Node_Str"+ getName(),t);
  }
 finally {
    currentRunner=null;
  }
}

Fixed version (ground truth):
private void process(Object task){
  try {
    if (task.getClass() == Packet.class) {
      Packet packet=(Packet)task;
      currentRunner=getOperationRunner(packet.getPartitionId());
      currentRunner.run(packet);
      completedPacketCount.inc();
    }
 else     if (task instanceof Operation) {
      Operation operation=(Operation)task;
      currentRunner=getOperationRunner(operation.getPartitionId());
      currentRunner.run(operation);
      completedOperationCount.inc();
    }
 else     if (task instanceof PartitionSpecificRunnable) {
      PartitionSpecificRunnable runnable=(PartitionSpecificRunnable)task;
      currentRunner=getOperationRunner(runnable.getPartitionId());
      currentRunner.run(runnable);
      completedPartitionSpecificRunnableCount.inc();
    }
 else     if (task instanceof Runnable) {
      Runnable runnable=(Runnable)task;
      runnable.run();
      completedRunnableCount.inc();
    }
 else {
      throw new IllegalStateException("String_Node_Str" + task);
    }
    completedTotalCount.inc();
  }
 catch (  Throwable t) {
    errorCount.inc();
    inspectOutOfMemoryError(t);
    logger.severe("String_Node_Str" + task + "String_Node_Str"+ getName(),t);
  }
 finally {
    currentRunner=null;
  }
}
Program: 46474
Project: 46474
Buggy source:
@Override public final void run(){
  nodeExtension.onThreadStart(this);
  try {
    while (!shutdown) {
      Object task;
      try {
        task=queue.take(priority);
      }
 catch (      InterruptedException e) {
        continue;
      }
      process(task);
    }
  }
 catch (  Throwable t) {
    inspectOutputMemoryError(t);
    logger.severe(t);
  }
 finally {
    nodeExtension.onThreadStop(this);
  }
}

Fixed version (ground truth):
@Override public final void run(){
  nodeExtension.onThreadStart(this);
  try {
    while (!shutdown) {
      Object task;
      try {
        task=queue.take(priority);
      }
 catch (      InterruptedException e) {
        continue;
      }
      process(task);
    }
  }
 catch (  Throwable t) {
    inspectOutOfMemoryError(t);
    logger.severe(t);
  }
 finally {
    nodeExtension.onThreadStop(this);
  }
}
Program: 46475
Project: 46475
Buggy source:
private void doRun() throws InterruptedException {
  while (!shutdown) {
    Packet response=responseQueue.take();
    try {
      responsePacketHandler.handle(response);
    }
 catch (    Throwable e) {
      inspectOutputMemoryError(e);
      logger.severe("String_Node_Str" + response + "String_Node_Str"+ getName(),e);
    }
  }
}

Fixed version (ground truth):
private void doRun() throws InterruptedException {
  while (!shutdown) {
    Packet response=responseQueue.take();
    try {
      responsePacketHandler.handle(response);
    }
 catch (    Throwable e) {
      inspectOutOfMemoryError(e);
      logger.severe("String_Node_Str" + response + "String_Node_Str"+ getName(),e);
    }
  }
}
Program: 46476
Project: 46476
Buggy source:
@Override public void run(){
  try {
    doRun();
  }
 catch (  InterruptedException e) {
    ignore(e);
  }
catch (  Throwable t) {
    inspectOutputMemoryError(t);
    logger.severe(t);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    doRun();
  }
 catch (  InterruptedException e) {
    ignore(e);
  }
catch (  Throwable t) {
    inspectOutOfMemoryError(t);
    logger.severe(t);
  }
}
Program: 46477
Project: 46477
Buggy source:
@Override public void dispatch(Packet packet){
  try {
    if (packet.isFlagSet(FLAG_OP)) {
      if (packet.isFlagSet(FLAG_RESPONSE)) {
        responseHandler.handle(packet);
      }
 else       if (packet.isFlagSet(FLAG_OP_CONTROL)) {
        invocationMonitor.handle(packet);
      }
 else {
        operationExecutor.handle(packet);
      }
    }
 else     if (packet.isFlagSet(FLAG_EVENT)) {
      eventService.handle(packet);
    }
 else     if (packet.isFlagSet(FLAG_BIND)) {
      connectionManager.handle(packet);
    }
 else {
      logger.severe("String_Node_Str" + packet.getFlags());
    }
  }
 catch (  Throwable t) {
    inspectOutputMemoryError(t);
    logger.severe("String_Node_Str" + packet,t);
  }
}

Fixed version (ground truth):
@Override public void dispatch(Packet packet){
  try {
    if (packet.isFlagSet(FLAG_OP)) {
      if (packet.isFlagSet(FLAG_RESPONSE)) {
        responseHandler.handle(packet);
      }
 else       if (packet.isFlagSet(FLAG_OP_CONTROL)) {
        invocationMonitor.handle(packet);
      }
 else {
        operationExecutor.handle(packet);
      }
    }
 else     if (packet.isFlagSet(FLAG_EVENT)) {
      eventService.handle(packet);
    }
 else     if (packet.isFlagSet(FLAG_BIND)) {
      connectionManager.handle(packet);
    }
 else {
      logger.severe("String_Node_Str" + packet.getFlags());
    }
  }
 catch (  Throwable t) {
    inspectOutOfMemoryError(t);
    logger.severe("String_Node_Str" + packet,t);
  }
}
Program: 46478
Project: 46478
Buggy source:
private void process(Runnable task){
  try {
    task.run();
  }
 catch (  Throwable e) {
    OutOfMemoryErrorDispatcher.inspectOutputMemoryError(e);
    logger.severe(getName() + "String_Node_Str" + task,e);
  }
}

Fixed version (ground truth):
private void process(Runnable task){
  try {
    task.run();
  }
 catch (  Throwable e) {
    OutOfMemoryErrorDispatcher.inspectOutOfMemoryError(e);
    logger.severe(getName() + "String_Node_Str" + task,e);
  }
}
Program: 46479
Project: 46479
Buggy source:
@Override public <K,V>void setPredicates(Predicate<K,V>[] predicates){
  if (this.predicates == null) {
    this.predicates=predicates;
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Visitable predicates are treated as effectively immutable, therefore callers should not make any changes to the array passed as argument after is has been set.
 * @param predicates    the array of sub-predicates for this {@code And} operator. It is not safe to make any changes tothis array after it has been set.
 */
@Override @SuppressFBWarnings("String_Node_Str") public <K,V>void setPredicates(Predicate<K,V>[] predicates){
  if (this.predicates == null) {
    this.predicates=predicates;
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 46480
Project: 46480
Buggy source:
@Override public <K,V>Predicate<K,V>[] getPredicates(){
  return predicates;
}

Fixed version (ground truth):
/** 
 * Visitable predicates are treated as effectively immutable, therefore callers should not make any changes to the returned array.
 */
@Override @SuppressFBWarnings("String_Node_Str") public <K,V>Predicate<K,V>[] getPredicates(){
  return predicates;
}
Program: 46481
Project: 46481
Buggy source:
@Override public <K,V>void setPredicates(Predicate<K,V>[] predicates){
  if (this.predicates == null) {
    this.predicates=predicates;
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Visitable predicates are treated as effectively immutable, therefore callers should not make any changes to the array passed as argument after is has been set.
 * @param predicates    the array of sub-predicates for this {@code Or} operator. It is not safe to make any changes tothis array after it has been set.
 */
@Override @SuppressFBWarnings("String_Node_Str") public <K,V>void setPredicates(Predicate<K,V>[] predicates){
  if (this.predicates == null) {
    this.predicates=predicates;
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 46482
Project: 46482
Buggy source:
@Override public <K,V>Predicate<K,V>[] getPredicates(){
  return predicates;
}

Fixed version (ground truth):
/** 
 * Visitable predicates are treated as effectively immutable, therefore callers should not make any changes to the returned array.
 */
@Override @SuppressFBWarnings("String_Node_Str") public <K,V>Predicate<K,V>[] getPredicates(){
  return predicates;
}
Program: 46483
Project: 46483
Buggy source:
protected <K,V>void registerListeners(CacheConfig<K,V> cacheConfig,ICache<K,V> source){
  Iterator<CacheEntryListenerConfiguration<K,V>> iterator=cacheConfig.getCacheEntryListenerConfigurations().iterator();
  while (iterator.hasNext()) {
    CacheEntryListenerConfiguration<K,V> listenerConfig=iterator.next();
    iterator.remove();
    source.registerCacheEntryListener(listenerConfig);
  }
}

Fixed version (ground truth):
protected <K,V>void registerListeners(CacheConfig<K,V> cacheConfig,ICache<K,V> source){
  Iterator<CacheEntryListenerConfiguration<K,V>> iterator=cacheConfig.getCacheEntryListenerConfigurations().iterator();
  Set<CacheEntryListenerConfiguration> removedListenerConfigs=new HashSet<CacheEntryListenerConfiguration>();
  while (iterator.hasNext()) {
    CacheEntryListenerConfiguration<K,V> listenerConfig=iterator.next();
    if (removedListenerConfigs.contains(listenerConfig)) {
      continue;
    }
    iterator.remove();
    removedListenerConfigs.add(listenerConfig);
    source.registerCacheEntryListener(listenerConfig);
  }
}
Program: 46484
Project: 46484
Buggy source:
protected <K,V>void registerListeners(CacheConfig<K,V> cacheConfig,ICache<K,V> source){
  Iterator<CacheEntryListenerConfiguration<K,V>> iterator=cacheConfig.getCacheEntryListenerConfigurations().iterator();
  while (iterator.hasNext()) {
    CacheEntryListenerConfiguration<K,V> listenerConfig=iterator.next();
    iterator.remove();
    source.registerCacheEntryListener(listenerConfig);
  }
}

Fixed version (ground truth):
protected <K,V>void registerListeners(CacheConfig<K,V> cacheConfig,ICache<K,V> source){
  Iterator<CacheEntryListenerConfiguration<K,V>> iterator=cacheConfig.getCacheEntryListenerConfigurations().iterator();
  Set<CacheEntryListenerConfiguration> removedListenerConfigs=new HashSet<CacheEntryListenerConfiguration>();
  while (iterator.hasNext()) {
    CacheEntryListenerConfiguration<K,V> listenerConfig=iterator.next();
    if (removedListenerConfigs.contains(listenerConfig)) {
      continue;
    }
    iterator.remove();
    removedListenerConfigs.add(listenerConfig);
    source.registerCacheEntryListener(listenerConfig);
  }
}
Program: 46485
Project: 46485
Buggy source:
public PutAllPerMemberOperation(String name,int[] partitions,MapEntries[] mapEntries){
  super(name);
  this.partitions=partitions;
  this.mapEntries=mapEntries;
}

Fixed version (ground truth):
@SuppressFBWarnings("String_Node_Str") public PutAllPerMemberOperation(String name,int[] partitions,MapEntries[] mapEntries){
  super(name);
  this.partitions=partitions;
  this.mapEntries=mapEntries;
}
Program: 46487
Project: 46487
Buggy source:
private static Boolean isCompressedOopsOrNull(){
  if (!UNSAFE_AVAILABLE) {
    return null;
  }
  int oopSize;
  try {
    long off1=UNSAFE.objectFieldOffset(CompressedOopsClass.class.getField("String_Node_Str"));
    long off2=UNSAFE.objectFieldOffset(CompressedOopsClass.class.getField("String_Node_Str"));
    oopSize=(int)Math.abs(off2 - off1);
  }
 catch (  Exception e) {
    getLogger(JVMUtil.class).warning(e);
    return null;
  }
  return oopSize != UNSAFE.addressSize();
}

Fixed version (ground truth):
/** 
 * Fallback when checking CompressedOopsEnabled. Borrowed from http://openjdk.java.net/projects/code-tools/jol/
 */
@SuppressFBWarnings("String_Node_Str") private static Boolean isCompressedOopsOrNull(){
  if (!UNSAFE_AVAILABLE) {
    return null;
  }
  int oopSize;
  try {
    long off1=UNSAFE.objectFieldOffset(CompressedOopsClass.class.getField("String_Node_Str"));
    long off2=UNSAFE.objectFieldOffset(CompressedOopsClass.class.getField("String_Node_Str"));
    oopSize=(int)Math.abs(off2 - off1);
  }
 catch (  Exception e) {
    getLogger(JVMUtil.class).warning(e);
    return null;
  }
  return oopSize != UNSAFE.addressSize();
}
Program: 46488
Project: 46488
Buggy source:
private static Boolean isHotSpotCompressedOopsOrNull(){
  try {
    MBeanServer server=ManagementFactory.getPlatformMBeanServer();
    ObjectName mbean=new ObjectName("String_Node_Str");
    Object[] objects={"String_Node_Str"};
    String[] strings={"String_Node_Str"};
    String operation="String_Node_Str";
    CompositeDataSupport compressedOopsValue=(CompositeDataSupport)server.invoke(mbean,operation,objects,strings);
    return Boolean.valueOf(compressedOopsValue.get("String_Node_Str").toString());
  }
 catch (  Exception e) {
    getLogger(JVMUtil.class).warning("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
@SuppressFBWarnings("String_Node_Str") private static Boolean isHotSpotCompressedOopsOrNull(){
  try {
    MBeanServer server=ManagementFactory.getPlatformMBeanServer();
    ObjectName mbean=new ObjectName("String_Node_Str");
    Object[] objects={"String_Node_Str"};
    String[] strings={"String_Node_Str"};
    String operation="String_Node_Str";
    CompositeDataSupport compressedOopsValue=(CompositeDataSupport)server.invoke(mbean,operation,objects,strings);
    return Boolean.valueOf(compressedOopsValue.get("String_Node_Str").toString());
  }
 catch (  Exception e) {
    getLogger(JVMUtil.class).warning("String_Node_Str",e);
  }
  return null;
}
Program: 46489
Project: 46489
Buggy source:
@Override public final void destroy(){
  if (preDestroy()) {
    onDestroy();
    ClientMessage clientMessage=ClientDestroyProxyCodec.encodeRequest(getDistributedObjectName(),getServiceName());
    context.removeProxy(this);
    try {
      new ClientInvocation(getClient(),clientMessage).invoke().get();
    }
 catch (    Exception e) {
      throw ExceptionUtil.rethrow(e);
    }
  }
}

Fixed version (ground truth):
@Override public final void destroy(){
  if (preDestroy()) {
    onDestroy();
    ClientMessage clientMessage=ClientDestroyProxyCodec.encodeRequest(getDistributedObjectName(),getServiceName());
    context.removeProxy(this);
    try {
      new ClientInvocation(getClient(),clientMessage).invoke().get();
      postDestroy();
    }
 catch (    Exception e) {
      throw ExceptionUtil.rethrow(e);
    }
  }
}
Program: 46490
Project: 46490
Buggy source:
protected boolean preDestroy(){
  return true;
}

Fixed version (ground truth):
/** 
 * Called before proxy is destroyed and determines whether destroy should be done.
 * @return <code>true</code> if destroy should be done, otherwise <code>false</code>
 */
protected boolean preDestroy(){
  return true;
}
Program: 46491
Project: 46491
Buggy source:
/** 
 * Gets cache name by adding manager prefix.
 * @param name pure cache name with prefix
 * @return the cache name with manager prefix
 */
String getCacheNameWithPrefix(String name);

Fixed version (ground truth):
/** 
 * Gets cache name by adding manager prefix.
 * @param name pure cache name without prefix
 * @return the cache name with manager prefix
 */
String getCacheNameWithPrefix(String name);
Program: 46492
Project: 46492
Buggy source:
@Override public void destroyCache(String cacheName){
  checkIfManagerNotClosed();
  checkNotNull(cacheName,"String_Node_Str");
  String cacheNameWithPrefix=getCacheNameWithPrefix(cacheName);
  ICacheInternal<?,?> cache=caches.remove(cacheNameWithPrefix);
  if (cache != null) {
    cache.destroy();
  }
  removeCacheConfigFromLocal(cacheNameWithPrefix);
}

Fixed version (ground truth):
@Override public void destroyCache(String cacheName){
  removeCache(cacheName,true);
}
Program: 46493
Project: 46493
Buggy source:
@Test public void getButCantOperateOnCacheAfterDestroy(){
  String cacheName=randomString();
  ICache<Integer,Integer> cache=createCache(cacheName);
  cache.destroy();
  assertTrue(cache.isClosed());
  assertTrue(cache.isDestroyed());
  Cache<Object,Object> cacheAfterClose=cacheManager.getCache(cacheName);
  assertNotNull(cacheAfterClose);
  assertTrue(cache.isClosed());
  assertTrue(cache.isDestroyed());
  try {
    cache.put(1,1);
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
catch (  Throwable t) {
    t.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str" + t.getMessage());
  }
}

Fixed version (ground truth):
@Test public void getButCantOperateOnCacheAfterDestroy(){
  String cacheName=randomString();
  ICache<Integer,Integer> cache=createCache(cacheName);
  cache.destroy();
  assertTrue(cache.isClosed());
  assertTrue(cache.isDestroyed());
  Cache<Object,Object> cacheAfterDestroy=cacheManager.getCache(cacheName);
  assertNull(cacheAfterDestroy);
  assertTrue(cache.isClosed());
  assertTrue(cache.isDestroyed());
  try {
    cache.put(1,1);
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
catch (  Throwable t) {
    t.printStackTrace();
    fail("String_Node_Str" + "String_Node_Str" + t.getMessage());
  }
}
Program: 46494
Project: 46494
Buggy source:
public void destroy(){
  close();
  if (!isDestroyed.compareAndSet(false,true)) {
    return;
  }
  isClosed.set(true);
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(nameWithPrefix);
    CacheDestroyRequest request=new CacheDestroyRequest(nameWithPrefix,partitionId);
    final ClientInvocation clientInvocation=new ClientInvocation((HazelcastClientInstanceImpl)clientContext.getHazelcastInstance(),request,partitionId);
    final Future<SerializableList> future=clientInvocation.invoke();
    future.get();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
public void destroy(){
  close();
  if (!isDestroyed.compareAndSet(false,true)) {
    return;
  }
  isClosed.set(true);
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(nameWithPrefix);
    CacheDestroyRequest request=new CacheDestroyRequest(nameWithPrefix,partitionId);
    final ClientInvocation clientInvocation=new ClientInvocation((HazelcastClientInstanceImpl)clientContext.getHazelcastInstance(),request,partitionId);
    final Future<SerializableList> future=clientInvocation.invoke();
    future.get();
    postDestroy();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 46495
Project: 46495
Buggy source:
public void close(){
  if (!isClosed.compareAndSet(false,true)) {
    return;
  }
  waitOnGoingLoadAllCallsToFinish();
  closeListeners();
}

Fixed version (ground truth):
public void close(){
  if (!isClosed.compareAndSet(false,true)) {
    return;
  }
  waitOnGoingLoadAllCallsToFinish();
  closeListeners();
  postClose();
}
Program: 46496
Project: 46496
Buggy source:
public void destroy(){
  close();
  if (!isDestroyed.compareAndSet(false,true)) {
    return;
  }
  isClosed.set(true);
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(nameWithPrefix);
    ClientMessage request=CacheDestroyCodec.encodeRequest(nameWithPrefix);
    final ClientInvocation clientInvocation=new ClientInvocation((HazelcastClientInstanceImpl)clientContext.getHazelcastInstance(),request,partitionId);
    final Future<ClientMessage> future=clientInvocation.invoke();
    future.get();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
public void destroy(){
  close();
  if (!isDestroyed.compareAndSet(false,true)) {
    return;
  }
  isClosed.set(true);
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(nameWithPrefix);
    ClientMessage request=CacheDestroyCodec.encodeRequest(nameWithPrefix);
    final ClientInvocation clientInvocation=new ClientInvocation((HazelcastClientInstanceImpl)clientContext.getHazelcastInstance(),request,partitionId);
    final Future<ClientMessage> future=clientInvocation.invoke();
    future.get();
    postDestroy();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 46497
Project: 46497
Buggy source:
public void close(){
  if (!isClosed.compareAndSet(false,true)) {
    return;
  }
  waitOnGoingLoadAllCallsToFinish();
  closeListeners();
}

Fixed version (ground truth):
public void close(){
  if (!isClosed.compareAndSet(false,true)) {
    return;
  }
  waitOnGoingLoadAllCallsToFinish();
  closeListeners();
  postClose();
}