nus-yam/ex-repair huggingface dataset:
Program: 48731
Project: 48731
Buggy source:
private static void checkMapSizes(final int expectedSize,int backupCount,HazelcastInstance... instances) throws InterruptedException {
  int nodeCount=0;
  final IMap[] maps=new IMap[instances.length];
  for (int i=0; i < 20; i++) {
    for (int j=0; j < instances.length; j++) {
      final HazelcastInstance hz=instances[j];
      if (hz != null) {
        if (i == 0) {
          maps[j]=hz.getMap(MAP_NAME);
          nodeCount++;
        }
        assertEquals(expectedSize,maps[j].size());
      }
    }
    Thread.sleep(10);
  }
  final int expectedBackupSize=Math.min(nodeCount - 1,backupCount) * expectedSize;
  for (int i=0; i < 100; i++) {
    long ownedSize=getTotalOwnedEntryCount(maps);
    long backupSize=getTotalBackupEntryCount(maps);
    if (ownedSize == expectedSize && backupSize == expectedBackupSize) {
      int votes=0;
      for (      HazelcastInstance hz : instances) {
        if (hz != null) {
          votes+=TestUtil.getNode(hz).getPartitionService().hasOnGoingMigration() ? 0 : 1;
        }
      }
      if (votes == nodeCount) {
        break;
      }
    }
    Thread.sleep(250);
  }
  long backupSize=getTotalBackupEntryCount(maps);
  assertEquals("String_Node_Str" + nodeCount,expectedBackupSize,backupSize);
}

Fixed version (ground truth):
private static void checkMapSizes(final int expectedSize,int backupCount,HazelcastInstance... instances) throws InterruptedException {
  int nodeCount=0;
  final IMap[] maps=new IMap[instances.length];
  for (int i=0; i < 20; i++) {
    for (int j=0; j < instances.length; j++) {
      final HazelcastInstance hz=instances[j];
      if (hz != null) {
        if (i == 0) {
          maps[j]=hz.getMap(MAP_NAME);
          nodeCount++;
        }
        assertEquals(expectedSize,maps[j].size());
      }
    }
    Thread.sleep(10);
  }
  final int expectedBackupSize=Math.min(nodeCount - 1,backupCount) * expectedSize;
  for (int i=0; i < 1200; i++) {
    long ownedSize=getTotalOwnedEntryCount(maps);
    long backupSize=getTotalBackupEntryCount(maps);
    if (ownedSize == expectedSize && backupSize == expectedBackupSize) {
      int votes=0;
      for (      HazelcastInstance hz : instances) {
        if (hz != null) {
          votes+=TestUtil.getNode(hz).getPartitionService().hasOnGoingMigration() ? 0 : 1;
        }
      }
      if (votes == nodeCount) {
        break;
      }
    }
    Thread.sleep(500);
  }
  long backupSize=getTotalBackupEntryCount(maps);
  assertEquals("String_Node_Str" + nodeCount,expectedBackupSize,backupSize);
}
Program: 48736
Project: 48736
Buggy source:
@Test public void testAsyncRemove() throws Exception {
  fillMap();
  Future f=map.removeAsync("String_Node_Str");
  Object o=null;
  try {
    o=f.get(0,TimeUnit.MILLISECONDS);
  }
 catch (  TimeoutException e) {
  }
  assertNull(o);
  o=f.get();
  assertEquals("String_Node_Str",o);
  assertEquals(9,map.size());
}

Fixed version (ground truth):
@Test public void testAsyncRemove() throws Exception {
  fillMap();
  Future f=map.removeAsync("String_Node_Str");
  Object o=f.get();
  assertEquals("String_Node_Str",o);
  assertEquals(9,map.size());
}
Program: 48737
Project: 48737
Buggy source:
@Test public void testAsyncGet() throws Exception {
  fillMap();
  Future f=map.getAsync("String_Node_Str");
  Object o=null;
  try {
    o=f.get(0,TimeUnit.MILLISECONDS);
  }
 catch (  TimeoutException e) {
  }
  assertNull(o);
  o=f.get();
  assertEquals("String_Node_Str",o);
}

