nus-yam/ex-repair huggingface dataset:
Program: 46260
Project: 46260
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iList=client.getList(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iList.addItemListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iList=client.getList(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iList.addItemListener(listener,true);
}
Program: 46261
Project: 46261
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  multiMap=client.getMultiMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return multiMap.addEntryListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  multiMap=client.getMultiMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return multiMap.addEntryListener(listener,true);
}
Program: 46262
Project: 46262
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iQueue=client.getQueue(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iQueue.addItemListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iQueue=client.getQueue(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iQueue.addItemListener(listener,true);
}
Program: 46263
Project: 46263
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  replicatedMap=client.getReplicatedMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return replicatedMap.addEntryListener(listener);
}

Fixed version (ground truth):
@Override protected String addListener(){
  replicatedMap=client.getReplicatedMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return replicatedMap.addEntryListener(listener);
}
Program: 46264
Project: 46264
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iSet=client.getSet(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iSet.addItemListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iSet=client.getSet(randomString());
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iSet.addItemListener(listener,true);
}
Program: 46265
Project: 46265
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  topic=client.getTopic(randomString());
  MessageListener listener=new MessageListener(){
    @Override public void onMessage(    Message message){
      eventCount.incrementAndGet();
    }
  }
;
  return topic.addMessageListener(listener);
}

Fixed version (ground truth):
@Override protected String addListener(){
  topic=client.getTopic(randomString());
  MessageListener listener=new MessageListener(){
    @Override public void onMessage(    Message message){
      eventCount.incrementAndGet();
    }
  }
;
  return topic.addMessageListener(listener);
}
Program: 46266
Project: 46266
Buggy source:
@Test public void testListenersSmartRoutingTerminateRandomNode() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNodeInternal();
}

Fixed version (ground truth):
@Test public void testListenersSmartRoutingTerminateRandomNode(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNode();
}
Program: 46267
Project: 46267
Buggy source:
@Test public void testListenersNonSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(false);
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersNonSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46268
Project: 46268
Buggy source:
@Test public void testListenersNonSmartRoutingMultipleServer() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(false);
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersNonSmartRoutingMultipleServer(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46269
Project: 46269
Buggy source:
private void testListenersWaitMemberDestroy() throws InterruptedException {
  Collection<HazelcastInstance> allHazelcastInstances=factory.getAllHazelcastInstances();
  final int clusterSize=allHazelcastInstances.size();
  assertClusterSizeEventually(clusterSize,client);
  final AtomicInteger eventCount=new AtomicInteger();
  final String registrationId=addListener(eventCount);
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  final CountDownLatch connectedLatch=new CountDownLatch(1);
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED == event.getState()) {
        disconnectedLatch.countDown();
      }
      if (LifecycleEvent.LifecycleState.CLIENT_CONNECTED == event.getState()) {
        connectedLatch.countDown();
      }
    }
  }
);
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance ownerMember=getOwnerServer(factory,clientInstanceImpl);
  for (  HazelcastInstance member : allHazelcastInstances) {
    blockMessagesFromInstance(member,client);
  }
  ownerMember.getLifecycleService().terminate();
  for (  HazelcastInstance member : allHazelcastInstances) {
    unblockMessagesFromInstance(member,client);
  }
  assertTrue(disconnectedLatch.await(30,TimeUnit.SECONDS));
  assertTrue(connectedLatch.await(30,TimeUnit.SECONDS));
  sleepAtLeastMillis(ENDPOINT_REMOVE_DELAY_MILLISECONDS + 2000);
  validateRegistrations(clusterSize - 1,registrationId,clientInstanceImpl);
  validateListenerFunctionality(eventCount);
  assertTrue(removeListener(registrationId));
}

Fixed version (ground truth):
private void testListenersWaitMemberDestroy(){
  setupListener();
  Collection<HazelcastInstance> allHazelcastInstances=factory.getAllHazelcastInstances();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  final CountDownLatch connectedLatch=new CountDownLatch(1);
  client.getLifecycleService().addLifecycleListener(new LifecycleListener(){
    @Override public void stateChanged(    LifecycleEvent event){
      if (LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED == event.getState()) {
        disconnectedLatch.countDown();
      }
      if (LifecycleEvent.LifecycleState.CLIENT_CONNECTED == event.getState()) {
        connectedLatch.countDown();
      }
    }
  }
);
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance ownerMember=getOwnerServer(factory,clientInstanceImpl);
  for (  HazelcastInstance member : allHazelcastInstances) {
    blockMessagesFromInstance(member,client);
  }
  ownerMember.getLifecycleService().terminate();
  for (  HazelcastInstance member : allHazelcastInstances) {
    unblockMessagesFromInstance(member,client);
  }
  assertOpenEventually(disconnectedLatch);
  assertOpenEventually(connectedLatch);
  sleepAtLeastMillis(ENDPOINT_REMOVE_DELAY_MILLISECONDS + 2000);
  clusterSize=clusterSize - 1;
  validateRegistrationsAndListenerFunctionality();
}
Program: 46270
Project: 46270
Buggy source:
private ClientConfig getSmartClientConfig(){
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(20).setConnectionAttemptPeriod(2000).setConnectionTimeout(5000);
  clientConfig.setProperty(ClientProperty.HEARTBEAT_TIMEOUT.getName(),"String_Node_Str");
  clientConfig.setProperty(ClientProperty.HEARTBEAT_INTERVAL.getName(),"String_Node_Str");
  return clientConfig;
}

