nus-yam/ex-repair huggingface dataset:
Program: 48241
Project: 48241
Buggy source:
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  ServiceDefinition that=(ServiceDefinition)o;
  if (className != null ? !className.equals(that.className) : that.className != null)   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  ServiceDefinition that=(ServiceDefinition)o;
  if (!classLoader.equals(that.classLoader)) {
    return false;
  }
  if (!className.equals(that.className)) {
    return false;
  }
  return true;
}
Program: 48242
Project: 48242
Buggy source:
private static Set<ServiceDefinition> parse(String factoryId,ClassLoader classLoader){
  final ClassLoader cl=(classLoader == null) ? Thread.currentThread().getContextClassLoader() : classLoader;
  final String resourceName="String_Node_Str" + factoryId;
  try {
    final Enumeration<URL> configs;
    if (cl != null) {
      configs=cl.getResources(resourceName);
    }
 else {
      configs=ClassLoader.getSystemResources(resourceName);
    }
    final Set<ServiceDefinition> names=new HashSet<ServiceDefinition>();
    while (configs.hasMoreElements()) {
      URL url=configs.nextElement();
      BufferedReader r=null;
      try {
        r=new BufferedReader(new InputStreamReader(url.openStream(),"String_Node_Str"));
        while (true) {
          String line=r.readLine();
          if (line == null) {
            break;
          }
          int comment=line.indexOf('#');
          if (comment >= 0) {
            line=line.substring(0,comment);
          }
          String name=line.trim();
          if (name.length() == 0) {
            continue;
          }
          names.add(new ServiceDefinition(name,cl));
        }
      }
  finally {
        IOUtil.closeResource(r);
      }
    }
    return names;
  }
 catch (  Exception e) {
    logger.severe(e);
  }
  return Collections.emptySet();
}

Fixed version (ground truth):
private static Set<ServiceDefinition> parse(String factoryId,ClassLoader classLoader){
  final String resourceName="String_Node_Str" + factoryId;
  try {
    final Enumeration<URL> configs;
    if (classLoader != null) {
      configs=classLoader.getResources(resourceName);
    }
 else {
      configs=ClassLoader.getSystemResources(resourceName);
    }
    final Set<ServiceDefinition> names=new HashSet<ServiceDefinition>();
    while (configs.hasMoreElements()) {
      URL url=configs.nextElement();
      BufferedReader r=null;
      try {
        r=new BufferedReader(new InputStreamReader(url.openStream(),"String_Node_Str"));
        while (true) {
          String line=r.readLine();
          if (line == null) {
            break;
          }
          int comment=line.indexOf('#');
          if (comment >= 0) {
            line=line.substring(0,comment);
          }
          String name=line.trim();
          if (name.length() == 0) {
            continue;
          }
          names.add(new ServiceDefinition(name,classLoader));
        }
      }
  finally {
        IOUtil.closeResource(r);
      }
    }
    return names;
  }
 catch (  Exception e) {
    LOGGER.severe(e);
  }
  return Collections.emptySet();
}
Program: 48243
Project: 48243
Buggy source:
private ServiceDefinition(String className,ClassLoader classLoader){
  this.className=className;
  this.classLoader=classLoader;
}