Fixed version (ground truth):
@Test public void testAsyncGet() throws Exception {
  fillMap();
  Future f=map.getAsync("String_Node_Str");
  Object o=f.get();
  assertEquals("String_Node_Str",o);
}
Program: 48738
Project: 48738
Buggy source:
@Test public void testAsyncPut() throws Exception {
  fillMap();
  Future f=map.putAsync("String_Node_Str","String_Node_Str");
  Object o=null;
  try {
    o=f.get(0,TimeUnit.MILLISECONDS);
  }
 catch (  TimeoutException e) {
  }
  assertNull(o);
  o=f.get();
  assertEquals("String_Node_Str",o);
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testAsyncPut() throws Exception {
  fillMap();
  Future f=map.putAsync("String_Node_Str","String_Node_Str");
  Object o=f.get();
  assertEquals("String_Node_Str",o);
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
}
Program: 48739
Project: 48739
Buggy source:
@Test public void testAsyncRemove() throws Exception {
  fillMap();
  Future f=map.removeAsync("String_Node_Str");
  Object o=null;
  try {
    o=f.get(0,TimeUnit.MILLISECONDS);
  }
 catch (  TimeoutException e) {
  }
  assertNull(o);
  o=f.get();
  assertEquals("String_Node_Str",o);
  assertEquals(9,map.size());
}

Fixed version (ground truth):
@Test public void testAsyncRemove() throws Exception {
  fillMap();
  Future f=map.removeAsync("String_Node_Str");
  Object o=f.get();
  assertEquals("String_Node_Str",o);
  assertEquals(9,map.size());
}
Program: 48740
Project: 48740
Buggy source:
@Test public void testAsyncPut() throws Exception {
  fillMap();
  Future f=map.putAsync("String_Node_Str","String_Node_Str");
  Object o=null;
  try {
    o=f.get(0,TimeUnit.MILLISECONDS);
  }
 catch (  TimeoutException e) {
  }
  assertNull(o);
  o=f.get();
  assertEquals("String_Node_Str",o);
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testAsyncPut() throws Exception {
  fillMap();
  Future f=map.putAsync("String_Node_Str","String_Node_Str");
  Object o=f.get();
  assertEquals("String_Node_Str",o);
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
}
Program: 48741
Project: 48741
Buggy source:
@Test public void testAsyncGet() throws Exception {
  fillMap();
  Future f=map.getAsync("String_Node_Str");
  Object o=null;
  try {
    o=f.get(0,TimeUnit.MILLISECONDS);
  }
 catch (  TimeoutException e) {
  }
  assertNull(o);
  o=f.get();
  assertEquals("String_Node_Str",o);
}

Fixed version (ground truth):
@Test public void testAsyncGet() throws Exception {
  fillMap();
  Future f=map.getAsync("String_Node_Str");
  Object o=f.get();
  assertEquals("String_Node_Str",o);
}
Program: 48742
Project: 48742
Buggy source:
public void run(){
  Map.Entry<Data,Object> mapEntry=recordStore.getMapEntryObject(dataKey);
  if (mapEntry.getValue() != null) {
    Map.Entry<Object,Object> entry=new AbstractMap.SimpleEntry<Object,Object>(mapService.toObject(dataKey),mapEntry.getValue());
    entryProcessor.processBackup(entry);
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,entry.getValue()));
  }
}

Fixed version (ground truth):
public void run(){
  Map.Entry<Data,Object> mapEntry=recordStore.getMapEntryForBackup(dataKey);
  if (mapEntry.getValue() != null) {
    Map.Entry<Object,Object> entry=new AbstractMap.SimpleEntry<Object,Object>(mapService.toObject(dataKey),mapService.toObject(mapEntry.getValue()));
    entryProcessor.processBackup(entry);
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,entry.getValue()));
  }
}
Program: 48743
Project: 48743
Buggy source:
public void run(){
  Map.Entry<Data,Data> mapEntry=recordStore.getMapEntryData(dataKey);
  dataOldValue=mapEntry.getValue();
  final Object valueBeforeProcess=mapService.toObject(dataOldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (dataOldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (dataOldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    dataValue=mapService.toData(entry.getValue());
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
  }
}

Fixed version (ground truth):
public void run(){
  oldValue=recordStore.getMapEntry(dataKey).getValue();
  final Object valueBeforeProcess=mapService.toObject(oldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (oldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (oldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      dataValue=mapService.toData(entry.getValue());
      recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
    }
  }
}
Program: 48744
Project: 48744
Buggy source:
public void afterRun() throws Exception {
  super.afterRun();
  if (eventType == __NO_NEED_TO_FIRE_EVENT) {
    return;
  }
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,dataOldValue,dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      Record record=recordStore.getRecord(dataKey);
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),record.getStatistics(),record.getVersion());
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}

Fixed version (ground truth):
public void afterRun() throws Exception {
  super.afterRun();
  if (eventType == __NO_NEED_TO_FIRE_EVENT) {
    return;
  }
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,mapService.toData(oldValue),dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      Record record=recordStore.getRecord(dataKey);
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),record.getStatistics(),record.getVersion());
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}
Program: 48747
Project: 48747
Buggy source:
public void run(){
  Map.Entry<Data,Object> mapEntry=recordStore.getMapEntryObject(dataKey);
  if (mapEntry.getValue() != null) {
    Map.Entry<Object,Object> entry=new AbstractMap.SimpleEntry<Object,Object>(mapService.toObject(dataKey),mapEntry.getValue());
    entryProcessor.processBackup(entry);
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,entry.getValue()));
  }
}