Fixed version (ground truth):
private ClientConfig getSmartClientConfig(){
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  clientConfig.getNetworkConfig().setRedoOperation(true);
  clientConfig.setProperty(ClientProperty.HEARTBEAT_TIMEOUT.getName(),"String_Node_Str");
  clientConfig.setProperty(ClientProperty.HEARTBEAT_INTERVAL.getName(),"String_Node_Str");
  return clientConfig;
}
Program: 46271
Project: 46271
Buggy source:
@Test public void testClusterReconnectDueToHeartbeatSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersForHeartbeat();
}

Fixed version (ground truth):
@Test public void testClusterReconnectDueToHeartbeatSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersHeartbeatTimeoutToOwner();
}
Program: 46272
Project: 46272
Buggy source:
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerSmartRouting() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}

Fixed version (ground truth):
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerSmartRouting(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}
Program: 46273
Project: 46273
Buggy source:
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerNonSmartRouting() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}

Fixed version (ground truth):
@Test public void testTemporaryBlockedNoDisconnectionMultipleServerNonSmartRouting(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}
Program: 46274
Project: 46274
Buggy source:
protected abstract String addListener(final AtomicInteger eventCount);

Fixed version (ground truth):
protected abstract String addListener();
Program: 46275
Project: 46275
Buggy source:
private void validateListenerFunctionality(final AtomicInteger eventCount){
  eventCount.set(0);
  for (int i=0; i < EVENT_COUNT; i++) {
    produceEvent();
  }
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      int count=eventCount.get();
      assertTrue("String_Node_Str" + count + "String_Node_Str"+ EVENT_COUNT,count >= EVENT_COUNT);
    }
  }
,5);
  assertTrueAllTheTime(new AssertTask(){
    @Override public void run() throws Exception {
      int count=eventCount.get();
      assertEquals("String_Node_Str" + count + "String_Node_Str"+ EVENT_COUNT,EVENT_COUNT,eventCount.get());
    }
  }
,3);
}

Fixed version (ground truth):
private void validateListenerFunctionality(){
  for (int i=0; i < EVENT_COUNT; i++) {
    produceEvent();
  }
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      int count=eventCount.get();
      assertTrue("String_Node_Str" + count + "String_Node_Str"+ EVENT_COUNT,count >= EVENT_COUNT);
    }
  }
);
  assertTrueAllTheTime(new AssertTask(){
    @Override public void run() throws Exception {
      int count=eventCount.get();
      assertEquals("String_Node_Str" + count + "String_Node_Str"+ EVENT_COUNT,EVENT_COUNT,eventCount.get());
    }
  }
,3);
}
Program: 46276
Project: 46276
Buggy source:
@Test public void testListenersSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46277
Project: 46277
Buggy source:
@Test public void testTemporaryBlockedNoDisconnectionSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}

Fixed version (ground truth):
@Test public void testTemporaryBlockedNoDisconnectionSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}
Program: 46278
Project: 46278
Buggy source:
@Test @Ignore(value="String_Node_Str") public void testClusterReconnectDueToHeartbeatNonSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersForHeartbeat();
}

Fixed version (ground truth):
@Test public void testClusterReconnectDueToHeartbeatNonSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersHeartbeatTimeoutToOwner();
}
Program: 46279
Project: 46279
Buggy source:
@Test public void testListenersSmartRoutingMultipleServer() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=createClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersInternal();
}

Fixed version (ground truth):
@Test public void testListenersSmartRoutingMultipleServer(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateOwnerNode();
}
Program: 46280
Project: 46280
Buggy source:
@Test public void testTemporaryBlockedNoDisconnectionNonSmartRouting() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}