Fixed version (ground truth):
private ServiceDefinition(String className,ClassLoader classLoader){
  ValidationUtil.isNotNull(className,"String_Node_Str");
  ValidationUtil.isNotNull(classLoader,"String_Node_Str");
  this.className=className;
  this.classLoader=classLoader;
}
Program: 48244
Project: 48244
Buggy source:
public Collection values(Predicate predicate){
  checkTransactionState();
  if (predicate == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MapService service=getService();
  final QueryResultSet queryResultSet=(QueryResultSet)queryInternal(predicate,IterationType.VALUE,false);
  final Set<Object> valueSet=new HashSet<Object>(queryResultSet);
  for (  final Map.Entry<Object,TxnValueWrapper> entry : txMap.entrySet()) {
    if (!TxnValueWrapper.Type.REMOVED.equals(entry.getValue().type)) {
      final Object value=entry.getValue().value instanceof Data ? service.toObject(entry.getValue().value) : entry.getValue().value;
      final QueryEntry queryEntry=new QueryEntry(null,service.toData(entry.getKey()),entry.getKey(),value);
      if (predicate.apply(queryEntry)) {
        valueSet.add(entry.getValue().value);
      }
    }
 else {
      valueSet.remove(entry.getValue());
    }
  }
  return valueSet;
}

Fixed version (ground truth):
public Collection values(Predicate predicate){
  checkTransactionState();
  if (predicate == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MapService service=getService();
  final QueryResultSet queryResultSet=(QueryResultSet)queryInternal(predicate,IterationType.VALUE,false);
  final Set<Object> valueSet=new HashSet<Object>(queryResultSet);
  for (  final Map.Entry<Object,TxnValueWrapper> entry : txMap.entrySet()) {
    if (!TxnValueWrapper.Type.REMOVED.equals(entry.getValue().type)) {
      final Object value=entry.getValue().value instanceof Data ? service.toObject(entry.getValue().value) : entry.getValue().value;
      final QueryEntry queryEntry=new QueryEntry(null,service.toData(entry.getKey()),entry.getKey(),value);
      if (predicate.apply(queryEntry)) {
        valueSet.add(entry.getValue().value);
      }
    }
 else {
      valueSet.remove(entry.getValue().value);
    }
  }
  return valueSet;
}
Program: 48245
Project: 48245
Buggy source:
public Boolean execute(TransactionalTaskContext context) throws TransactionException {
  final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
  assertEquals(0,txMap.values(new SqlPredicate("String_Node_Str")).size());
  txMap.put(2,emp2);
  Collection coll=txMap.values(new SqlPredicate("String_Node_Str"));
  Iterator<Object> iterator=coll.iterator();
  while (iterator.hasNext()) {
    final SampleObjects.Employee e=(SampleObjects.Employee)iterator.next();
    assertEquals(emp2,e);
  }
  coll=txMap.values(new SqlPredicate("String_Node_Str"));
  iterator=coll.iterator();
  while (iterator.hasNext()) {
    final SampleObjects.Employee e=(SampleObjects.Employee)iterator.next();
    assertEquals(emp1,e);
  }
  txMap.remove(2);
  coll=txMap.values(new SqlPredicate("String_Node_Str"));
  assertEquals(0,coll.size());
  return true;
}

Fixed version (ground truth):
public Boolean execute(TransactionalTaskContext context) throws TransactionException {
  final TransactionalMap<Object,Object> txMap=context.getMap(mapName);
  txMap.remove(1);
  Collection<Object> coll=txMap.values(new SqlPredicate("String_Node_Str"));
  assertEquals(0,coll.size());
  return true;
}
Program: 48246
Project: 48246
Buggy source:
public Collection values(Predicate predicate){
  checkTransactionState();
  if (predicate == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MapService service=getService();
  final QueryResultSet queryResultSet=(QueryResultSet)queryInternal(predicate,IterationType.VALUE,false);
  final Set<Object> valueSet=new HashSet<Object>(queryResultSet);
  for (  final Map.Entry<Object,TxnValueWrapper> entry : txMap.entrySet()) {
    if (!TxnValueWrapper.Type.REMOVED.equals(entry.getValue().type)) {
      final Object value=entry.getValue().value instanceof Data ? service.toObject(entry.getValue().value) : entry.getValue().value;
      final QueryEntry queryEntry=new QueryEntry(null,service.toData(entry.getKey()),entry.getKey(),value);
      if (predicate.apply(queryEntry)) {
        valueSet.add(entry.getValue().value);
      }
    }
 else {
      valueSet.remove(entry.getValue());
    }
  }
  return valueSet;
}

Fixed version (ground truth):
public Collection values(Predicate predicate){
  checkTransactionState();
  if (predicate == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MapService service=getService();
  final QueryResultSet queryResultSet=(QueryResultSet)queryInternal(predicate,IterationType.VALUE,false);
  final Set<Object> valueSet=new HashSet<Object>(queryResultSet);
  for (  final Map.Entry<Object,TxnValueWrapper> entry : txMap.entrySet()) {
    if (!TxnValueWrapper.Type.REMOVED.equals(entry.getValue().type)) {
      final Object value=entry.getValue().value instanceof Data ? service.toObject(entry.getValue().value) : entry.getValue().value;
      final QueryEntry queryEntry=new QueryEntry(null,service.toData(entry.getKey()),entry.getKey(),value);
      if (predicate.apply(queryEntry)) {
        valueSet.add(entry.getValue().value);
      }
    }
 else {
      valueSet.remove(entry.getValue().value);
    }
  }
  return valueSet;
}
Program: 48247
Project: 48247
Buggy source:
public Boolean execute(TransactionalTaskContext context) throws TransactionException {
  final TransactionalMap<Object,Object> txMap=context.getMap("String_Node_Str");
  assertEquals(0,txMap.values(new SqlPredicate("String_Node_Str")).size());
  txMap.put(2,emp2);
  Collection coll=txMap.values(new SqlPredicate("String_Node_Str"));
  Iterator<Object> iterator=coll.iterator();
  while (iterator.hasNext()) {
    final SampleObjects.Employee e=(SampleObjects.Employee)iterator.next();
    assertEquals(emp2,e);
  }
  coll=txMap.values(new SqlPredicate("String_Node_Str"));
  iterator=coll.iterator();
  while (iterator.hasNext()) {
    final SampleObjects.Employee e=(SampleObjects.Employee)iterator.next();
    assertEquals(emp1,e);
  }
  txMap.remove(2);
  coll=txMap.values(new SqlPredicate("String_Node_Str"));
  assertEquals(0,coll.size());
  return true;
}

Fixed version (ground truth):
public Boolean execute(TransactionalTaskContext context) throws TransactionException {
  final TransactionalMap<Object,Object> txMap=context.getMap(mapName);
  txMap.remove(1);
  Collection<Object> coll=txMap.values(new SqlPredicate("String_Node_Str"));
  assertEquals(0,coll.size());
  return true;
}
Program: 48248
Project: 48248
Buggy source:
@Test public void testSubmitToKeyOwnerCallable() throws Exception {
  final int k=simpleTestNodeCount;
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances(new Config());
  final AtomicInteger count=new AtomicInteger(0);
  final CountDownLatch latch=new CountDownLatch(k / 2);
  final ExecutionCallback callback=new ExecutionCallback(){
    public void onResponse(    Object response){
      if ((Boolean)response)       count.incrementAndGet();
      latch.countDown();
    }
    public void onFailure(    Throwable t){
    }
  }
;
  for (int i=0; i < k; i++) {
    final HazelcastInstance instance=instances[i];
    final IExecutorService service=instance.getExecutorService("String_Node_Str");
    final String script="String_Node_Str";
    final HashMap map=new HashMap();
    final Member localMember=instance.getCluster().getLocalMember();
    map.put("String_Node_Str",localMember);
    int key=0;
    while (!localMember.equals(instance.getPartitionService().getPartition(++key).getOwner()))     ;
    if (i % 2 == 0) {
      final Future f=service.submitToKeyOwner(new ScriptCallable(script,map),key);
      assertTrue((Boolean)f.get(5,TimeUnit.SECONDS));
    }
 else {
      service.submitToKeyOwner(new ScriptCallable(script,map),key,callback);
    }
  }
  assertTrue(latch.await(30,TimeUnit.SECONDS));
  assertEquals(k / 2,count.get());
}

Fixed version (ground truth):
@Test public void testSubmitToKeyOwnerCallable() throws Exception {
  final int k=simpleTestNodeCount;
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances(new Config());
  final AtomicInteger count=new AtomicInteger(0);
  final CountDownLatch latch=new CountDownLatch(k / 2);
  final ExecutionCallback callback=new ExecutionCallback(){
    public void onResponse(    Object response){
      if ((Boolean)response)       count.incrementAndGet();
      latch.countDown();
    }
    public void onFailure(    Throwable t){
    }
  }
;
  for (int i=0; i < k; i++) {
    final HazelcastInstance instance=instances[i];
    final IExecutorService service=instance.getExecutorService("String_Node_Str");
    final String script="String_Node_Str";
    final HashMap map=new HashMap();
    final Member localMember=instance.getCluster().getLocalMember();
    map.put("String_Node_Str",localMember);
    int key=0;
    while (!localMember.equals(instance.getPartitionService().getPartition(++key).getOwner()))     ;
    if (i % 2 == 0) {
      final Future f=service.submitToKeyOwner(new ScriptCallable(script,map),key);
      assertTrue((Boolean)f.get(60,TimeUnit.SECONDS));
    }
 else {
      service.submitToKeyOwner(new ScriptCallable(script,map),key,callback);
    }
  }
  assertOpenEventually(latch);
  assertEquals(k / 2,count.get());
}
Program: 48249
Project: 48249
Buggy source:
public void lock(K key,long leaseTime,TimeUnit timeUnit){
  final Data keyData=toData(key);
  MultiMapLockRequest request=new MultiMapLockRequest(keyData,ThreadUtil.getThreadId(),getTimeInMillis(leaseTime,timeUnit),-1,name);
  invoke(request,keyData);
}

Fixed version (ground truth):
public void lock(K key,long leaseTime,TimeUnit timeUnit){
  isNotNegative(leaseTime,"String_Node_Str");
  final Data keyData=toData(key);
  MultiMapLockRequest request=new MultiMapLockRequest(keyData,ThreadUtil.getThreadId(),getTimeInMillis(leaseTime,timeUnit),-1,name);
  invoke(request,keyData);
}
Program: 48250
Project: 48250
Buggy source:
@Test(expected=NullPointerException.class) @Category(ProblematicTest.class) public void testAddListener_whenListenerNull() throws InterruptedException {
  final MultiMap mm=client.getMultiMap(randomString());
  mm.addEntryListener(null,true);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void testAddListener_whenListenerNull() throws InterruptedException {
  final MultiMap mm=client.getMultiMap(randomString());
  mm.addEntryListener(null,true);
}
Program: 48251
Project: 48251
Buggy source:
@Category(ProblematicTest.class) @Test(expected=IllegalArgumentException.class) public void testLockTTL_whenNegativeTimeout() throws Exception {
  final MultiMap mm=client.getMultiMap(randomString());
  final Object key="String_Node_Str";
  mm.lock(key,-1,TimeUnit.SECONDS);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void testLockTTL_whenNegativeTimeout() throws Exception {
  final MultiMap mm=client.getMultiMap(randomString());
  final Object key="String_Node_Str";
  mm.lock(key,-1,TimeUnit.SECONDS);
}
Program: 48252
Project: 48252
Buggy source:
public static void isNotNegative(int permits,String argumentName){
  if (permits < 0) {
    throw new IllegalArgumentException(argumentName + "String_Node_Str");
  }
}

Fixed version (ground truth):
public static void isNotNegative(long value,String argumentName){
  if (value < 0) {
    throw new IllegalArgumentException(argumentName + "String_Node_Str");
  }
}
Program: 48253
Project: 48253
Buggy source:
private void increaseRecordEvictionCounter(Record record,MapConfig.EvictionPolicy evictionPolicy){
switch (evictionPolicy) {
case LRU:
    record.setAccessCounter(++lruAccessCounter);
  break;
case LFU:
long lfuCounter=record.getAccessCounter();
record.setAccessCounter(++lfuCounter);
break;
case NONE:
break;
default :
throw new IllegalArgumentException("String_Node_Str" + evictionPolicy + ']');
}
}

Fixed version (ground truth):
private void increaseRecordEvictionCounter(Record record,MapConfig.EvictionPolicy evictionPolicy){
switch (evictionPolicy) {
case LRU:
    record.setAccessCounter(++lruAccessCounter);
  break;
case LFU:
record.setAccessCounter(record.getAccessCounter() + 1L);
break;
case NONE:
break;
default :
throw new IllegalArgumentException("String_Node_Str" + evictionPolicy + ']');
}
}
Program: 48254
Project: 48254
Buggy source:
public void lock(K key,long leaseTime,TimeUnit timeUnit){
  final Data keyData=toData(key);
  MultiMapLockRequest request=new MultiMapLockRequest(keyData,ThreadUtil.getThreadId(),getTimeInMillis(leaseTime,timeUnit),-1,name);
  invoke(request,keyData);
}

Fixed version (ground truth):
public void lock(K key,long leaseTime,TimeUnit timeUnit){
  isNotNegative(leaseTime,"String_Node_Str");
  final Data keyData=toData(key);
  MultiMapLockRequest request=new MultiMapLockRequest(keyData,ThreadUtil.getThreadId(),getTimeInMillis(leaseTime,timeUnit),-1,name);
  invoke(request,keyData);
}
Program: 48255
Project: 48255
Buggy source:
@Test(expected=NullPointerException.class) @Category(ProblematicTest.class) public void testAddListener_whenListenerNull() throws InterruptedException {
  final MultiMap mm=client.getMultiMap(randomString());
  mm.addEntryListener(null,true);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void testAddListener_whenListenerNull() throws InterruptedException {
  final MultiMap mm=client.getMultiMap(randomString());
  mm.addEntryListener(null,true);
}
Program: 48256
Project: 48256
Buggy source:
@Category(ProblematicTest.class) @Test(expected=IllegalArgumentException.class) public void testLockTTL_whenNegativeTimeout() throws Exception {
  final MultiMap mm=client.getMultiMap(randomString());
  final Object key="String_Node_Str";
  mm.lock(key,-1,TimeUnit.SECONDS);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void testLockTTL_whenNegativeTimeout() throws Exception {
  final MultiMap mm=client.getMultiMap(randomString());
  final Object key="String_Node_Str";
  mm.lock(key,-1,TimeUnit.SECONDS);
}
Program: 48257
Project: 48257
Buggy source:
public static void isNotNegative(int permits,String argumentName){
  if (permits < 0) {
    throw new IllegalArgumentException(argumentName + "String_Node_Str");
  }
}

Fixed version (ground truth):
public static void isNotNegative(long value,String argumentName){
  if (value < 0) {
    throw new IllegalArgumentException(argumentName + "String_Node_Str");
  }
}
Program: 48258
Project: 48258
Buggy source:
public void writePortableArray(String fieldName,Portable[] portables) throws IOException {
  setPosition(fieldName);
  final int len=portables == null ? 0 : portables.length;
  out.writeInt(len);
  if (len > 0) {
    final int offset=out.position();
    out.position(offset + len * 4);
    for (int i=0; i < portables.length; i++) {
      out.writeInt(offset + i * 4,out.position());
      final Portable portable=portables[i];
      serializer.write(out,portable);
    }
  }
}

Fixed version (ground truth):
public void writePortableArray(String fieldName,Portable[] portables) throws IOException {
  setPosition(fieldName);
  final int len=portables == null ? 0 : portables.length;
  out.writeInt(len);
  if (len > 0) {
    final int offset=out.position();
    out.writeZeroBytes(len * 4);
    for (int i=0; i < portables.length; i++) {
      out.writeInt(offset + i * 4,out.position());
      final Portable portable=portables[i];
      serializer.write(out,portable);
    }
  }
}
Program: 48259
Project: 48259
Buggy source:
public boolean merge(Data dataKey,EntryView mergingEntry,MapMergePolicy mergePolicy){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object newValue=null;
  if (record == null) {
    newValue=mergingEntry.getValue();
    newValue=writeMapStore(dataKey,newValue,null);
    record=mapService.createRecord(name,dataKey,newValue,DEFAULT_TTL);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    Object oldValue=record.getValue();
    EntryView existingEntry=new SimpleEntryView(mapService.toObject(record.getKey()),mapService.toObject(record.getValue()),record.getStatistics(),record.getCost(),record.getVersion());
    newValue=mergePolicy.merge(name,mergingEntry,existingEntry);
    if (newValue == null) {
      removeIndex(dataKey);
      mapStoreDelete(record,dataKey);
      updateSizeEstimator(-calculateRecordSize(record));
      deleteRecord(dataKey);
      return true;
    }
    if (mapService.compare(name,newValue,oldValue)) {
      return true;
    }
    newValue=writeMapStore(dataKey,newValue,record);
    updateSizeEstimator(-calculateRecordSize(record));
    recordFactory.setValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
  saveIndex(record);
  return newValue != null;
}

Fixed version (ground truth):
public boolean merge(Data dataKey,EntryView mergingEntry,MapMergePolicy mergePolicy){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object newValue=null;
  if (record == null) {
    newValue=mergingEntry.getValue();
    newValue=writeMapStore(dataKey,newValue,null);
    record=mapService.createRecord(name,dataKey,newValue,DEFAULT_TTL);
    records.put(dataKey,record);
    updateSizeEstimator(calculateRecordSize(record));
  }
 else {
    Object oldValue=record.getValue();
    EntryView existingEntry=mapService.createSimpleEntryView(mapService.toObject(record.getKey()),mapService.toObject(record.getValue()),record);
    newValue=mergePolicy.merge(name,mergingEntry,existingEntry);
    if (newValue == null) {
      removeIndex(dataKey);
      mapStoreDelete(record,dataKey);
      updateSizeEstimator(-calculateRecordSize(record));
      deleteRecord(dataKey);
      return true;
    }
    if (mapService.compare(name,newValue,oldValue)) {
      return true;
    }
    newValue=writeMapStore(dataKey,newValue,record);
    updateSizeEstimator(-calculateRecordSize(record));
    recordFactory.setValue(record,newValue);
    updateSizeEstimator(calculateRecordSize(record));
  }
  saveIndex(record);
  return newValue != null;
}
Program: 48260
Project: 48260
Buggy source:
private void accessRecord(Record record){
  record.onAccess();
  final int maxIdleSeconds=mapContainer.getMapConfig().getMaxIdleSeconds();
  if (maxIdleSeconds > 0) {
    mapService.scheduleIdleEviction(name,record.getKey(),TimeUnit.SECONDS.toMillis(maxIdleSeconds));
  }
}

Fixed version (ground truth):
private void accessRecord(Record record){
  increaseRecordEvictionCounter(record,mapContainer.getMapConfig().getEvictionPolicy());
  record.onAccess();
  final int maxIdleSeconds=mapContainer.getMapConfig().getMaxIdleSeconds();
  if (maxIdleSeconds > 0) {
    mapService.scheduleIdleEviction(name,record.getKey(),TimeUnit.SECONDS.toMillis(maxIdleSeconds));
  }
}
Program: 48261
Project: 48261
Buggy source:
public void clearPartition(){
  final LockService lockService=mapService.getNodeEngine().getSharedService(LockService.SERVICE_NAME);
  if (lockService != null) {
    lockService.clearLockStore(partitionId,new DefaultObjectNamespace(MapService.SERVICE_NAME,name));
  }
  final IndexService indexService=mapContainer.getIndexService();
  if (indexService.hasIndex()) {
    for (    Data key : records.keySet()) {
      indexService.removeEntryIndex(key);
    }
  }
  cancelAssociatedSchedulers(records.keySet());
  clearRecordsMap(Collections.<Data,Record>emptyMap());
  resetSizeEstimator();
}

Fixed version (ground truth):
public void clearPartition(){
  final LockService lockService=mapService.getNodeEngine().getSharedService(LockService.SERVICE_NAME);
  if (lockService != null) {
    lockService.clearLockStore(partitionId,new DefaultObjectNamespace(MapService.SERVICE_NAME,name));
  }
  final IndexService indexService=mapContainer.getIndexService();
  if (indexService.hasIndex()) {
    for (    Data key : records.keySet()) {
      indexService.removeEntryIndex(key);
    }
  }
  cancelAssociatedSchedulers(records.keySet());
  clearRecordsMap(Collections.<Data,Record>emptyMap());
  resetSizeEstimator();
  resetAccessCounter();
}
Program: 48262
Project: 48262
Buggy source:
public void reset(){
  checkIfLoaded();
  cancelAssociatedSchedulers(records.keySet());
  clearRecordsMap(Collections.<Data,Record>emptyMap());
  resetSizeEstimator();
}

Fixed version (ground truth):
public void reset(){
  checkIfLoaded();
  cancelAssociatedSchedulers(records.keySet());
  clearRecordsMap(Collections.<Data,Record>emptyMap());
  resetSizeEstimator();
  resetAccessCounter();
}
Program: 48263
Project: 48263
Buggy source:
public void clear(){
  checkIfLoaded();
  resetSizeEstimator();
  final Collection<Data> lockedKeys=lockStore != null ? lockStore.getLockedKeys() : Collections.<Data>emptySet();
  final Map<Data,Record> lockedRecords=new HashMap<Data,Record>(lockedKeys.size());
  for (  Data key : lockedKeys) {
    Record record=records.get(key);
    if (record != null) {
      lockedRecords.put(key,record);
      updateSizeEstimator(calculateRecordSize(record));
    }
  }
  Set<Data> keysToDelete=records.keySet();
  keysToDelete.removeAll(lockedRecords.keySet());
  final MapStoreWrapper store=mapContainer.getStore();
  Collection<Object> keysObject=new ArrayList<Object>(keysToDelete.size());
  for (  Data key : keysToDelete) {
    removeIndex(key);
    keysObject.add(mapService.toObject(key));
  }
  if (store != null) {
    store.deleteAll(keysObject);
    toBeRemovedKeys.removeAll(keysToDelete);
  }
  clearRecordsMap(lockedRecords);
  cancelAssociatedSchedulers(keysToDelete);
}

Fixed version (ground truth):
public void clear(){
  checkIfLoaded();
  resetSizeEstimator();
  final Collection<Data> lockedKeys=lockStore != null ? lockStore.getLockedKeys() : Collections.<Data>emptySet();
  final Map<Data,Record> lockedRecords=new HashMap<Data,Record>(lockedKeys.size());
  for (  Data key : lockedKeys) {
    Record record=records.get(key);
    if (record != null) {
      lockedRecords.put(key,record);
      updateSizeEstimator(calculateRecordSize(record));
    }
  }
  Set<Data> keysToDelete=records.keySet();
  keysToDelete.removeAll(lockedRecords.keySet());
  final MapStoreWrapper store=mapContainer.getStore();
  Collection<Object> keysObject=new ArrayList<Object>(keysToDelete.size());
  for (  Data key : keysToDelete) {
    removeIndex(key);
    keysObject.add(mapService.toObject(key));
  }
  if (store != null) {
    store.deleteAll(keysObject);
    toBeRemovedKeys.removeAll(keysToDelete);
  }
  clearRecordsMap(lockedRecords);
  cancelAssociatedSchedulers(keysToDelete);
  resetAccessCounter();
}
Program: 48264
Project: 48264
Buggy source:
public void writePortableArray(String fieldName,Portable[] portables) throws IOException {
  setPosition(fieldName);
  final int len=portables == null ? 0 : portables.length;
  out.writeInt(len);
  if (len > 0) {
    final int offset=out.position();
    out.position(offset + len * 4);
    for (int i=0; i < portables.length; i++) {
      out.writeInt(offset + i * 4,out.position());
      final Portable portable=portables[i];
      serializer.write(out,portable);
    }
  }
}

Fixed version (ground truth):
public void writePortableArray(String fieldName,Portable[] portables) throws IOException {
  setPosition(fieldName);
  final int len=portables == null ? 0 : portables.length;
  out.writeInt(len);
  if (len > 0) {
    final int offset=out.position();
    out.writeZeroBytes(len * 4);
    for (int i=0; i < portables.length; i++) {
      out.writeInt(offset + i * 4,out.position());
      final Portable portable=portables[i];
      serializer.write(out,portable);
    }
  }
}
Program: 48265
Project: 48265
Buggy source:
NearCache getNearCache(String mapName){
  return ConcurrencyUtil.getOrPutIfAbsent(nearCacheMap,mapName,nearCacheConstructor);
}

Fixed version (ground truth):
public NearCache getNearCache(String mapName){
  return ConcurrencyUtil.getOrPutIfAbsent(nearCacheMap,mapName,nearCacheConstructor);
}
Program: 48266
Project: 48266
Buggy source:
protected boolean evictInternal(final Data key){
  EvictOperation operation=new EvictOperation(name,key,false);
  final boolean evictSuccess=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return evictSuccess;
}

Fixed version (ground truth):
protected boolean evictInternal(final Data key){
  EvictOperation operation=new EvictOperation(name,key,false);
  final boolean evictSuccess=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return evictSuccess;
}
Program: 48267
Project: 48267
Buggy source:
protected boolean tryPutInternal(final Data key,final Data value,final long timeout,final TimeUnit timeunit){
  TryPutOperation operation=new TryPutOperation(name,key,value,getTimeInMillis(timeout,timeunit));
  boolean putSuccessful=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return putSuccessful;
}

Fixed version (ground truth):
protected boolean tryPutInternal(final Data key,final Data value,final long timeout,final TimeUnit timeunit){
  TryPutOperation operation=new TryPutOperation(name,key,value,getTimeInMillis(timeout,timeunit));
  boolean putSuccessful=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return putSuccessful;
}
Program: 48268
Project: 48268
Buggy source:
public ICompletableFuture executeOnKeyInternal(Data key,EntryProcessor entryProcessor,ExecutionCallback callback){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  EntryOperation operation=new EntryOperation(name,key,entryProcessor);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    if (callback == null) {
      return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    }
 else {
      ICompletableFuture future=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).setCallback(new MapExecutionCallbackAdapter(callback)).invoke();
      invalidateLocalNearCache(key);
      return future;
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
public ICompletableFuture executeOnKeyInternal(Data key,EntryProcessor entryProcessor,ExecutionCallback callback){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  EntryOperation operation=new EntryOperation(name,key,entryProcessor);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    if (callback == null) {
      return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    }
 else {
      ICompletableFuture future=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).setCallback(new MapExecutionCallbackAdapter(callback)).invoke();
      invalidateNearCache(key);
      return future;
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48269
Project: 48269
Buggy source:
protected Data putInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return previousValue;
}

Fixed version (ground truth):
protected Data putInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateNearCache(key);
  return previousValue;
}
Program: 48270
Project: 48270
Buggy source:
protected boolean removeInternal(final Data key,final Data value){
  RemoveIfSameOperation operation=new RemoveIfSameOperation(name,key,value);
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return removed;
}

Fixed version (ground truth):
protected boolean removeInternal(final Data key,final Data value){
  RemoveIfSameOperation operation=new RemoveIfSameOperation(name,key,value);
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return removed;
}
Program: 48271
Project: 48271
Buggy source:
protected ICompletableFuture<Data> removeAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  RemoveOperation operation=new RemoveOperation(name,key);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateLocalNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected ICompletableFuture<Data> removeAsyncInternal(final Data key){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  RemoveOperation operation=new RemoveOperation(name,key);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48272
Project: 48272
Buggy source:
protected boolean tryRemoveInternal(final Data key,final long timeout,final TimeUnit timeunit){
  TryRemoveOperation operation=new TryRemoveOperation(name,key,getTimeInMillis(timeout,timeunit));
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return removed;
}

Fixed version (ground truth):
protected boolean tryRemoveInternal(final Data key,final long timeout,final TimeUnit timeunit){
  TryRemoveOperation operation=new TryRemoveOperation(name,key,getTimeInMillis(timeout,timeunit));
  boolean removed=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return removed;
}
Program: 48273
Project: 48273
Buggy source:
/** 
 * {@link IMap#executeOnEntries(EntryProcessor,Predicate)}
 */
public Map executeOnEntries(EntryProcessor entryProcessor,Predicate predicate){
  Map result=new HashMap();
  try {
    NodeEngine nodeEngine=getNodeEngine();
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,new PartitionWideEntryWithPredicateOperationFactory(name,entryProcessor,predicate));
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          final Data key=entry.getKey();
          result.put(service.toObject(key),service.toObject(entry.getValue()));
          invalidateLocalNearCache(key);
        }
      }
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * {@link IMap#executeOnEntries(EntryProcessor,Predicate)}
 */
public Map executeOnEntries(EntryProcessor entryProcessor,Predicate predicate){
  Map result=new HashMap();
  try {
    NodeEngine nodeEngine=getNodeEngine();
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnAllPartitions(SERVICE_NAME,new PartitionWideEntryWithPredicateOperationFactory(name,entryProcessor,predicate));
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          final Data key=entry.getKey();
          result.put(service.toObject(key),service.toObject(entry.getValue()));
          invalidateNearCache(key);
        }
      }
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}
Program: 48274
Project: 48274
Buggy source:
protected ICompletableFuture<Data> putAsyncInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateLocalNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
protected ICompletableFuture<Data> putAsyncInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  PutOperation operation=new PutOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    ICompletableFuture<Data> future=nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    invalidateNearCache(key);
    return future;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}
Program: 48275
Project: 48275
Buggy source:
protected void deleteInternal(Data key){
  RemoveOperation operation=new RemoveOperation(name,key);
  invokeOperation(key,operation);
  invalidateLocalNearCache(key);
}

Fixed version (ground truth):
protected void deleteInternal(Data key){
  RemoveOperation operation=new RemoveOperation(name,key);
  invokeOperation(key,operation);
  invalidateNearCache(key);
}
Program: 48276
Project: 48276
Buggy source:
protected void setInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  SetOperation operation=new SetOperation(name,key,value,timeunit.toMillis(ttl));
  invokeOperation(key,operation);
  invalidateLocalNearCache(key);
}

Fixed version (ground truth):
protected void setInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  SetOperation operation=new SetOperation(name,key,value,timeunit.toMillis(ttl));
  invokeOperation(key,operation);
  invalidateNearCache(key);
}
Program: 48278
Project: 48278
Buggy source:
public Map executeOnKeysInternal(Set<Data> keys,EntryProcessor entryProcessor){
  Map result=new HashMap();
  final NodeEngine nodeEngine=getNodeEngine();
  final Collection<Integer> partitionsForKeys=getPartitionsForKeys(keys);
  try {
    MultipleEntryOperationFactory operationFactory=new MultipleEntryOperationFactory(name,keys,entryProcessor);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnPartitions(SERVICE_NAME,operationFactory,partitionsForKeys);
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          result.put(service.toObject(entry.getKey()),service.toObject(entry.getValue()));
        }
      }
    }
    invalidateLocalNearCache(keys);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}

Fixed version (ground truth):
public Map executeOnKeysInternal(Set<Data> keys,EntryProcessor entryProcessor){
  Map result=new HashMap();
  final NodeEngine nodeEngine=getNodeEngine();
  final Collection<Integer> partitionsForKeys=getPartitionsForKeys(keys);
  try {
    MultipleEntryOperationFactory operationFactory=new MultipleEntryOperationFactory(name,keys,entryProcessor);
    Map<Integer,Object> results=nodeEngine.getOperationService().invokeOnPartitions(SERVICE_NAME,operationFactory,partitionsForKeys);
    for (    Object o : results.values()) {
      if (o != null) {
        final MapService service=getService();
        final MapEntrySet mapEntrySet=(MapEntrySet)o;
        for (        Entry<Data,Data> entry : mapEntrySet.getEntrySet()) {
          result.put(service.toObject(entry.getKey()),service.toObject(entry.getValue()));
        }
      }
    }
    invalidateNearCache(keys);
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
  return result;
}
Program: 48279
Project: 48279
Buggy source:
protected Data putIfAbsentInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutIfAbsentOperation operation=new PutIfAbsentOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return previousValue;
}

Fixed version (ground truth):
protected Data putIfAbsentInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutIfAbsentOperation operation=new PutIfAbsentOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  Data previousValue=(Data)invokeOperation(key,operation);
  invalidateNearCache(key);
  return previousValue;
}
Program: 48280
Project: 48280
Buggy source:
protected void putTransientInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutTransientOperation operation=new PutTransientOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  invokeOperation(key,operation);
  invalidateLocalNearCache(key);
}

Fixed version (ground truth):
protected void putTransientInternal(final Data key,final Data value,final long ttl,final TimeUnit timeunit){
  PutTransientOperation operation=new PutTransientOperation(name,key,value,getTimeInMillis(ttl,timeunit));
  invokeOperation(key,operation);
  invalidateNearCache(key);
}
Program: 48281
Project: 48281
Buggy source:
protected Data replaceInternal(final Data key,final Data value){
  ReplaceOperation operation=new ReplaceOperation(name,key,value);
  final Data result=(Data)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return result;
}

Fixed version (ground truth):
protected Data replaceInternal(final Data key,final Data value){
  ReplaceOperation operation=new ReplaceOperation(name,key,value);
  final Data result=(Data)invokeOperation(key,operation);
  invalidateNearCache(key);
  return result;
}
Program: 48282
Project: 48282
Buggy source:
public Object getFromNearCache(String mapName,Data key){
  NearCache nearCache=getNearCache(mapName);
  return nearCache.get(key);
}

Fixed version (ground truth):
public Object getFromNearCache(String mapName,Data key){
  if (!isNearCacheEnabled(mapName)) {
    return null;
  }
  NearCache nearCache=getNearCache(mapName);
  return nearCache.get(key);
}
Program: 48283
Project: 48283
Buggy source:
public void invalidateNearCache(String mapName,Set<Data> keys){
  NearCache nearCache=getNearCache(mapName);
  nearCache.invalidate(keys);
}

Fixed version (ground truth):
public void invalidateNearCache(String mapName,Set<Data> keys){
  if (!isNearCacheEnabled(mapName)) {
    return;
  }
  NearCache nearCache=getNearCache(mapName);
  nearCache.invalidate(keys);
}
Program: 48284
Project: 48284
Buggy source:
public void putNearCache(String mapName,Data key,Data value){
  NearCache nearCache=getNearCache(mapName);
  nearCache.put(key,value);
}

Fixed version (ground truth):
public void putNearCache(String mapName,Data key,Data value){
  if (!isNearCacheEnabled(mapName)) {
    return;
  }
  NearCache nearCache=getNearCache(mapName);
  nearCache.put(key,value);
}
Program: 48285
Project: 48285
Buggy source:
public void clearNearCache(String mapName){
  final NearCache nearCache=nearCacheMap.get(mapName);
  if (nearCache != null) {
    nearCache.clear();
  }
}

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

Fixed version (ground truth):
public NearCache getNearCache(String mapName){
  return ConcurrencyUtil.getOrPutIfAbsent(nearCacheMap,mapName,nearCacheConstructor);
}
Program: 48287
Project: 48287
Buggy source:
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);
  }
}