Fixed version (ground truth):
public void run(){
  Map.Entry<Data,Object> mapEntry=recordStore.getMapEntryForBackup(dataKey);
  if (mapEntry.getValue() != null) {
    Map.Entry<Object,Object> entry=new AbstractMap.SimpleEntry<Object,Object>(mapService.toObject(dataKey),mapService.toObject(mapEntry.getValue()));
    entryProcessor.processBackup(entry);
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,entry.getValue()));
  }
}
Program: 48748
Project: 48748
Buggy source:
public void run(){
  Map.Entry<Data,Data> mapEntry=recordStore.getMapEntryData(dataKey);
  dataOldValue=mapEntry.getValue();
  final Object valueBeforeProcess=mapService.toObject(dataOldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (dataOldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (dataOldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    dataValue=mapService.toData(entry.getValue());
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
  }
}

Fixed version (ground truth):
public void run(){
  oldValue=recordStore.getMapEntry(dataKey).getValue();
  final Object valueBeforeProcess=mapService.toObject(oldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (oldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (oldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      dataValue=mapService.toData(entry.getValue());
      recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
    }
  }
}
Program: 48749
Project: 48749
Buggy source:
public void afterRun() throws Exception {
  super.afterRun();
  if (eventType == __NO_NEED_TO_FIRE_EVENT) {
    return;
  }
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,dataOldValue,dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      Record record=recordStore.getRecord(dataKey);
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),record.getStatistics(),record.getVersion());
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}

Fixed version (ground truth):
public void afterRun() throws Exception {
  super.afterRun();
  if (eventType == __NO_NEED_TO_FIRE_EVENT) {
    return;
  }
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,mapService.toData(oldValue),dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      Record record=recordStore.getRecord(dataKey);
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),record.getStatistics(),record.getVersion());
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}
Program: 48751
Project: 48751
Buggy source:
@Override public boolean contains(E expected){
  return invoke(new ContainsRequest(name,toData(expected)));
}

Fixed version (ground truth):
@Override public boolean contains(E expected){
  return (Boolean)invoke(new ContainsRequest(name,toData(expected)));
}
Program: 48752
Project: 48752
Buggy source:
@Override public boolean compareAndSet(E expect,E update){
  return invoke(new CompareAndSetRequest(name,toData(expect),toData(update)));
}

Fixed version (ground truth):
@Override public boolean compareAndSet(E expect,E update){
  return (Boolean)invoke(new CompareAndSetRequest(name,toData(expect),toData(update)));
}
Program: 48753
Project: 48753
Buggy source:
@Override public boolean isNull(){
  return invoke(new IsNullRequest(name));
}

Fixed version (ground truth):
@Override public boolean isNull(){
  return (Boolean)invoke(new IsNullRequest(name));
}
Program: 48754
Project: 48754
Buggy source:
public Operation prepareReplicationOperation(PartitionReplicationEvent event){
  if (event.getReplicaIndex() > 1) {
    return null;
  }
  Map<String,Data> data=new HashMap<String,Data>();
  final int partitionId=event.getPartitionId();
  for (  String name : references.keySet()) {
    if (partitionId == nodeEngine.getPartitionService().getPartitionId(StringPartitioningStrategy.getPartitionKey(name))) {
    }
  }
  return data.isEmpty() ? null : new AtomicReferenceReplicationOperation(data);
}

Fixed version (ground truth):
public Operation prepareReplicationOperation(PartitionReplicationEvent event){
  if (event.getReplicaIndex() > 1) {
    return null;
  }
  Map<String,Data> data=new HashMap<String,Data>();
  final int partitionId=event.getPartitionId();
  for (  String name : references.keySet()) {
    if (partitionId == nodeEngine.getPartitionService().getPartitionId(StringPartitioningStrategy.getPartitionKey(name))) {
      data.put(name,references.get(name).get());
    }
  }
  return data.isEmpty() ? null : new AtomicReferenceReplicationOperation(data);
}
Program: 48755
Project: 48755
Buggy source:
@Override public boolean contains(E expected){
  NodeEngine nodeEngine=getNodeEngine();
  Operation operation=new ContainsOperation(name,nodeEngine.toData(expected));
  return invoke(operation,nodeEngine);
}

Fixed version (ground truth):
@Override public boolean contains(E expected){
  NodeEngine nodeEngine=getNodeEngine();
  Operation operation=new ContainsOperation(name,nodeEngine.toData(expected));
  return (Boolean)invoke(operation,nodeEngine);
}
Program: 48756
Project: 48756
Buggy source:
@Override public boolean compareAndSet(E expect,E update){
  NodeEngine nodeEngine=getNodeEngine();
  Operation operation=new CompareAndSetOperation(name,nodeEngine.toData(expect),nodeEngine.toData(update));
  return invoke(operation,nodeEngine);
}

Fixed version (ground truth):
@Override public boolean compareAndSet(E expect,E update){
  NodeEngine nodeEngine=getNodeEngine();
  Operation operation=new CompareAndSetOperation(name,nodeEngine.toData(expect),nodeEngine.toData(update));
  return (Boolean)invoke(operation,nodeEngine);
}
Program: 48757
Project: 48757
Buggy source:
@Override public boolean isNull(){
  Operation operation=new IsNullOperation(name);
  return invoke(operation,getNodeEngine());
}