Fixed version (ground truth):
@Test public void testTemporaryBlockedNoDisconnectionNonSmartRouting(){
  factory.newHazelcastInstance();
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTemporaryNetworkBlockage();
}
Program: 46281
Project: 46281
Buggy source:
private void testListenersTemporaryNetworkBlockage(){
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance server=getOwnerServer(factory,clientInstanceImpl);
  final int clusterSize=factory.getAllHazelcastInstances().size();
  assertClusterSizeEventually(clusterSize,client);
  final AtomicInteger eventCount=new AtomicInteger();
  final String registrationId=addListener(eventCount);
  final boolean smartRouting=clientInstanceImpl.getClientConfig().getNetworkConfig().isSmartRouting();
  final int expectedRegistrationsSize=smartRouting ? clusterSize : 1;
  assertEquals(expectedRegistrationsSize,getClientEventRegistrations(client,registrationId).size());
  long timeout=clientInstanceImpl.getProperties().getMillis(HEARTBEAT_TIMEOUT);
  long heartbeatTimeout=timeout > 0 ? timeout : Integer.parseInt(HEARTBEAT_TIMEOUT.getDefaultValue());
  long waitTime=heartbeatTimeout / 2;
  validateListenerFunctionality(eventCount);
  long endTime=System.currentTimeMillis() + waitTime;
  blockMessagesFromInstance(server,client);
  long sleepTime=endTime - System.currentTimeMillis();
  if (sleepTime > 0) {
    sleepMillis((int)sleepTime);
  }
  unblockMessagesFromInstance(server,client);
  assertEquals(expectedRegistrationsSize,getClientEventRegistrations(client,registrationId).size());
  validateListenerFunctionality(eventCount);
  assertTrue(removeListener(registrationId));
}

Fixed version (ground truth):
private void testListenersTemporaryNetworkBlockage(){
  setupListener();
  HazelcastClientInstanceImpl clientInstanceImpl=getHazelcastClientInstanceImpl(client);
  HazelcastInstance server=getOwnerServer(factory,clientInstanceImpl);
  long timeout=clientInstanceImpl.getProperties().getMillis(HEARTBEAT_TIMEOUT);
  long heartbeatTimeout=timeout > 0 ? timeout : Integer.parseInt(HEARTBEAT_TIMEOUT.getDefaultValue());
  long waitTime=heartbeatTimeout / 2;
  long endTime=System.currentTimeMillis() + waitTime;
  blockMessagesFromInstance(server,client);
  long sleepTime=endTime - System.currentTimeMillis();
  if (sleepTime > 0) {
    sleepMillis((int)sleepTime);
  }
  unblockMessagesFromInstance(server,client);
  validateRegistrationsAndListenerFunctionality();
}
Program: 46282
Project: 46282
Buggy source:
@Test public void testClusterReconnectMultipleServersDueToHeartbeatSmartRouting() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersForHeartbeat();
}

Fixed version (ground truth):
@Test public void testClusterReconnectMultipleServersDueToHeartbeatSmartRouting(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersHeartbeatTimeoutToOwner();
}
Program: 46283
Project: 46283
Buggy source:
@Test public void testClusterReconnectMultipleServerDueToHeartbeatNonSmartRouting() throws InterruptedException {
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersForHeartbeat();
}

Fixed version (ground truth):
@Test public void testClusterReconnectMultipleServerDueToHeartbeatNonSmartRouting(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersHeartbeatTimeoutToOwner();
}
Program: 46284
Project: 46284
Buggy source:
@Test public void testListenersNonSmartRoutingTerminateRandomNode() throws InterruptedException {
  factory.newHazelcastInstance();
  ClientConfig clientConfig=createClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(false);
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNodeInternal();
}

Fixed version (ground truth):
@Test public void testListenersNonSmartRoutingTerminateRandomNode(){
  factory.newInstances(null,3);
  ClientConfig clientConfig=getNonSmartClientConfig();
  client=factory.newHazelcastClient(clientConfig);
  testListenersTerminateRandomNode();
}
Program: 46285
Project: 46285
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iMap=client.getMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return iMap.addEntryListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iMap=client.getMap(randomString());
  final EntryAdapter<Object,Object> listener=new EntryAdapter<Object,Object>(){
    public void onEntryEvent(    EntryEvent<Object,Object> event){
      eventCount.incrementAndGet();
    }
  }