Fixed version (ground truth):
public void invalidateAllNearCaches(String mapName,Set<Data> keys){
  if (!isNearCacheEnabled(mapName)) {
    return;
  }
  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: 48288
Project: 48288
Buggy source:
protected boolean evictInternal(final Data key){
  EvictOperation operation=new EvictOperation(name,key,false);
  final boolean evictSuccess=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return evictSuccess;
}

Fixed version (ground truth):
protected boolean evictInternal(final Data key){
  EvictOperation operation=new EvictOperation(name,key,false);
  final boolean evictSuccess=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return evictSuccess;
}
Program: 48289
Project: 48289
Buggy source:
protected boolean tryPutInternal(final Data key,final Data value,final long timeout,final TimeUnit timeunit){
  TryPutOperation operation=new TryPutOperation(name,key,value,getTimeInMillis(timeout,timeunit));
  boolean putSuccessful=(Boolean)invokeOperation(key,operation);
  invalidateLocalNearCache(key);
  return putSuccessful;
}

Fixed version (ground truth):
protected boolean tryPutInternal(final Data key,final Data value,final long timeout,final TimeUnit timeunit){
  TryPutOperation operation=new TryPutOperation(name,key,value,getTimeInMillis(timeout,timeunit));
  boolean putSuccessful=(Boolean)invokeOperation(key,operation);
  invalidateNearCache(key);
  return putSuccessful;
}
Program: 48290
Project: 48290
Buggy source:
public ICompletableFuture executeOnKeyInternal(Data key,EntryProcessor entryProcessor,ExecutionCallback callback){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  EntryOperation operation=new EntryOperation(name,key,entryProcessor);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    if (callback == null) {
      return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    }
 else {
      ICompletableFuture future=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).setCallback(new MapExecutionCallbackAdapter(callback)).invoke();
      invalidateLocalNearCache(key);
      return future;
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}

Fixed version (ground truth):
public ICompletableFuture executeOnKeyInternal(Data key,EntryProcessor entryProcessor,ExecutionCallback callback){
  final NodeEngine nodeEngine=getNodeEngine();
  int partitionId=nodeEngine.getPartitionService().getPartitionId(key);
  EntryOperation operation=new EntryOperation(name,key,entryProcessor);
  operation.setThreadId(ThreadUtil.getThreadId());
  try {
    if (callback == null) {
      return nodeEngine.getOperationService().invokeOnPartition(SERVICE_NAME,operation,partitionId);
    }
 else {
      ICompletableFuture future=nodeEngine.getOperationService().createInvocationBuilder(SERVICE_NAME,operation,partitionId).setCallback(new MapExecutionCallbackAdapter(callback)).invoke();
      invalidateNearCache(key);
      return future;
    }
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrow(t);
  }
}