Fixed version (ground truth):
@Override public boolean isNull(){
  Operation operation=new IsNullOperation(name);
  return (Boolean)invoke(operation,getNodeEngine());
}
Program: 48758
Project: 48758
Buggy source:
@Test public void testGetAllKeys() throws Exception {
  TestEventBasedMapStore testMapStore=new TestEventBasedMapStore();
  Map store=testMapStore.getStore();
  Set keys=new HashSet();
  int size=1000;
  for (int i=0; i < size; i++) {
    store.put(i,"String_Node_Str" + i);
    keys.add(i);
  }
  Config config=newConfig(testMapStore,2);
  TestHazelcastInstanceFactory nodeFactory=createHazelcastInstanceFactory(3);
  HazelcastInstance h1=nodeFactory.newHazelcastInstance(config);
  HazelcastInstance h2=nodeFactory.newHazelcastInstance(config);
  IMap map1=h1.getMap("String_Node_Str");
  IMap map2=h2.getMap("String_Node_Str");
  Thread.sleep(10000);
  assertEquals("String_Node_Str",map1.get(1));
  assertEquals("String_Node_Str",map2.get(1));
  assertEquals(1000,map1.size());
  assertEquals(1000,map2.size());
  HazelcastInstance h3=nodeFactory.newHazelcastInstance(config);
  IMap map3=h3.getMap("String_Node_Str");
  assertEquals("String_Node_Str",map1.get(1));
  assertEquals("String_Node_Str",map2.get(1));
  assertEquals("String_Node_Str",map3.get(1));
  assertEquals(1000,map1.size());
  assertEquals(1000,map2.size());
  assertEquals(1000,map3.size());
  h3.getLifecycleService().shutdown();
  assertEquals("String_Node_Str",map1.get(1));
  assertEquals("String_Node_Str",map2.get(1));
  assertEquals(1000,map1.size());
  assertEquals(1000,map2.size());
}

Fixed version (ground truth):
@Test public void testGetAllKeys() throws Exception {
  TestEventBasedMapStore testMapStore=new TestEventBasedMapStore();
  Map store=testMapStore.getStore();
  Set keys=new HashSet();
  int size=1000;
  for (int i=0; i < size; i++) {
    store.put(i,"String_Node_Str" + i);
    keys.add(i);
  }
  Config config=newConfig(testMapStore,2);
  TestHazelcastInstanceFactory nodeFactory=createHazelcastInstanceFactory(3);
  HazelcastInstance h1=nodeFactory.newHazelcastInstance(config);
  HazelcastInstance h2=nodeFactory.newHazelcastInstance(config);
  IMap map1=h1.getMap("String_Node_Str");
  IMap map2=h2.getMap("String_Node_Str");
  checkIfMapLoaded("String_Node_Str",h1);
  checkIfMapLoaded("String_Node_Str",h2);
  assertEquals("String_Node_Str",map1.get(1));
  assertEquals("String_Node_Str",map2.get(1));
  assertEquals(1000,map1.size());
  assertEquals(1000,map2.size());
  HazelcastInstance h3=nodeFactory.newHazelcastInstance(config);
  IMap map3=h3.getMap("String_Node_Str");
  checkIfMapLoaded("String_Node_Str",h3);
  assertEquals("String_Node_Str",map1.get(1));
  assertEquals("String_Node_Str",map2.get(1));
  assertEquals("String_Node_Str",map3.get(1));
  assertEquals(1000,map1.size());
  assertEquals(1000,map2.size());
  assertEquals(1000,map3.size());
  h3.getLifecycleService().shutdown();
  assertEquals("String_Node_Str",map1.get(1));
  assertEquals("String_Node_Str",map2.get(1));
  assertEquals(1000,map1.size());
  assertEquals(1000,map2.size());
}
Program: 48759
Project: 48759
Buggy source:
public void run(){
  Map.Entry<Data,Data> mapEntry=recordStore.getMapEntryData(dataKey);
  dataOldValue=mapEntry.getValue();
  final Object valueBeforeProcess=mapService.toObject(dataOldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (dataOldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (dataOldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    dataValue=mapService.toData(entry.getValue());
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
  }
}

Fixed version (ground truth):
public void run(){
  final boolean isInMemoryObjectFormat=InMemoryFormat.OBJECT.equals(mapContainer.getMapConfig().getInMemoryFormat());
  oldValue=isInMemoryObjectFormat ? recordStore.getMapEntryObject(dataKey).getValue() : recordStore.getMapEntryData(dataKey).getValue();
  final Object valueBeforeProcess=mapService.toObject(oldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (oldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (oldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      dataValue=mapService.toData(entry.getValue());
      recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
    }
  }
}
Program: 48760
Project: 48760
Buggy source:
public void afterRun() throws Exception {
  super.afterRun();
  if (eventType == __NO_NEED_TO_FIRE_EVENT) {
    return;
  }
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,dataOldValue,dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      Record record=recordStore.getRecord(dataKey);
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),record.getStatistics(),record.getVersion());
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}

Fixed version (ground truth):
public void afterRun() throws Exception {
  super.afterRun();
  if (eventType == __NO_NEED_TO_FIRE_EVENT) {
    return;
  }
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,mapService.toData(oldValue),dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      Record record=recordStore.getRecord(dataKey);
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),record.getStatistics(),record.getVersion());
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}
Program: 48763
Project: 48763
Buggy source:
public void clearNearCache(String mapName){
  NearCache nearCache=getNearCache(mapName);
  nearCache.clear();
}