;
  return iMap.addEntryListener(listener,true);
}
Program: 46286
Project: 46286
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iList=client.getList(randomString());
  ItemListener<String> listener=new ItemListener<String>(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iList.addItemListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iList=client.getList(randomString());
  ItemListener<String> listener=new ItemListener<String>(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iList.addItemListener(listener,true);
}
Program: 46287
Project: 46287
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  multiMap=client.getMultiMap(randomString());
  EntryAdapter<String,String> listener=new EntryAdapter<String,String>(){
    @Override public void onEntryEvent(    EntryEvent<String,String> event){
      eventCount.incrementAndGet();
    }
  }
;
  return multiMap.addEntryListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  multiMap=client.getMultiMap(randomString());
  EntryAdapter<String,String> listener=new EntryAdapter<String,String>(){
    @Override public void onEntryEvent(    EntryEvent<String,String> event){
      eventCount.incrementAndGet();
    }
  }
;
  return multiMap.addEntryListener(listener,true);
}
Program: 46288
Project: 46288
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iQueue=client.getQueue(randomString());
  ItemListener<String> listener=new ItemListener<String>(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iQueue.addItemListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iQueue=client.getQueue(randomString());
  ItemListener<String> listener=new ItemListener<String>(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iQueue.addItemListener(listener,true);
}
Program: 46289
Project: 46289
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  replicatedMap=client.getReplicatedMap(randomString());
  final EntryAdapter<String,String> listener=new EntryAdapter<String,String>(){
    @Override public void onEntryEvent(    EntryEvent<String,String> event){
      eventCount.incrementAndGet();
    }
  }
;
  return replicatedMap.addEntryListener(listener);
}

Fixed version (ground truth):
@Override protected String addListener(){
  replicatedMap=client.getReplicatedMap(randomString());
  final EntryAdapter<String,String> listener=new EntryAdapter<String,String>(){
    @Override public void onEntryEvent(    EntryEvent<String,String> event){
      eventCount.incrementAndGet();
    }
  }
;
  return replicatedMap.addEntryListener(listener);
}
Program: 46290
Project: 46290
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  iSet=client.getSet(randomString());
  ItemListener<String> listener=new ItemListener<String>(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iSet.addItemListener(listener,true);
}

Fixed version (ground truth):
@Override protected String addListener(){
  iSet=client.getSet(randomString());
  ItemListener<String> listener=new ItemListener<String>(){
    @Override public void itemAdded(    ItemEvent item){
      eventCount.incrementAndGet();
    }
    @Override public void itemRemoved(    ItemEvent item){
    }
  }
;
  return iSet.addItemListener(listener,true);
}
Program: 46291
Project: 46291
Buggy source:
@Override protected String addListener(final AtomicInteger eventCount){
  topic=client.getTopic(randomString());
  MessageListener<String> listener=new MessageListener<String>(){
    @Override public void onMessage(    Message message){
      eventCount.incrementAndGet();
    }
  }
;
  return topic.addMessageListener(listener);
}

Fixed version (ground truth):
@Override protected String addListener(){
  topic=client.getTopic(randomString());
  MessageListener<String> listener=new MessageListener<String>(){
    @Override public void onMessage(    Message message){
      eventCount.incrementAndGet();
    }
  }
;
  return topic.addMessageListener(listener);
}
Program: 46292
Project: 46292
Buggy source:
private URL newGetTaskUrl() throws MalformedURLException {
  GroupConfig groupConfig=instance.getConfig().getGroupConfig();
  Address localAddress=instance.node.getClusterService().getLocalMember().getAddress();
  String urlString=cleanupUrl(managementCenterUrl) + "String_Node_Str" + localAddress.getHost()+ "String_Node_Str"+ localAddress.getPort()+ "String_Node_Str"+ groupConfig.getName();
  return new URL(urlString);
}

Fixed version (ground truth):
private URL newGetTaskUrl() throws IOException {
  GroupConfig groupConfig=instance.getConfig().getGroupConfig();
  Address localAddress=instance.node.getClusterService().getLocalMember().getAddress();
  String urlString=cleanupUrl(managementCenterUrl) + "String_Node_Str" + localAddress.getHost()+ "String_Node_Str"+ localAddress.getPort()+ "String_Node_Str"+ encode(groupConfig.getName(),"String_Node_Str");
  return new URL(urlString);
}
Program: 46293
Project: 46293
Buggy source:
private Config getManagementCenterConfig(){
  Config config=new Config();
  config.getManagementCenterConfig().setEnabled(true);
  config.getManagementCenterConfig().setUrl(format("String_Node_Str",portNum,"String_Node_Str"));
  return config;
}

Fixed version (ground truth):
private Config getManagementCenterConfig(){
  Config config=new Config();
  config.getGroupConfig().setName("String_Node_Str").setPassword("String_Node_Str");
  config.getManagementCenterConfig().setEnabled(true);
  config.getManagementCenterConfig().setUrl(format("String_Node_Str",portNum,"String_Node_Str"));
  return config;
}
Program: 46294
Project: 46294
Buggy source:
@Override public void run() throws Exception {
  CloseableHttpClient client=HttpClientBuilder.create().disableRedirectHandling().build();
  HttpUriRequest request=new HttpGet("String_Node_Str" + portNum + "String_Node_Str");
  HttpResponse response=client.execute(request);
  HttpEntity entity=response.getEntity();
  String responseString=EntityUtils.toString(entity);
  assertNotEquals("String_Node_Str",responseString);
  JsonObject object=JsonObject.readFrom(responseString);
  TimedMemberState memberState=new TimedMemberState();
  memberState.fromJson(object);
  assertEquals("String_Node_Str",memberState.getClusterName());
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  CloseableHttpClient client=HttpClientBuilder.create().disableRedirectHandling().build();
  HttpUriRequest request=new HttpGet("String_Node_Str" + portNum + "String_Node_Str");
  HttpResponse response=client.execute(request);
  HttpEntity entity=response.getEntity();
  String responseString=EntityUtils.toString(entity);
  assertEquals("String_Node_Str",responseString);
}
Program: 46295
Project: 46295
Buggy source:
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  if (req.getPathInfo().contains("String_Node_Str")) {
    if (memberState != null) {
      resp.getWriter().write(memberState.toJson().toString());
    }
 else {
      resp.getWriter().write("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override protected void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  if (req.getPathInfo().contains("String_Node_Str")) {
    if (memberState != null) {
      resp.getWriter().write(memberState.toJson().toString());
    }
 else {
      resp.getWriter().write("String_Node_Str");
    }
  }
 else   if (req.getPathInfo().contains("String_Node_Str")) {
    clusterName=req.getParameter("String_Node_Str");
    resp.getWriter().write("String_Node_Str");
  }
 else   if (req.getPathInfo().contains("String_Node_Str")) {
    resp.getWriter().write(clusterName);
  }
}
Program: 46296
Project: 46296
Buggy source:
@Test(timeout=10000) public void test_doNotRescheduleEntryWithinSameSecond_postpone(){
  scheduler=new SecondsBasedEntryTaskScheduler<Integer,Integer>(executorService,entryProcessor,POSTPONE);
  int delayMillis=0;
  int startSecond;
  boolean firstResult;
  boolean secondResult;
  int stopSecond;
  do {
    startSecond=findRelativeSecond(delayMillis);
    firstResult=scheduler.schedule(delayMillis,1,1);
    secondResult=scheduler.schedule(delayMillis,1,1);
    stopSecond=findRelativeSecond(delayMillis);
  }
 while (startSecond != stopSecond);
  assertTrue("String_Node_Str",firstResult);
  assertFalse("String_Node_Str",secondResult);
  assertNotNull(scheduler.get(1));
  assertEquals(1,scheduler.size());
}

Fixed version (ground truth):
@Test(timeout=10000) public void test_doNotRescheduleEntryWithinSameSecond_postpone(){
  scheduler=new SecondsBasedEntryTaskScheduler<Integer,Integer>(executorService,entryProcessor,POSTPONE);
  final int delayMillis=0;
  final int key=1;
  int startSecond;
  boolean firstResult;
  boolean secondResult;
  int stopSecond=0;
  do {
    while ((startSecond=findRelativeSecond(delayMillis)) == stopSecond) {
      sleepMillis(1);
    }
    firstResult=scheduler.schedule(delayMillis,key,1);
    secondResult=scheduler.schedule(delayMillis,key,1);
    stopSecond=findRelativeSecond(delayMillis);
  }
 while (startSecond != stopSecond);
  assertTrue("String_Node_Str",firstResult);
  assertFalse("String_Node_Str",secondResult);
  assertNotNull(scheduler.get(key));
  assertEquals(1,scheduler.size());
}
Program: 46297
Project: 46297
Buggy source:
private void appendDate(){
  write(calendar.get(DAY_OF_MONTH));
  write('-');
  write(calendar.get(MONTH));
  write('-');
  write(calendar.get(YEAR));
}

Fixed version (ground truth):
private void appendDate(){
  write(calendar.get(DAY_OF_MONTH));
  write('-');
  write(calendar.get(MONTH) + 1);
  write('-');
  write(calendar.get(YEAR));
}
Program: 46298
Project: 46298
Buggy source:
@Test(timeout=10000) public void test_doNotRescheduleEntryWithinSameSecond_postpone(){
  scheduler=new SecondsBasedEntryTaskScheduler<Integer,Integer>(executorService,entryProcessor,POSTPONE);
  int delayMillis=0;
  int startSecond;
  boolean firstResult;
  boolean secondResult;
  int stopSecond;
  do {
    startSecond=findRelativeSecond(delayMillis);
    firstResult=scheduler.schedule(delayMillis,1,1);
    secondResult=scheduler.schedule(delayMillis,1,1);
    stopSecond=findRelativeSecond(delayMillis);
  }
 while (startSecond != stopSecond);
  assertTrue("String_Node_Str",firstResult);
  assertFalse("String_Node_Str",secondResult);
  assertNotNull(scheduler.get(1));
  assertEquals(1,scheduler.size());
}

Fixed version (ground truth):
@Test(timeout=10000) public void test_doNotRescheduleEntryWithinSameSecond_postpone(){
  scheduler=new SecondsBasedEntryTaskScheduler<Integer,Integer>(executorService,entryProcessor,POSTPONE);
  final int delayMillis=0;
  final int key=1;
  int startSecond;
  boolean firstResult;
  boolean secondResult;
  int stopSecond=0;
  do {
    while ((startSecond=findRelativeSecond(delayMillis)) == stopSecond) {
      sleepMillis(1);
    }
    firstResult=scheduler.schedule(delayMillis,key,1);
    secondResult=scheduler.schedule(delayMillis,key,1);
    stopSecond=findRelativeSecond(delayMillis);
  }
 while (startSecond != stopSecond);
  assertTrue("String_Node_Str",firstResult);
  assertFalse("String_Node_Str",secondResult);
  assertNotNull(scheduler.get(key));
  assertEquals(1,scheduler.size());
}
Program: 46299
Project: 46299
Buggy source:
public void onFailure(Throwable t){
}

Fixed version (ground truth):
public void onFailure(Throwable t){
  resetToUnmarkedState(keyData);
}
Program: 46300
Project: 46300
Buggy source:
@Override public void putAll(Map<? extends K,? extends V> map,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  ensureOpen();
  validateNotNull(map);
  ClientPartitionService partitionService=clientContext.getPartitionService();
  int partitionCount=partitionService.getPartitionCount();
  try {
    Map<Data,Boolean> markers=createHashMap(map.size());
    List<Map.Entry<Data,Data>>[] entriesPerPartition=groupDataToPartitions(map,partitionService,partitionCount);
    putToAllPartitionsAndWaitForCompletion(entriesPerPartition,expiryPolicy,start,markers);
  }
 catch (  Exception e) {
    throw rethrow(e);
  }
}

Fixed version (ground truth):
@Override public void putAll(Map<? extends K,? extends V> map,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  ensureOpen();
  validateNotNull(map);
  ClientPartitionService partitionService=clientContext.getPartitionService();
  int partitionCount=partitionService.getPartitionCount();
  Map<Data,Boolean> markers=createHashMap(map.size());
  try {
    List<Map.Entry<Data,Data>>[] entriesPerPartition=groupDataToPartitions(map,partitionService,partitionCount);
    putToAllPartitionsAndWaitForCompletion(entriesPerPartition,expiryPolicy,start,markers);
  }
 catch (  Exception e) {
    throw rethrow(e);
  }
 finally {
    unmarkRemainingMarkedKeys(markers);
  }
}
Program: 46301
Project: 46301
Buggy source:
@Override public Map<K,V> getAll(Set<? extends K> keys,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  ensureOpen();
  validateNotNull(keys);
  if (keys.isEmpty()) {
    return Collections.EMPTY_MAP;
  }
  final Set<Data> keySet=new HashSet<Data>(keys.size());
  for (  K key : keys) {
    final Data k=toData(key);
    keySet.add(k);
  }
  Map<K,V> result=getAllFromNearCache(keySet);
  if (keySet.isEmpty()) {
    return result;
  }
  Map<Data,Boolean> markers=createHashMap(keySet.size());
  for (  Data key : keySet) {
    markers.put(key,keyStateMarker.tryMark(key));
  }
  Data expiryPolicyData=toData(expiryPolicy);
  ClientMessage request=CacheGetAllCodec.encodeRequest(nameWithPrefix,keySet,expiryPolicyData);
  ClientMessage responseMessage=invoke(request);
  List<Map.Entry<Data,Data>> entries=CacheGetAllCodec.decodeResponse(responseMessage).response;
  for (  Map.Entry<Data,Data> dataEntry : entries) {
    Data keyData=dataEntry.getKey();
    Data valueData=dataEntry.getValue();
    K key=toObject(keyData);
    V value=toObject(valueData);
    result.put(key,value);
    storeInNearCache(keyData,valueData,value,markers.get(keyData));
  }
  if (statisticsEnabled) {
    statistics.increaseCacheHits(entries.size());
    statistics.addGetTimeNanos(System.nanoTime() - start);
  }
  return result;
}

Fixed version (ground truth):
@Override public Map<K,V> getAll(Set<? extends K> keys,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  ensureOpen();
  validateNotNull(keys);
  if (keys.isEmpty()) {
    return Collections.EMPTY_MAP;
  }
  final Set<Data> keySet=new HashSet<Data>(keys.size());
  for (  K key : keys) {
    final Data k=toData(key);
    keySet.add(k);
  }
  Map<K,V> result=getAllFromNearCache(keySet);
  if (keySet.isEmpty()) {
    return result;
  }
  List<Map.Entry<Data,Data>> entries;
  Map<Data,Boolean> markers=createHashMap(keySet.size());
  try {
    for (    Data key : keySet) {
      markers.put(key,keyStateMarker.markIfUnmarked(key));
    }
    Data expiryPolicyData=toData(expiryPolicy);
    ClientMessage request=CacheGetAllCodec.encodeRequest(nameWithPrefix,keySet,expiryPolicyData);
    ClientMessage responseMessage=invoke(request);
    entries=CacheGetAllCodec.decodeResponse(responseMessage).response;
    for (    Map.Entry<Data,Data> dataEntry : entries) {
      Data keyData=dataEntry.getKey();
      Data valueData=dataEntry.getValue();
      K key=toObject(keyData);
      V value=toObject(valueData);
      result.put(key,value);
      storeInNearCache(keyData,valueData,value,markers.remove(keyData));
    }
  }
  finally {
    unmarkRemainingMarkedKeys(markers);
  }
  if (statisticsEnabled) {
    statistics.increaseCacheHits(entries.size());
    statistics.addGetTimeNanos(System.nanoTime() - start);
  }
  return result;
}
Program: 46303
Project: 46303
Buggy source:
private void putToAllPartitionsAndWaitForCompletion(List<Map.Entry<Data,Data>>[] entriesPerPartition,ExpiryPolicy expiryPolicy,long start,Map<Data,Boolean> markers) throws ExecutionException, InterruptedException {
  Data expiryPolicyData=toData(expiryPolicy);
  List<FutureEntriesTuple> futureEntriesTuples=new ArrayList<FutureEntriesTuple>(entriesPerPartition.length);
  for (int partitionId=0; partitionId < entriesPerPartition.length; partitionId++) {
    List<Map.Entry<Data,Data>> entries=entriesPerPartition[partitionId];
    if (entries != null) {
      for (      Map.Entry<Data,Data> entry : entries) {
        Data key=entry.getKey();
        markers.put(key,keyStateMarker.tryMark(key));
      }
      int completionId=nextCompletionId();
      ClientMessage request=CachePutAllCodec.encodeRequest(nameWithPrefix,entries,expiryPolicyData,completionId);
      Future f=invoke(request,partitionId,completionId);
      futureEntriesTuples.add(new FutureEntriesTuple(f,entries));
    }
  }
  waitResponseFromAllPartitionsForPutAll(futureEntriesTuples,start,markers);
}

Fixed version (ground truth):
private void putToAllPartitionsAndWaitForCompletion(List<Map.Entry<Data,Data>>[] entriesPerPartition,ExpiryPolicy expiryPolicy,long start,Map<Data,Boolean> markers) throws ExecutionException, InterruptedException {
  Data expiryPolicyData=toData(expiryPolicy);
  List<FutureEntriesTuple> futureEntriesTuples=new ArrayList<FutureEntriesTuple>(entriesPerPartition.length);
  for (int partitionId=0; partitionId < entriesPerPartition.length; partitionId++) {
    List<Map.Entry<Data,Data>> entries=entriesPerPartition[partitionId];
    if (entries != null) {
      for (      Map.Entry<Data,Data> entry : entries) {
        Data key=entry.getKey();
        markers.put(key,!cacheOnUpdate || keyStateMarker.markIfUnmarked(key));
      }
      int completionId=nextCompletionId();
      ClientMessage request=CachePutAllCodec.encodeRequest(nameWithPrefix,entries,expiryPolicyData,completionId);
      Future f=invoke(request,partitionId,completionId);
      futureEntriesTuples.add(new FutureEntriesTuple(f,entries));
    }
  }
  waitResponseFromAllPartitionsForPutAll(futureEntriesTuples,start,markers);
}
Program: 46304
Project: 46304
Buggy source:
private Object putInternalAsync(final V value,final boolean isGet,final long start,final Data keyData,final Data valueData,ClientInvocationFuture future,final boolean marked){
  OneShotExecutionCallback<V> oneShotExecutionCallback=null;
  if (nearCache != null || statisticsEnabled) {
    oneShotExecutionCallback=new OneShotExecutionCallback<V>(){
      @Override protected void onResponseInternal(      V responseData){
        if (nearCache != null) {
          if (cacheOnUpdate) {
            storeInNearCache(keyData,valueData,value,marked);
          }
 else {
            invalidateNearCache(keyData);
          }
        }
        if (statisticsEnabled) {
          handleStatisticsOnPut(isGet,start,responseData);
        }
      }
      @Override protected void onFailureInternal(      Throwable t){
      }
    }
;
  }
  SerializationService serializationService=clientContext.getSerializationService();
  if (oneShotExecutionCallback == null) {
    return new ClientDelegatingFuture<V>(future,serializationService,PUT_RESPONSE_DECODER);
  }
  ClientDelegatingFuture<V> delegatingFuture=new CallbackAwareClientDelegatingFuture<V>(future,serializationService,PUT_RESPONSE_DECODER,oneShotExecutionCallback);
  delegatingFuture.andThen(oneShotExecutionCallback);
  return delegatingFuture;
}

Fixed version (ground truth):
private Object putInternalAsync(final V value,final boolean isGet,final long start,final Data keyData,final Data valueData,ClientInvocationFuture future,final boolean marked){
  OneShotExecutionCallback<V> oneShotExecutionCallback=null;
  if (nearCache != null || statisticsEnabled) {
    oneShotExecutionCallback=new OneShotExecutionCallback<V>(){
      @Override protected void onResponseInternal(      V responseData){
        if (nearCache != null) {
          if (cacheOnUpdate) {
            storeInNearCache(keyData,valueData,value,marked);
          }
 else {
            invalidateNearCache(keyData);
          }
        }
        if (statisticsEnabled) {
          handleStatisticsOnPut(isGet,start,responseData);
        }
      }
      @Override protected void onFailureInternal(      Throwable t){
        if (nearCache != null && cacheOnUpdate) {
          resetToUnmarkedState(keyData);
        }
      }
    }
;
  }
  SerializationService serializationService=clientContext.getSerializationService();
  if (oneShotExecutionCallback == null) {
    return new ClientDelegatingFuture<V>(future,serializationService,PUT_RESPONSE_DECODER);
  }
  ClientDelegatingFuture<V> delegatingFuture=new CallbackAwareClientDelegatingFuture<V>(future,serializationService,PUT_RESPONSE_DECODER,oneShotExecutionCallback);
  delegatingFuture.andThen(oneShotExecutionCallback);
  return delegatingFuture;
}
Program: 46305
Project: 46305
Buggy source:
protected Object putInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean isGet,boolean withCompletionEvent,boolean async){
  long start=System.nanoTime();
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  Data keyData=toData(key);
  Data valueData=toData(value);
  Data expiryPolicyData=toData(expiryPolicy);
  boolean marked=cacheOnUpdate ? keyStateMarker.tryMark(keyData) : true;
  int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ClientMessage request=CachePutCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData,isGet,completionId);
  ClientInvocationFuture future;
  try {
    future=invoke(request,keyData,completionId);
  }
 catch (  Exception e) {
    throw rethrow(e);
  }
  if (async) {
    return putInternalAsync(value,isGet,start,keyData,valueData,future,marked);
  }
  return putInternalSync(value,isGet,start,keyData,valueData,future,marked);
}