Fixed version (ground truth):
public void clearNearCache(String mapName){
  final NearCache nearCache=nearCacheMap.get(mapName);
  if (nearCache != null) {
    nearCache.clear();
  }
}
Program: 48764
Project: 48764
Buggy source:
private NearCache getNearCache(String mapName){
  return ConcurrencyUtil.getOrPutIfAbsent(nearCacheMap,mapName,nearCacheConstructor);
}

Fixed version (ground truth):
NearCache getNearCache(String mapName){
  return ConcurrencyUtil.getOrPutIfAbsent(nearCacheMap,mapName,nearCacheConstructor);
}
Program: 48765
Project: 48765
Buggy source:
public void invalidateAllNearCaches(String mapName,Set<Data> keys){
  if (keys == null || keys.isEmpty())   return;
  sendNearCacheOperation(new NearCacheKeySetInvalidationOperation(mapName,keys));
  for (  final Data key : keys) {
    invalidateNearCache(mapName,key);
  }
}

Fixed version (ground truth):
public void invalidateAllNearCaches(String mapName,Set<Data> keys){
  if (keys == null || keys.isEmpty())   return;
  Operation operation=new NearCacheKeySetInvalidationOperation(mapName,keys).setServiceName(SERVICE_NAME);
  Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
  for (  MemberImpl member : members) {
    try {
      if (member.localMember())       continue;
      nodeEngine.getOperationService().send(operation,member.getAddress());
    }
 catch (    Throwable throwable) {
      logger.warning(throwable);
    }
  }
  for (  final Data key : keys) {
    invalidateNearCache(mapName,key);
  }
}
Program: 48766
Project: 48766
Buggy source:
void clear(){
  cache.clear();
  resetSizeEstimator();
}

Fixed version (ground truth):
public void clear(){
  cache.clear();
  resetSizeEstimator();
}
Program: 48767
Project: 48767
Buggy source:
public NearCache(String mapName,MapService mapService){
  this.mapName=mapName;
  this.mapService=mapService;
  this.nodeEngine=mapService.getNodeEngine();
  this.mapContainer=mapService.getMapContainer(mapName);
  Config config=nodeEngine.getConfig();
  NearCacheConfig nearCacheConfig=config.findMapConfig(mapName).getNearCacheConfig();
  maxSize=nearCacheConfig.getMaxSize() <= 0 ? Integer.MAX_VALUE : nearCacheConfig.getMaxSize();
  maxIdleMillis=nearCacheConfig.getMaxIdleSeconds() * 1000;
  inMemoryFormat=nearCacheConfig.getInMemoryFormat();
  timeToLiveMillis=nearCacheConfig.getTimeToLiveSeconds() * 1000;
  invalidateOnChange=nearCacheConfig.isInvalidateOnChange();
  evictionPolicy=EvictionPolicy.valueOf(nearCacheConfig.getEvictionPolicy());
  cache=new ConcurrentHashMap<Data,CacheRecord>();
  canCleanUp=new AtomicBoolean(true);
  canEvict=new AtomicBoolean(true);
  lastCleanup=Clock.currentTimeMillis();
}

Fixed version (ground truth):
public NearCache(String mapName,MapService mapService){
  this.mapService=mapService;
  this.nodeEngine=mapService.getNodeEngine();
  this.mapContainer=mapService.getMapContainer(mapName);
  Config config=nodeEngine.getConfig();
  NearCacheConfig nearCacheConfig=config.findMapConfig(mapName).getNearCacheConfig();
  maxSize=nearCacheConfig.getMaxSize() <= 0 ? Integer.MAX_VALUE : nearCacheConfig.getMaxSize();
  maxIdleMillis=nearCacheConfig.getMaxIdleSeconds() * 1000;
  inMemoryFormat=nearCacheConfig.getInMemoryFormat();
  timeToLiveMillis=nearCacheConfig.getTimeToLiveSeconds() * 1000;
  evictionPolicy=EvictionPolicy.valueOf(nearCacheConfig.getEvictionPolicy());
  cache=new ConcurrentHashMap<Data,CacheRecord>();
  canCleanUp=new AtomicBoolean(true);
  canEvict=new AtomicBoolean(true);
  lastCleanup=Clock.currentTimeMillis();
}
Program: 48768
Project: 48768
Buggy source:
public void run(){
  final RecordStore recordStore=mapService.getExistingRecordStore(getPartitionId(),name);
  if (recordStore == null) {
    shouldBackup=false;
    return;
  }
  recordStore.clear();
}

Fixed version (ground truth):
public void run(){
  mapService.clearNearCache(name);
  final RecordStore recordStore=mapService.getExistingRecordStore(getPartitionId(),name);
  if (recordStore == null) {
    shouldBackup=false;
    return;
  }
  recordStore.clear();
}
Program: 48769
Project: 48769
Buggy source:
public void run(){
  mapService=getService();
  if (mapService.getMapContainer(mapName).isNearCacheEnabled()) {
    mapService.invalidateNearCache(mapName,key);
  }
 else {
    getLogger().warning("String_Node_Str" + mapName + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void run(){
  MapService mapService=getService();
  if (mapService.getMapContainer(mapName).isNearCacheEnabled()) {
    mapService.invalidateNearCache(mapName,key);
  }
 else {
    getLogger().warning("String_Node_Str" + mapName + "String_Node_Str");
  }
}
Program: 48770
Project: 48770
Buggy source:
public void clearInternal(){
  final String mapName=name;
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    ClearOperation clearOperation=new ClearOperation(mapName);
    clearOperation.setServiceName(SERVICE_NAME);
    nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,new BinaryOperationFactory(clearOperation,nodeEngine));
    if (getService().isNearCacheAndInvalidationEnabled(mapName)) {
      getService().invalidateAllNearCaches(mapName);
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
public void clearInternal(){
  final String mapName=name;
  final NodeEngine nodeEngine=getNodeEngine();
  try {
    ClearOperation clearOperation=new ClearOperation(mapName);
    clearOperation.setServiceName(SERVICE_NAME);
    nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,new BinaryOperationFactory(clearOperation,nodeEngine));
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48771
Project: 48771
Buggy source:
public Map.Entry<Data,Data> getMapEntryData(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    record=getRecordInternal(dataKey,true);
  }
 else {
    accessRecord(record);
  }
  final Data data=record != null ? mapService.toData(record.getValue()) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Data>(dataKey,data);
}

Fixed version (ground truth):
public Map.Entry<Data,Object> getMapEntryData(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    record=getRecordInternal(dataKey,true);
  }
 else {
    accessRecord(record);
  }
  final boolean isInMemoryObjectFormat=InMemoryFormat.OBJECT.equals(mapContainer.getMapConfig().getInMemoryFormat());
  final Object data=record != null ? (isInMemoryObjectFormat ? record.getValue() : mapService.toData(record.getValue())) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,data);
}
Program: 48772
Project: 48772
Buggy source:
Map.Entry<Data,Data> getMapEntryData(Data dataKey);

Fixed version (ground truth):
Map.Entry<Data,Object> getMapEntryData(Data dataKey);
Program: 48773
Project: 48773
Buggy source:
public void run(){
  final boolean isInMemoryObjectFormat=InMemoryFormat.OBJECT.equals(mapContainer.getMapConfig().getInMemoryFormat());
  oldValue=isInMemoryObjectFormat ? recordStore.getMapEntryObject(dataKey).getValue() : recordStore.getMapEntryData(dataKey).getValue();
  final Object valueBeforeProcess=mapService.toObject(oldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (oldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (oldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      dataValue=mapService.toData(entry.getValue());
      recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
    }
  }
}

Fixed version (ground truth):
public void run(){
  oldValue=recordStore.getMapEntryData(dataKey).getValue();
  final Object valueBeforeProcess=mapService.toObject(oldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (oldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (oldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      dataValue=mapService.toData(entry.getValue());
      recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
    }
  }
}
Program: 48774
Project: 48774
Buggy source:
public void run(){
  Map.Entry<Data,Data> mapEntry=recordStore.getMapEntryData(dataKey);
  dataOldValue=mapEntry.getValue();
  final Object valueBeforeProcess=mapService.toObject(dataOldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (dataOldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (dataOldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    dataValue=mapService.toData(entry.getValue());
    recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
  }
}

Fixed version (ground truth):
public void run(){
  final boolean isInMemoryObjectFormat=InMemoryFormat.OBJECT.equals(mapContainer.getMapConfig().getInMemoryFormat());
  oldValue=isInMemoryObjectFormat ? recordStore.getMapEntryObject(dataKey).getValue() : recordStore.getMapEntryData(dataKey).getValue();
  final Object valueBeforeProcess=mapService.toObject(oldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (oldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (oldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      dataValue=mapService.toData(entry.getValue());
      recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
    }
  }
}
Program: 48775
Project: 48775
Buggy source:
public void afterRun() throws Exception {
  super.afterRun();
  if (eventType == __NO_NEED_TO_FIRE_EVENT) {
    return;
  }
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,dataOldValue,dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      Record record=recordStore.getRecord(dataKey);
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),record.getStatistics(),record.getVersion());
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}

Fixed version (ground truth):
public void afterRun() throws Exception {
  super.afterRun();
  if (eventType == __NO_NEED_TO_FIRE_EVENT) {
    return;
  }
  mapService.publishEvent(getCallerAddress(),name,eventType,dataKey,mapService.toData(oldValue),dataValue);
  invalidateNearCaches();
  if (mapContainer.getWanReplicationPublisher() != null && mapContainer.getWanMergePolicy() != null) {
    if (EntryEventType.REMOVED.equals(eventType)) {
      mapService.publishWanReplicationRemove(name,dataKey,Clock.currentTimeMillis());
    }
 else {
      Record record=recordStore.getRecord(dataKey);
      SimpleEntryView entryView=new SimpleEntryView(dataKey,mapService.toData(dataValue),record.getStatistics(),record.getVersion());
      mapService.publishWanReplicationUpdate(name,entryView);
    }
  }
}
Program: 48777
Project: 48777
Buggy source:
public Map.Entry<Data,Data> getMapEntryData(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    record=getRecordInternal(dataKey);
  }
 else {
    accessRecord(record);
  }
  final Data data=record != null ? mapService.toData(record.getValue()) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Data>(dataKey,data);
}

Fixed version (ground truth):
public Map.Entry<Data,Object> getMapEntryData(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    record=getRecordInternal(dataKey,true);
  }
 else {
    accessRecord(record);
  }
  final boolean isInMemoryObjectFormat=InMemoryFormat.OBJECT.equals(mapContainer.getMapConfig().getInMemoryFormat());
  final Object data=record != null ? (isInMemoryObjectFormat ? record.getValue() : mapService.toData(record.getValue())) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,data);
}
Program: 48778
Project: 48778
Buggy source:
private Record getRecordInternal(Data dataKey){
  Record record=null;
  if (mapContainer.getStore() != null) {
    final Object value=mapContainer.getStore().load(mapService.toObject(dataKey));
    if (value != null) {
      record=mapService.createRecord(name,dataKey,value,-1);
      records.put(dataKey,record);
      saveIndex(record);
      updateSizeEstimator(calculateRecordSize(record));
    }
  }
  return record;
}

Fixed version (ground truth):
private Record getRecordInternal(Data dataKey,boolean enableIndex){
  Record record=null;
  if (mapContainer.getStore() != null) {
    final Object value=mapContainer.getStore().load(mapService.toObject(dataKey));
    if (value != null) {
      record=mapService.createRecord(name,dataKey,value,-1);
      records.put(dataKey,record);
      if (enableIndex) {
        saveIndex(record);
      }
      updateSizeEstimator(calculateRecordSize(record));
    }
  }
  return record;
}
Program: 48779
Project: 48779
Buggy source:
public Map.Entry<Data,Object> getMapEntryObject(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    record=getRecordInternal(dataKey);
  }
 else {
    accessRecord(record);
  }
  final Object value=record != null ? mapService.toObject(record.getValue()) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,value);
}