Fixed version (ground truth):
protected Object putInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean isGet,boolean withCompletionEvent,boolean async){
  long start=System.nanoTime();
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  Data keyData=toData(key);
  Data valueData=toData(value);
  Data expiryPolicyData=toData(expiryPolicy);
  boolean marked=!cacheOnUpdate || keyStateMarker.markIfUnmarked(keyData);
  int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ClientMessage request=CachePutCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData,isGet,completionId);
  ClientInvocationFuture future;
  try {
    future=invoke(request,keyData,completionId);
  }
 catch (  Exception e) {
    resetToUnmarkedState(keyData);
    throw rethrow(e);
  }
  if (async) {
    return putInternalAsync(value,isGet,start,keyData,valueData,future,marked);
  }
  return putInternalSync(value,isGet,start,keyData,valueData,future,marked);
}
Program: 46306
Project: 46306
Buggy source:
@Override protected void onFailureInternal(Throwable t){
}

Fixed version (ground truth):
@Override protected void onFailureInternal(Throwable t){
  if (nearCache != null && cacheOnUpdate) {
    resetToUnmarkedState(keyData);
  }
}
Program: 46307
Project: 46307
Buggy source:
@Override public void onFailure(Throwable t){
}

Fixed version (ground truth):
@Override public void onFailure(Throwable t){
  if (nearCache != null && cacheOnUpdate) {
    resetToUnmarkedState(keyData);
  }
}
Program: 46308
Project: 46308
Buggy source:
protected void storeInNearCache(Data key,Data valueData,V value,boolean marked){
  if (nearCache != null && valueData != null && marked) {
    Object valueToStore=nearCache.selectToSave(value,valueData);
    try {
      nearCache.put(key,valueToStore);
    }
  finally {
      if (!keyStateMarker.tryUnmark(key)) {
        invalidateNearCache(key);
        keyStateMarker.forceUnmark(key);
      }
    }
  }
}

Fixed version (ground truth):
protected void storeInNearCache(Data key,Data valueData,V value,boolean marked){
  if (!marked) {
    return;
  }
  try {
    if (nearCache == null || valueData == null) {
      return;
    }
    Object valueToStore=nearCache.selectToSave(value,valueData);
    nearCache.put(key,valueToStore);
  }
  finally {
    resetToUnmarkedState(key);
  }
}