Fixed version (ground truth):
public Map.Entry<Data,Object> getMapEntryObject(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    record=getRecordInternal(dataKey,false);
  }
 else {
    accessRecord(record);
  }
  final Object value=record != null ? mapService.toObject(record.getValue()) : null;
  return new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,value);
}
Program: 48780
Project: 48780
Buggy source:
Map.Entry<Data,Data> getMapEntryData(Data dataKey);

Fixed version (ground truth):
Map.Entry<Data,Object> getMapEntryData(Data dataKey);
Program: 48781
Project: 48781
Buggy source:
public void run(){
  final boolean isInMemoryObjectFormat=InMemoryFormat.OBJECT.equals(mapContainer.getMapConfig().getInMemoryFormat());
  oldValue=isInMemoryObjectFormat ? recordStore.getMapEntryObject(dataKey).getValue() : recordStore.getMapEntryData(dataKey).getValue();
  final Object valueBeforeProcess=mapService.toObject(oldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (oldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (oldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      dataValue=mapService.toData(entry.getValue());
      recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
    }
  }
}

Fixed version (ground truth):
public void run(){
  oldValue=recordStore.getMapEntryData(dataKey).getValue();
  final Object valueBeforeProcess=mapService.toObject(oldValue);
  final MapEntrySimple entry=new MapEntrySimple(mapService.toObject(dataKey),valueBeforeProcess);
  response=mapService.toData(entryProcessor.process(entry));
  final Object valueAfterProcess=entry.getValue();
  if (oldValue == null && valueAfterProcess == null) {
    eventType=__NO_NEED_TO_FIRE_EVENT;
  }
 else   if (valueAfterProcess == null) {
    recordStore.remove(dataKey);
    eventType=EntryEventType.REMOVED;
  }
 else {
    if (oldValue == null) {
      eventType=EntryEventType.ADDED;
    }
 else     if (!entry.isModified()) {
      eventType=__NO_NEED_TO_FIRE_EVENT;
    }
 else {
      eventType=EntryEventType.UPDATED;
    }
    if (eventType != __NO_NEED_TO_FIRE_EVENT) {
      dataValue=mapService.toData(entry.getValue());
      recordStore.put(new AbstractMap.SimpleImmutableEntry<Data,Object>(dataKey,dataValue));
    }
  }
}
Program: 48782
Project: 48782
Buggy source:
private NearCache getNearCache(String mapName){
  return ConcurrencyUtil.getOrPutIfAbsent(nearCacheMap,mapName,nearCacheConstructor);
}

Fixed version (ground truth):
NearCache getNearCache(String mapName){
  return ConcurrencyUtil.getOrPutIfAbsent(nearCacheMap,mapName,nearCacheConstructor);
}
Program: 48783
Project: 48783
Buggy source:
public void invalidateAllNearCaches(String mapName,Data key){
  Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
  for (  MemberImpl member : members) {
    try {
      if (member.localMember())       continue;
      InvalidateNearCacheOperation operation=new InvalidateNearCacheOperation(mapName,key);
      nodeEngine.getOperationService().send(operation,member.getAddress());
    }
 catch (    Throwable throwable) {
      throw new HazelcastException(throwable);
    }
  }
  invalidateNearCache(mapName,key);
}

Fixed version (ground truth):
public void invalidateAllNearCaches(String mapName,Data key){
  Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
  for (  MemberImpl member : members) {
    try {
      if (member.localMember())       continue;
      Operation operation=new InvalidateNearCacheOperation(mapName,key).setServiceName(SERVICE_NAME);
      nodeEngine.getOperationService().send(operation,member.getAddress());
    }
 catch (    Throwable throwable) {
      throw new HazelcastException(throwable);
    }
  }
  invalidateNearCache(mapName,key);
}
Program: 48784
Project: 48784
Buggy source:
public NearCache(String mapName,MapService mapService){
  this.mapName=mapName;
  this.mapService=mapService;
  this.nodeEngine=mapService.getNodeEngine();
  this.mapContainer=mapService.getMapContainer(mapName);
  Config config=nodeEngine.getConfig();
  NearCacheConfig nearCacheConfig=config.findMapConfig(mapName).getNearCacheConfig();
  maxSize=nearCacheConfig.getMaxSize() <= 0 ? Integer.MAX_VALUE : nearCacheConfig.getMaxSize();
  maxIdleMillis=nearCacheConfig.getMaxIdleSeconds() * 1000;
  inMemoryFormat=nearCacheConfig.getInMemoryFormat();
  timeToLiveMillis=nearCacheConfig.getTimeToLiveSeconds() * 1000;
  invalidateOnChange=nearCacheConfig.isInvalidateOnChange();
  evictionPolicy=EvictionPolicy.valueOf(nearCacheConfig.getEvictionPolicy());
  cache=new ConcurrentHashMap<Data,CacheRecord>();
  canCleanUp=new AtomicBoolean(true);
  canEvict=new AtomicBoolean(true);
  lastCleanup=Clock.currentTimeMillis();
}

Fixed version (ground truth):
public NearCache(String mapName,MapService mapService){
  this.mapService=mapService;
  this.nodeEngine=mapService.getNodeEngine();
  this.mapContainer=mapService.getMapContainer(mapName);
  Config config=nodeEngine.getConfig();
  NearCacheConfig nearCacheConfig=config.findMapConfig(mapName).getNearCacheConfig();
  maxSize=nearCacheConfig.getMaxSize() <= 0 ? Integer.MAX_VALUE : nearCacheConfig.getMaxSize();
  maxIdleMillis=nearCacheConfig.getMaxIdleSeconds() * 1000;
  inMemoryFormat=nearCacheConfig.getInMemoryFormat();
  timeToLiveMillis=nearCacheConfig.getTimeToLiveSeconds() * 1000;
  evictionPolicy=EvictionPolicy.valueOf(nearCacheConfig.getEvictionPolicy());
  cache=new ConcurrentHashMap<Data,CacheRecord>();
  canCleanUp=new AtomicBoolean(true);
  canEvict=new AtomicBoolean(true);
  lastCleanup=Clock.currentTimeMillis();
}
Program: 48785
Project: 48785
Buggy source:
public void run(){
  RecordStore recordStore=mapService.getRecordStore(getPartitionId(),name);
  if (keys == null) {
    recordStore.removeAll();
    return;
  }
  if (keys.isEmpty()) {
    shouldBackup=false;
  }
  for (  Data key : keys) {
    if (!recordStore.isLocked(key)) {
      recordStore.evict(key);
    }
  }
}

Fixed version (ground truth):
public void run(){
  mapService.clearNearCache(name);
  RecordStore recordStore=mapService.getRecordStore(getPartitionId(),name);
  if (keys == null) {
    recordStore.removeAll();
    return;
  }
  if (keys.isEmpty()) {
    shouldBackup=false;
  }
  for (  Data key : keys) {
    if (!recordStore.isLocked(key)) {
      recordStore.evict(key);
    }
  }
}
Program: 48786
Project: 48786
Buggy source:
public void run(){
  mapService=(MapService)getService();
  if (mapService.getMapContainer(mapName).isNearCacheEnabled()) {
    mapService.invalidateNearCache(mapName,key);
  }
 else {
    getLogger().warning("String_Node_Str" + mapName + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void run(){
  MapService mapService=getService();
  if (mapService.getMapContainer(mapName).isNearCacheEnabled()) {
    mapService.invalidateNearCache(mapName,key);
  }
 else {
    getLogger().warning("String_Node_Str" + mapName + "String_Node_Str");
  }
}