nus-yam/ex-repair huggingface dataset:
Program: 46102
Project: 46102
Buggy source:
@Test(expected=CacheException.class) public void whenOtherURI_invalidInstanceNameAsProperty_thenFails() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str"),null,HazelcastCachingProvider.propertiesByInstanceName("String_Node_Str"));
}

Fixed version (ground truth):
@Test(expected=CacheException.class) public void whenOtherURI_invalidInstanceNameAsProperty_thenFails() throws URISyntaxException {
  cachingProvider.getCacheManager(new URI("String_Node_Str"),null,propertiesByInstanceName("String_Node_Str"));
}
Program: 46103
Project: 46103
Buggy source:
@Test public void whenInstanceItselfAsProperty_andValidInstanceNameURI_thenInstanceItselfIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str" + CONFIG_CLASSPATH_LOCATION),null,HazelcastCachingProvider.propertiesByInstanceItself(instance2));
  assertCacheManagerInstance(cacheManager,instance2);
}

Fixed version (ground truth):
@Test public void whenInstanceItselfAsProperty_andValidInstanceNameURI_thenInstanceItselfIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str" + CONFIG_CLASSPATH_LOCATION),null,propertiesByInstanceItself(instance2));
  assertCacheManagerInstance(cacheManager,instance2);
}
Program: 46104
Project: 46104
Buggy source:
@Test(expected=CacheException.class) public void whenDefaultURI_invalidInstanceNameAsProperty_thenFails() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(null,null,HazelcastCachingProvider.propertiesByInstanceName("String_Node_Str"));
}

Fixed version (ground truth):
@Test(expected=CacheException.class) public void whenDefaultURI_invalidInstanceNameAsProperty_thenFails() throws URISyntaxException {
  cachingProvider.getCacheManager(null,null,propertiesByInstanceName("String_Node_Str"));
}
Program: 46105
Project: 46105
Buggy source:
@Test(expected=CacheException.class) public void whenInvalidInstanceNameAsUri_thenFails() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str"),null);
}

Fixed version (ground truth):
@Test(expected=CacheException.class) public void whenInvalidInstanceNameAsUri_thenFails() throws URISyntaxException {
  cachingProvider.getCacheManager(new URI("String_Node_Str"),null);
}
Program: 46106
Project: 46106
Buggy source:
@Test public void whenInstanceItselfAsProperty_andDefaultURI_thenInstanceItselfIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(null,null,HazelcastCachingProvider.propertiesByInstanceItself(instance3));
  assertCacheManagerInstance(cacheManager,instance3);
}

Fixed version (ground truth):
@Test public void whenInstanceItselfAsProperty_andDefaultURI_thenInstanceItselfIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(null,null,propertiesByInstanceItself(instance3));
  assertCacheManagerInstance(cacheManager,instance3);
}
Program: 46107
Project: 46107
Buggy source:
@Test public void testAveragePutTimeStat(){
  ICache<Integer,String> cache=createCache();
  CacheStatistics stats=cache.getLocalCacheStatistics();
  final int ENTRY_COUNT=100;
  long start=System.nanoTime();
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.put(i,"String_Node_Str" + i);
  }
  long end=System.nanoTime();
  float avgPutTime=(end - start) / 1000;
  assertTrue(stats.getAveragePutTime() > 0);
  assertTrue(stats.getAveragePutTime() < avgPutTime);
}

Fixed version (ground truth):
@Test public void testAveragePutTimeStat(){
  ICache<Integer,String> cache=createCache();
  CacheStatistics stats=cache.getLocalCacheStatistics();
  final int ENTRY_COUNT=100;
  long start=System.nanoTime();
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.put(i,"String_Node_Str" + i);
  }
  long end=System.nanoTime();
  float avgPutTime=NANOSECONDS.toMicros(end - start);
  assertTrue(stats.getAveragePutTime() > 0);
  assertTrue(stats.getAveragePutTime() < avgPutTime);
}
Program: 46108
Project: 46108
Buggy source:
@Test public void testAverageGetTimeStat(){
  ICache<Integer,String> cache=createCache();
  CacheStatistics stats=cache.getLocalCacheStatistics();
  final int ENTRY_COUNT=100;
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.put(i,"String_Node_Str" + i);
  }
  long start=System.nanoTime();
  for (int i=0; i < 2 * ENTRY_COUNT; i++) {
    cache.get(i);
  }
  long end=System.nanoTime();
  float avgGetTime=(end - start) / 1000;
  assertTrue(stats.getAverageGetTime() > 0);
  assertTrue(stats.getAverageGetTime() < avgGetTime);
}

Fixed version (ground truth):
@Test public void testAverageGetTimeStat(){
  ICache<Integer,String> cache=createCache();
  CacheStatistics stats=cache.getLocalCacheStatistics();
  final int ENTRY_COUNT=100;
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.put(i,"String_Node_Str" + i);
  }
  long start=System.nanoTime();
  for (int i=0; i < 2 * ENTRY_COUNT; i++) {
    cache.get(i);
  }
  long end=System.nanoTime();
  float avgGetTime=NANOSECONDS.toMicros(end - start);
  assertTrue(stats.getAverageGetTime() > 0);
  assertTrue(stats.getAverageGetTime() < avgGetTime);
}
Program: 46109
Project: 46109
Buggy source:
@Test public void testAverageRemoveTimeStat(){
  ICache<Integer,String> cache=createCache();
  CacheStatistics stats=cache.getLocalCacheStatistics();
  final int ENTRY_COUNT=100;
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.put(i,"String_Node_Str" + i);
  }
  long start=System.nanoTime();
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.remove(i);
  }
  long end=System.nanoTime();
  float avgRemoveTime=(end - start) / 1000;
  assertTrue(stats.getAverageRemoveTime() > 0);
  assertTrue(stats.getAverageRemoveTime() < avgRemoveTime);
  float currentAverageRemoveTime=stats.getAverageRemoveTime();
  sleepAtLeastMillis(1);
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.remove(i);
  }
  assertEquals(currentAverageRemoveTime,stats.getAverageRemoveTime(),0.0f);
}

Fixed version (ground truth):
@Test public void testAverageRemoveTimeStat(){
  ICache<Integer,String> cache=createCache();
  CacheStatistics stats=cache.getLocalCacheStatistics();
  final int ENTRY_COUNT=100;
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.put(i,"String_Node_Str" + i);
  }
  long start=System.nanoTime();
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.remove(i);
  }
  long end=System.nanoTime();
  float avgRemoveTime=NANOSECONDS.toMicros(end - start);
  assertTrue(stats.getAverageRemoveTime() > 0);
  assertTrue(stats.getAverageRemoveTime() < avgRemoveTime);
  float currentAverageRemoveTime=stats.getAverageRemoveTime();
  sleepAtLeastMillis(1);
  for (int i=0; i < ENTRY_COUNT; i++) {
    cache.remove(i);
  }
  assertEquals(currentAverageRemoveTime,stats.getAverageRemoveTime(),0.0f);
}
Program: 46110
Project: 46110
Buggy source:
/** 
 * Stores the Near Cache keys from the supplied iterator.
 * @param iterator {@link Iterator} over the key set of a {@link com.hazelcast.internal.nearcache.NearCacheRecordStore}
 */
public void storeKeys(Iterator<K> iterator){
  long startedNanos=System.nanoTime();
  FileOutputStream fos=null;
  try {
    lastWrittenBytes=0;
    lastKeyCount=0;
    fos=new FileOutputStream(tmpStoreFile,false);
    writeInt(fos,MAGIC_BYTES);
    writeInt(fos,FileFormat.INTERLEAVED_LENGTH_FIELD.ordinal());
    writeKeySet(fos,fos.getChannel(),iterator);
    if (lastKeyCount == 0) {
      deleteQuietly(storeFile);
      updatePersistenceStats(startedNanos);
      return;
    }
    fos.flush();
    rename(tmpStoreFile,storeFile);
    updatePersistenceStats(startedNanos);
  }
 catch (  Exception e) {
    logger.warning(format("String_Node_Str",nearCacheName,storeFile.getAbsolutePath()),e);
    nearCacheStats.addPersistenceFailure(e);
  }
 finally {
    deleteQuietly(tmpStoreFile);
    closeResource(fos);
  }
}

Fixed version (ground truth):
/** 
 * Stores the Near Cache keys from the supplied iterator.
 * @param iterator {@link Iterator} over the key set of a {@link com.hazelcast.internal.nearcache.NearCacheRecordStore}
 */
public void storeKeys(Iterator<K> iterator){
  long startedNanos=System.nanoTime();
  FileOutputStream fos=null;
  try {
    lastWrittenBytes=0;
    lastKeyCount=0;
    fos=new FileOutputStream(tmpStoreFile,false);
    writeInt(fos,MAGIC_BYTES);
    writeInt(fos,FileFormat.INTERLEAVED_LENGTH_FIELD.ordinal());
    writeKeySet(fos,fos.getChannel(),iterator);
    if (lastKeyCount == 0) {
      deleteQuietly(storeFile);
      updatePersistenceStats(startedNanos);
      return;
    }
    fos.flush();
    closeResource(fos);
    rename(tmpStoreFile,storeFile);
    updatePersistenceStats(startedNanos);
  }
 catch (  Exception e) {
    logger.warning(format("String_Node_Str",nearCacheName,storeFile.getAbsolutePath()),e);
    nearCacheStats.addPersistenceFailure(e);
  }
 finally {
    closeResource(fos);
    deleteQuietly(tmpStoreFile);
  }
}
Program: 46111
Project: 46111
Buggy source:
@Test(timeout=TEST_TIMEOUT) @Category(SlowTest.class) public void testCreateStoreFile_withInvalidDirectory(){
  String directory="String_Node_Str";
  nearCacheConfig.getPreloaderConfig().setStoreInitialDelaySeconds(1).setStoreIntervalSeconds(1).setDirectory(directory);
  expectedException.expectMessage("String_Node_Str" + directory + getDefaultStoreFile().getName());
  expectedException.expect(HazelcastException.class);
  createContext(true);
}

Fixed version (ground truth):
@Test(timeout=TEST_TIMEOUT) @Category(SlowTest.class) public void testCreateStoreFile_withInvalidDirectory(){
  String directory="String_Node_Str";
  nearCacheConfig.getPreloaderConfig().setStoreInitialDelaySeconds(1).setStoreIntervalSeconds(1).setDirectory(directory);
  File lockFile=new File(directory,getDefaultStoreFile().getName());
  expectedException.expectMessage("String_Node_Str" + lockFile.getAbsolutePath());
  expectedException.expect(HazelcastException.class);
  createContext(true);
}
Program: 46112
Project: 46112
Buggy source:
/** 
 * Stores the Near Cache keys from the supplied iterator.
 * @param iterator {@link Iterator} over the key set of a {@link com.hazelcast.internal.nearcache.NearCacheRecordStore}
 */
public void storeKeys(Iterator<K> iterator){
  long startedNanos=System.nanoTime();
  FileOutputStream fos=null;
  try {
    lastWrittenBytes=0;
    lastKeyCount=0;
    fos=new FileOutputStream(tmpStoreFile,false);
    writeInt(fos,MAGIC_BYTES);
    writeInt(fos,FileFormat.INTERLEAVED_LENGTH_FIELD.ordinal());
    writeKeySet(fos,fos.getChannel(),iterator);
    if (lastKeyCount == 0) {
      deleteQuietly(storeFile);
      updatePersistenceStats(startedNanos);
      return;
    }
    fos.flush();
    rename(tmpStoreFile,storeFile);
    updatePersistenceStats(startedNanos);
  }
 catch (  Exception e) {
    logger.warning(format("String_Node_Str",nearCacheName,storeFile.getAbsolutePath()),e);
    nearCacheStats.addPersistenceFailure(e);
  }
 finally {
    deleteQuietly(tmpStoreFile);
    closeResource(fos);
  }
}

Fixed version (ground truth):
/** 
 * Stores the Near Cache keys from the supplied iterator.
 * @param iterator {@link Iterator} over the key set of a {@link com.hazelcast.internal.nearcache.NearCacheRecordStore}
 */
public void storeKeys(Iterator<K> iterator){
  long startedNanos=System.nanoTime();
  FileOutputStream fos=null;
  try {
    lastWrittenBytes=0;
    lastKeyCount=0;
    fos=new FileOutputStream(tmpStoreFile,false);
    writeInt(fos,MAGIC_BYTES);
    writeInt(fos,FileFormat.INTERLEAVED_LENGTH_FIELD.ordinal());
    writeKeySet(fos,fos.getChannel(),iterator);
    if (lastKeyCount == 0) {
      deleteQuietly(storeFile);
      updatePersistenceStats(startedNanos);
      return;
    }
    fos.flush();
    closeResource(fos);
    rename(tmpStoreFile,storeFile);
    updatePersistenceStats(startedNanos);
  }
 catch (  Exception e) {
    logger.warning(format("String_Node_Str",nearCacheName,storeFile.getAbsolutePath()),e);
    nearCacheStats.addPersistenceFailure(e);
  }
 finally {
    closeResource(fos);
    deleteQuietly(tmpStoreFile);
  }
}
Program: 46113
Project: 46113
Buggy source:
@Test(timeout=TEST_TIMEOUT) @Category(SlowTest.class) public void testCreateStoreFile_withInvalidDirectory(){
  String directory="String_Node_Str";
  nearCacheConfig.getPreloaderConfig().setStoreInitialDelaySeconds(1).setStoreIntervalSeconds(1).setDirectory(directory);
  expectedException.expectMessage("String_Node_Str" + directory + getStoreFile().getName());
  expectedException.expect(HazelcastException.class);
  createContext(true);
}

Fixed version (ground truth):
@Test(timeout=TEST_TIMEOUT) @Category(SlowTest.class) public void testCreateStoreFile_withInvalidDirectory(){
  String directory="String_Node_Str";
  nearCacheConfig.getPreloaderConfig().setStoreInitialDelaySeconds(1).setStoreIntervalSeconds(1).setDirectory(directory);
  File lockFile=new File(directory,getStoreFile().getName());
  expectedException.expectMessage("String_Node_Str" + lockFile.getAbsolutePath());
  expectedException.expect(HazelcastException.class);
  createContext(true);
}
Program: 46115
Project: 46115
Buggy source:
public ClientInvocationFuture invoke(){
  assert(clientMessage != null);
  try {
    if (urgent) {
      clientMessage.setCorrelationId(callIdSequence.renew());
    }
 else {
      clientMessage.setCorrelationId(callIdSequence.next());
    }
    invokeOnSelection();
  }
 catch (  Exception e) {
    if (e instanceof HazelcastOverloadException) {
      throw (HazelcastOverloadException)e;
    }
    notifyException(e);
  }
  return clientInvocationFuture;
}

Fixed version (ground truth):
public ClientInvocationFuture invoke(){
  assert(clientMessage != null);
  try {
    if (callId == 0) {
      callId=urgent ? callIdSequence.forceNext() : callIdSequence.next();
    }
    clientMessage.setCorrelationId(callId);
    invokeOnSelection();
  }
 catch (  Exception e) {
    if (e instanceof HazelcastOverloadException) {
      throw (HazelcastOverloadException)e;
    }
    notifyException(e);
  }
  return clientInvocationFuture;
}
Program: 46116
Project: 46116
Buggy source:
@Override public void run(){
  try {
    callIdSequence.complete();
    invoke();
  }
 catch (  Throwable e) {
    clientInvocationFuture.complete(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  callId=callIdSequence.forceNext();
  callIdSequence.complete();
  try {
    invoke();
  }
 catch (  Throwable e) {
    clientInvocationFuture.complete(e);
  }
}
Program: 46117
Project: 46117
Buggy source:
public ClientInvocationFuture invokeUrgent(){
  urgent=true;
  return invoke();
}

Fixed version (ground truth):
public ClientInvocationFuture invokeUrgent(){
  assert(clientMessage != null);
  clientMessage.setCorrelationId(callIdSequence.forceNext());
  invokeOnSelection();
  return clientInvocationFuture;
}
Program: 46118
Project: 46118
Buggy source:
public ClientInvocationFuture invoke(){
  assert(clientMessage != null);
  try {
    if (urgent) {
      clientMessage.setCorrelationId(callIdSequence.renew());
    }
 else {
      clientMessage.setCorrelationId(callIdSequence.next());
    }
    invokeOnSelection();
  }
 catch (  Exception e) {
    if (e instanceof HazelcastOverloadException) {
      throw (HazelcastOverloadException)e;
    }
    notifyException(e);
  }
  return clientInvocationFuture;
}

Fixed version (ground truth):
public ClientInvocationFuture invoke(){
  assert(clientMessage != null);
  clientMessage.setCorrelationId(callIdSequence.next());
  invokeOnSelection();
  return clientInvocationFuture;
}
Program: 46119
Project: 46119
Buggy source:
@Override public void run(){
  try {
    callIdSequence.complete();
    invoke();
  }
 catch (  Throwable e) {
    clientInvocationFuture.complete(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  retry();
}
Program: 46120
Project: 46120
Buggy source:
private void invokeOnSelection() throws IOException {
  if (isBindToSingleConnection()) {
    invocationService.invokeOnConnection(this,(ClientConnection)connection);
  }
 else   if (partitionId != -1) {
    invocationService.invokeOnPartitionOwner(this,partitionId);
  }
 else   if (address != null) {
    invocationService.invokeOnTarget(this,address);
  }
 else {
    invocationService.invokeOnRandomTarget(this);
  }
}

Fixed version (ground truth):
private void invokeOnSelection(){
  try {
    if (isBindToSingleConnection()) {
      invocationService.invokeOnConnection(this,(ClientConnection)connection);
    }
 else     if (partitionId != -1) {
      invocationService.invokeOnPartitionOwner(this,partitionId);
    }
 else     if (address != null) {
      invocationService.invokeOnTarget(this,address);
    }
 else {
      invocationService.invokeOnRandomTarget(this);
    }
  }
 catch (  Exception e) {
    if (e instanceof HazelcastOverloadException) {
      throw (HazelcastOverloadException)e;
    }
    notifyException(e);
  }
}
Program: 46121
Project: 46121
Buggy source:
@Override public Class<?>[] getParameterTypes(){
  return parameterTypes;
}

Fixed version (ground truth):
@Override @SuppressFBWarnings("String_Node_Str") public Class<?>[] getParameterTypes(){
  return parameterTypes;
}
Program: 46122
Project: 46122
Buggy source:
/** 
 * Lock a specific key on a local partition only
 * @param key         the key to lock
 * @param caller      the identifier for the caller
 * @param threadId    the identifier for the thread on the caller
 * @param referenceId the identifier for the invocation of the caller (e.g. operation call ID)
 * @param leaseTime   the lease duration in milliseconds
 * @return if the lock was successfully acquired
 */
boolean localLock(Data key,String caller,long threadId,long referenceId,long leaseTime);

Fixed version (ground truth):
/** 
 * Lock a specific key on a local partition only. Does not observe LOCK_MAX_LEASE_TIME_SECONDS
 * @see com.hazelcast.spi.properties.GroupProperty#LOCK_MAX_LEASE_TIME_SECONDS
 * @param key         the key to lock
 * @param caller      the identifier for the caller
 * @param threadId    the identifier for the thread on the caller
 * @param referenceId the identifier for the invocation of the caller (e.g. operation call ID)
 * @param leaseTime   the lease duration in milliseconds
 * @return if the lock was successfully acquired
 */
boolean localLock(Data key,String caller,long threadId,long referenceId,long leaseTime);
Program: 46123
Project: 46123
Buggy source:
@Override public boolean localLock(Data key,String caller,long threadId,long referenceId,long leaseTime){
  leaseTime=getLeaseTime(leaseTime);
  LockResourceImpl lock=getLock(key);
  return lock.lock(caller,threadId,referenceId,leaseTime,false,false,true);
}

Fixed version (ground truth):
@Override public boolean localLock(Data key,String caller,long threadId,long referenceId,long leaseTime){
  LockResourceImpl lock=getLock(key);
  return lock.lock(caller,threadId,referenceId,leaseTime,false,false,true);
}
Program: 46124
Project: 46124
Buggy source:
@Override protected void readInternal(ObjectDataInput in) throws IOException {
  super.readInternal(in);
  name=in.readUTF();
  String modificationTypeName=in.readUTF();
  modificationType=modificationTypeName.equals("String_Node_Str") ? null : EntryEventType.valueOf(modificationTypeName);
  oldValue=in.readData();
  value=in.readData();
  caller=in.readUTF();
  threadId=in.readLong();
  begin=in.readLong();
  entryBackupProcessor=in.readObject();
}

Fixed version (ground truth):
@Override protected void readInternal(ObjectDataInput in) throws IOException {
  super.readInternal(in);
  String modificationTypeName=in.readUTF();
  modificationType=modificationTypeName.equals("String_Node_Str") ? null : EntryEventType.valueOf(modificationTypeName);
  oldValue=in.readData();
  value=in.readData();
  caller=in.readUTF();
  begin=in.readLong();
  entryBackupProcessor=in.readObject();
}
Program: 46125
Project: 46125
Buggy source:
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  out.writeUTF(name);
  out.writeUTF(modificationType != null ? modificationType.name() : "String_Node_Str");
  out.writeData(oldValue);
  out.writeData(value);
  out.writeUTF(caller);
  out.writeLong(threadId);
  out.writeLong(begin);
  out.writeObject(entryBackupProcessor);
}

Fixed version (ground truth):
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  out.writeUTF(modificationType != null ? modificationType.name() : "String_Node_Str");
  out.writeData(oldValue);
  out.writeData(value);
  out.writeUTF(caller);
  out.writeLong(begin);
  out.writeObject(entryBackupProcessor);
}
Program: 46126
Project: 46126
Buggy source:
public EntryOffloadableSetUnlockOperation(String name,EntryEventType modificationType,Data key,Data oldValue,Data value,String caller,long threadId,long begin,EntryBackupProcessor entryBackupProcessor){
  super(name,key,value);
  this.name=name;
  this.value=value;
  this.oldValue=oldValue;
  this.caller=caller;
  this.begin=begin;
  this.threadId=threadId;
  this.modificationType=modificationType;
  this.entryBackupProcessor=entryBackupProcessor;
}

Fixed version (ground truth):
public EntryOffloadableSetUnlockOperation(String name,EntryEventType modificationType,Data key,Data oldValue,Data value,String caller,long threadId,long begin,EntryBackupProcessor entryBackupProcessor){
  super(name,key,value);
  this.value=value;
  this.oldValue=oldValue;
  this.caller=caller;
  this.begin=begin;
  this.modificationType=modificationType;
  this.entryBackupProcessor=entryBackupProcessor;
  this.setThreadId(threadId);
}
Program: 46127
Project: 46127
Buggy source:
@SuppressWarnings("String_Node_Str") private void runOffloadedModifyingEntryProcessor(final Object previousValue,String executorName){
  final OperationServiceImpl ops=(OperationServiceImpl)getNodeEngine().getOperationService();
  final Data finalDataKey=dataKey;
  final String finalCaller=getCallerUuid();
  final long finalThreadId=threadId;
  final long finalCallId=getCallId();
  final long finalBegin=begin;
  recordStore.localLock(finalDataKey,finalCaller,finalThreadId,finalCallId,Long.MAX_VALUE);
  ops.onStartAsyncOperation(this);
  getNodeEngine().getExecutionService().execute(executorName,new Runnable(){
    @Override public void run(){
      try {
        final Map.Entry entry=createMapEntry(dataKey,previousValue);
        final Data result=process(entry);
        if (!noOp(entry,previousValue)) {
          Data newValue=toData(entry.getValue());
          EntryEventType modificationType;
          if (entry.getValue() == null) {
            modificationType=REMOVED;
          }
 else {
            modificationType=(previousValue == null) ? ADDED : UPDATED;
          }
          updateAndUnlock(toData(previousValue),newValue,modificationType,finalCaller,finalThreadId,result,finalBegin);
        }
 else {
          unlockOnly(result,finalCaller,finalThreadId,finalBegin);
        }
      }
 catch (      Throwable t) {
        unlockOnly(t,finalCaller,finalThreadId,finalBegin);
      }
    }
  }
);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void runOffloadedModifyingEntryProcessor(final Object previousValue,String executorName){
  final OperationServiceImpl ops=(OperationServiceImpl)getNodeEngine().getOperationService();
  final Data finalDataKey=dataKey;
  final String finalCaller=getCallerUuid();
  final long finalThreadId=threadId;
  final long finalCallId=getCallId();
  final long finalBegin=begin;
  recordStore.localLock(finalDataKey,finalCaller,finalThreadId,finalCallId,-1);
  ops.onStartAsyncOperation(this);
  getNodeEngine().getExecutionService().execute(executorName,new Runnable(){
    @Override public void run(){
      try {
        final Map.Entry entry=createMapEntry(dataKey,previousValue);
        final Data result=process(entry);
        if (!noOp(entry,previousValue)) {
          Data newValue=toData(entry.getValue());
          EntryEventType modificationType;
          if (entry.getValue() == null) {
            modificationType=REMOVED;
          }
 else {
            modificationType=(previousValue == null) ? ADDED : UPDATED;
          }
          updateAndUnlock(toData(previousValue),newValue,modificationType,finalCaller,finalThreadId,result,finalBegin);
        }
 else {
          unlockOnly(result,finalCaller,finalThreadId,finalBegin);
        }
      }
 catch (      Throwable t) {
        unlockOnly(t,finalCaller,finalThreadId,finalBegin);
      }
    }
  }
);
}
Program: 46129
Project: 46129
Buggy source:
@Test public void testExecuteScriptRequest_whenTargetAllMembers() throws Exception {
  ExecuteScriptRequest request=new ExecuteScriptRequest("String_Node_Str","String_Node_Str",true,null);
  JsonObject jsonObject=new JsonObject();
  request.writeResponse(managementCenterService,jsonObject);
  JsonObject result=(JsonObject)jsonObject.get("String_Node_Str");
  String response=(String)request.readResponse(result);
  assertEquals(format("String_Node_Str"),response);
}

Fixed version (ground truth):
@Test public void testExecuteScriptRequest_whenTargetAllMembers() throws Exception {
  ExecuteScriptRequest request=new ExecuteScriptRequest("String_Node_Str","String_Node_Str",true,null);
  JsonObject jsonObject=new JsonObject();
  request.writeResponse(managementCenterService,jsonObject);
  JsonObject result=(JsonObject)jsonObject.get("String_Node_Str");
  String response=(String)request.readResponse(result);
  assertEquals("String_Node_Str",response);
}
Program: 46130
Project: 46130
Buggy source:
@Test public void testLifecycle(){
  hz.shutdown();
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      plugin.run(logWriter);
      assertContains("String_Node_Str" + "String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
@Test public void testLifecycle(){
  hz.shutdown();
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      plugin.run(logWriter);
      assertContains("String_Node_Str" + LINE_SEPARATOR + "String_Node_Str");
    }
  }
);
}
Program: 46131
Project: 46131
Buggy source:
@Test(expected=InvalidConfigurationException.class) public void testImportEmptyResourceContent() throws Exception {
  File config=createConfigFile("String_Node_Str","String_Node_Str");
  FileOutputStream os=new FileOutputStream(config);
  String config1Xml=HAZELCAST_CLIENT_START_TAG + "String_Node_Str" + config.getAbsolutePath()+ "String_Node_Str"+ "String_Node_Str";
  writeStringToStreamAndClose(os,"String_Node_Str");
  buildConfig(config1Xml);
}

Fixed version (ground truth):
@Test(expected=InvalidConfigurationException.class) public void testImportEmptyResourceContent() throws Exception {
  File config=createConfigFile("String_Node_Str","String_Node_Str");
  FileOutputStream os=new FileOutputStream(config);
  String configXml=HAZELCAST_CLIENT_START_TAG + "String_Node_Str" + config.getAbsolutePath()+ "String_Node_Str"+ "String_Node_Str";
  writeStringToStreamAndClose(os,"String_Node_Str");
  buildConfig(configXml);
}
Program: 46132
Project: 46132
Buggy source:
@Test public void testLifecycle(){
  hz.shutdown();
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      plugin.run(logWriter);
      assertContains("String_Node_Str" + "String_Node_Str");
    }
  }
);
}

Fixed version (ground truth):
@Test public void testLifecycle(){
  hz.shutdown();
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      plugin.run(logWriter);
      assertContains("String_Node_Str" + LINE_SEPARATOR + "String_Node_Str");
    }
  }
);
}
Program: 46133
Project: 46133
Buggy source:
@Test public void testExecuteScriptRequest_whenTargetAllMembers() throws Exception {
  ExecuteScriptRequest request=new ExecuteScriptRequest("String_Node_Str","String_Node_Str",true,null);
  JsonObject jsonObject=new JsonObject();
  request.writeResponse(managementCenterService,jsonObject);
  JsonObject result=(JsonObject)jsonObject.get("String_Node_Str");
  String response=(String)request.readResponse(result);
  assertEquals(format("String_Node_Str"),response);
}

Fixed version (ground truth):
@Test public void testExecuteScriptRequest_whenTargetAllMembers() throws Exception {
  ExecuteScriptRequest request=new ExecuteScriptRequest("String_Node_Str","String_Node_Str",true,null);
  JsonObject jsonObject=new JsonObject();
  request.writeResponse(managementCenterService,jsonObject);
  JsonObject result=(JsonObject)jsonObject.get("String_Node_Str");
  String response=(String)request.readResponse(result);
  assertEquals("String_Node_Str",response);
}
Program: 46134
Project: 46134
Buggy source:
@Test(expected=InvalidConfigurationException.class) public void testImportEmptyResourceContent() throws Exception {
  File config=createConfigFile("String_Node_Str","String_Node_Str");
  FileOutputStream os=new FileOutputStream(config);
  String config1Xml=HAZELCAST_CLIENT_START_TAG + "String_Node_Str" + config.getAbsolutePath()+ "String_Node_Str"+ "String_Node_Str";
  writeStringToStreamAndClose(os,"String_Node_Str");
  buildConfig(config1Xml);
}

Fixed version (ground truth):
@Test(expected=InvalidConfigurationException.class) public void testImportEmptyResourceContent() throws Exception {
  File config=createConfigFile("String_Node_Str","String_Node_Str");
  FileOutputStream os=new FileOutputStream(config);
  String configXml=HAZELCAST_CLIENT_START_TAG + "String_Node_Str" + config.getAbsolutePath()+ "String_Node_Str"+ "String_Node_Str";
  writeStringToStreamAndClose(os,"String_Node_Str");
  buildConfig(configXml);
}
Program: 46135
Project: 46135
Buggy source:
@Test public void test_AbstractDiscoveryStrategy_getOrNull() throws Exception {
  PropertyDefinition first=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.STRING);
  PropertyDefinition second=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.BOOLEAN);
  PropertyDefinition third=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.INTEGER);
  PropertyDefinition fourth=new SimplePropertyDefinition("String_Node_Str",true,PropertyTypeConverter.STRING);
  Map<String,Comparable> properties=new HashMap<String,Comparable>();
  properties.put("String_Node_Str","String_Node_Str");
  properties.put("String_Node_Str",Boolean.FALSE);
  properties.put("String_Node_Str",100);
  setEnvironment("String_Node_Str","String_Node_Str");
  setEnvironment("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  PropertyDiscoveryStrategy strategy=new PropertyDiscoveryStrategy(LOGGER,properties);
  assertEquals("String_Node_Str",strategy.getOrNull(first));
  assertEquals(Boolean.FALSE,strategy.getOrNull(second));
  assertEquals(100,strategy.getOrNull(third));
  assertNull(strategy.getOrNull(fourth));
  assertEquals("String_Node_Str",strategy.getOrNull("String_Node_Str",first));
  assertEquals(Boolean.TRUE,strategy.getOrNull("String_Node_Str",second));
  assertEquals(300,strategy.getOrNull("String_Node_Str",third));
  assertNull(strategy.getOrNull("String_Node_Str",fourth));
}

Fixed version (ground truth):
@Test public void test_AbstractDiscoveryStrategy_getOrNull() throws Exception {
  PropertyDefinition first=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.STRING);
  PropertyDefinition second=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.BOOLEAN);
  PropertyDefinition third=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.INTEGER);
  PropertyDefinition fourth=new SimplePropertyDefinition("String_Node_Str",true,PropertyTypeConverter.STRING);
  Map<String,Comparable> properties=new HashMap<String,Comparable>();
  properties.put("String_Node_Str","String_Node_Str");
  properties.put("String_Node_Str",Boolean.FALSE);
  properties.put("String_Node_Str",100);
  setEnvironment("String_Node_Str","String_Node_Str");
  setEnvironment("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  PropertyDiscoveryStrategy strategy=new PropertyDiscoveryStrategy(LOGGER,properties);
  assertEquals("String_Node_Str",strategy.getOrNull(first));
  assertEquals(Boolean.FALSE,strategy.getOrNull(second));
  assertEquals(100,strategy.getOrNull(third));
  assertNull(strategy.getOrNull(fourth));
  if (System.getenv("String_Node_Str") != null) {
    assertEquals("String_Node_Str",strategy.getOrNull("String_Node_Str",first));
    assertEquals(Boolean.TRUE,strategy.getOrNull("String_Node_Str",second));
    assertEquals(300,strategy.getOrNull("String_Node_Str",third));
    assertNull(strategy.getOrNull("String_Node_Str",fourth));
  }
}
Program: 46136
Project: 46136
Buggy source:
@Test public void test_AbstractDiscoveryStrategy_getOrNull() throws Exception {
  PropertyDefinition first=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.STRING);
  PropertyDefinition second=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.BOOLEAN);
  PropertyDefinition third=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.INTEGER);
  PropertyDefinition fourth=new SimplePropertyDefinition("String_Node_Str",true,PropertyTypeConverter.STRING);
  Map<String,Comparable> properties=new HashMap<String,Comparable>();
  properties.put("String_Node_Str","String_Node_Str");
  properties.put("String_Node_Str",Boolean.FALSE);
  properties.put("String_Node_Str",100);
  setEnvironment("String_Node_Str","String_Node_Str");
  setEnvironment("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  PropertyDiscoveryStrategy strategy=new PropertyDiscoveryStrategy(LOGGER,properties);
  assertEquals("String_Node_Str",strategy.getOrNull(first));
  assertEquals(Boolean.FALSE,strategy.getOrNull(second));
  assertEquals(100,strategy.getOrNull(third));
  assertNull(strategy.getOrNull(fourth));
  assertEquals("String_Node_Str",strategy.getOrNull("String_Node_Str",first));
  assertEquals(Boolean.TRUE,strategy.getOrNull("String_Node_Str",second));
  assertEquals(300,strategy.getOrNull("String_Node_Str",third));
  assertNull(strategy.getOrNull("String_Node_Str",fourth));
}

Fixed version (ground truth):
@Test public void test_AbstractDiscoveryStrategy_getOrNull() throws Exception {
  PropertyDefinition first=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.STRING);
  PropertyDefinition second=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.BOOLEAN);
  PropertyDefinition third=new SimplePropertyDefinition("String_Node_Str",PropertyTypeConverter.INTEGER);
  PropertyDefinition fourth=new SimplePropertyDefinition("String_Node_Str",true,PropertyTypeConverter.STRING);
  Map<String,Comparable> properties=new HashMap<String,Comparable>();
  properties.put("String_Node_Str","String_Node_Str");
  properties.put("String_Node_Str",Boolean.FALSE);
  properties.put("String_Node_Str",100);
  setEnvironment("String_Node_Str","String_Node_Str");
  setEnvironment("String_Node_Str","String_Node_Str");
  System.setProperty("String_Node_Str","String_Node_Str");
  PropertyDiscoveryStrategy strategy=new PropertyDiscoveryStrategy(LOGGER,properties);
  assertEquals("String_Node_Str",strategy.getOrNull(first));
  assertEquals(Boolean.FALSE,strategy.getOrNull(second));
  assertEquals(100,strategy.getOrNull(third));
  assertNull(strategy.getOrNull(fourth));
  if (System.getenv("String_Node_Str") != null) {
    assertEquals("String_Node_Str",strategy.getOrNull("String_Node_Str",first));
    assertEquals(Boolean.TRUE,strategy.getOrNull("String_Node_Str",second));
    assertEquals(300,strategy.getOrNull("String_Node_Str",third));
    assertNull(strategy.getOrNull("String_Node_Str",fourth));
  }
}
Program: 46137
Project: 46137
Buggy source:
TaskPollThread(){
  super(threadGroup.getInternalThreadGroup(),threadGroup.getThreadNamePrefix("String_Node_Str"));
  register(new ThreadDumpRequest());
  register(new ExecuteScriptRequest());
  register(new ConsoleCommandRequest());
  register(new MapConfigRequest());
  register(new ChangeWanStateRequest());
  register(new MemberConfigRequest());
  register(new ClusterPropsRequest());
  register(new RunGcRequest());
  register(new GetMemberSystemPropertiesRequest());
  register(new GetMapEntryRequest());
  register(new GetCacheEntryRequest());
  register(new GetClusterStateRequest());
  register(new ChangeClusterStateRequest());
  register(new ShutdownClusterRequest());
  register(new ForceStartNodeRequest());
  register(new TriggerPartialStartRequest());
  register(new ClearWanQueuesRequest());
}

Fixed version (ground truth):
TaskPollThread(){
  super(threadGroup.getInternalThreadGroup(),threadGroup.getThreadNamePrefix("String_Node_Str"));
  register(new ThreadDumpRequest());
  register(new ExecuteScriptRequest());
  register(new ConsoleCommandRequest());
  register(new MapConfigRequest());
  register(new ChangeWanStateRequest());
  register(new MemberConfigRequest());
  register(new ClusterPropsRequest());
  register(new RunGcRequest());
  register(new GetMemberSystemPropertiesRequest());
  register(new GetMapEntryRequest());
  if (JCacheDetector.isJCacheAvailable(instance.node.getNodeEngine().getConfigClassLoader(),logger)) {
    register(new GetCacheEntryRequest());
  }
 else {
    logger.finest("String_Node_Str");
  }
  register(new GetClusterStateRequest());
  register(new ChangeClusterStateRequest());
  register(new ShutdownClusterRequest());
  register(new ForceStartNodeRequest());
  register(new TriggerPartialStartRequest());
  register(new ClearWanQueuesRequest());
}
Program: 46138
Project: 46138
Buggy source:
private ClientConfig newClientConfig(String mapName){
  NearCacheConfig nearCacheConfig=new NearCacheConfig();
  nearCacheConfig.setInMemoryFormat(getNearCacheInMemoryFormat());
  nearCacheConfig.setName(mapName);
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setCacheLocalEntries(true);
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  return clientConfig;
}

Fixed version (ground truth):
protected ClientConfig newClientConfig(String mapName){
  NearCacheConfig nearCacheConfig=new NearCacheConfig();
  nearCacheConfig.setInMemoryFormat(getNearCacheInMemoryFormat());
  nearCacheConfig.setName(mapName);
  nearCacheConfig.setInvalidateOnChange(true);
  nearCacheConfig.setCacheLocalEntries(true);
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  return clientConfig;
}
Program: 46139
Project: 46139
Buggy source:
private void waitResponseFromAllPartitionsForPutAll(List<FutureEntriesTuple> futureEntriesTuples,long start,Map<Data,Boolean> markers){
  Throwable error=null;
  for (  FutureEntriesTuple tuple : futureEntriesTuples) {
    Future future=tuple.future;
    List<Map.Entry<Data,Data>> entries=tuple.entries;
    try {
      future.get();
      if (nearCache != null) {
        handleNearCacheOnPutAll(entries,markers);
      }
      if (statisticsEnabled) {
        statistics.increaseCachePuts(entries.size());
      }
    }
 catch (    Throwable t) {
      if (nearCache != null) {
        handleNearCacheOnPutAll(entries,markers);
      }
      logger.finest("String_Node_Str",t);
      if (error == null) {
        error=t;
      }
    }
  }
  if (statisticsEnabled) {
    statistics.addPutTimeNanos(System.nanoTime() - start);
  }
  if (error != null) {
    throw rethrow(error);
  }
}

Fixed version (ground truth):
private void waitResponseFromAllPartitionsForPutAll(List<FutureEntriesTuple> futureEntriesTuples,long start){
  Throwable error=null;
  for (  FutureEntriesTuple tuple : futureEntriesTuples) {
    Future future=tuple.future;
    List<Map.Entry<Data,Data>> entries=tuple.entries;
    try {
      future.get();
      if (nearCache != null) {
        handleNearCacheOnPutAll(entries);
      }
      if (statisticsEnabled) {
        statistics.increaseCachePuts(entries.size());
      }
    }
 catch (    Throwable t) {
      if (nearCache != null) {
        handleNearCacheOnPutAll(entries);
      }
      logger.finest("String_Node_Str",t);
      if (error == null) {
        error=t;
      }
    }
  }
  if (statisticsEnabled) {
    statistics.addPutTimeNanos(System.nanoTime() - start);
  }
  if (error != null) {
    throw rethrow(error);
  }
}
Program: 46140
Project: 46140
Buggy source:
@Override public boolean replace(K key,V value,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  final Future<Boolean> f=replaceInternal(key,null,value,expiryPolicy,false,true,false);
  try {
    boolean replaced=f.get();
    if (statisticsEnabled) {
      handleStatisticsOnReplace(false,start,replaced);
    }
    return replaced;
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public boolean replace(K key,V value,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  final Future<Boolean> f=replaceInternal(key,null,value,expiryPolicy,false,true,false);
  try {
    boolean replaced=f.get();
    if (statisticsEnabled) {
      handleStatisticsOnReplace(false,start,replaced);
    }
    return replaced;
  }
 catch (  Throwable e) {
    throw rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 46141
Project: 46141
Buggy source:
public void onFailure(Throwable t){
  resetToUnmarkedState(keyData);
}

Fixed version (ground truth):
public void onFailure(Throwable t){
  invalidateNearCache(keyData);
}
Program: 46142
Project: 46142
Buggy source:
public void onResponse(Data valueData){
  storeInNearCache(keyData,valueData,null,marked);
  if (statisticsEnabled) {
    handleStatisticsOnGet(start,valueData);
  }
}

Fixed version (ground truth):
public void onResponse(Data valueData){
  storeInNearCache(keyData,valueData,null,reservationId,false);
  if (statisticsEnabled) {
    handleStatisticsOnGet(start,valueData);
  }
}
Program: 46143
Project: 46143
Buggy source:
@Override public void putAll(Map<? extends K,? extends V> map,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  ensureOpen();
  validateNotNull(map);
  ClientPartitionService partitionService=clientContext.getPartitionService();
  int partitionCount=partitionService.getPartitionCount();
  Map<Data,Boolean> markers=createHashMap(map.size());
  try {
    List<Map.Entry<Data,Data>>[] entriesPerPartition=groupDataToPartitions(map,partitionService,partitionCount);
    putToAllPartitionsAndWaitForCompletion(entriesPerPartition,expiryPolicy,start,markers);
  }
 catch (  Exception e) {
    throw rethrow(e);
  }
 finally {
    unmarkRemainingMarkedKeys(markers);
  }
}

Fixed version (ground truth):
@Override public void putAll(Map<? extends K,? extends V> map,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  ensureOpen();
  validateNotNull(map);
  try {
    ClientPartitionService partitionService=clientContext.getPartitionService();
    int partitionCount=partitionService.getPartitionCount();
    List<Map.Entry<Data,Data>>[] entriesPerPartition=groupDataToPartitions(map,partitionService,partitionCount);
    putToAllPartitionsAndWaitForCompletion(entriesPerPartition,expiryPolicy,start);
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 46146
Project: 46146
Buggy source:
@Override public V getAndReplace(K key,V value,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  final Future<V> f=replaceAndGetAsyncInternal(key,null,value,expiryPolicy,false,true,false);
  try {
    V oldValue=f.get();
    if (statisticsEnabled) {
      handleStatisticsOnReplace(true,start,oldValue);
    }
    return oldValue;
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V getAndReplace(K key,V value,ExpiryPolicy expiryPolicy){
  final long start=System.nanoTime();
  final Future<V> f=replaceAndGetAsyncInternal(key,null,value,expiryPolicy,false,true,false);
  try {
    V oldValue=f.get();
    if (statisticsEnabled) {
      handleStatisticsOnReplace(true,start,oldValue);
    }
    return oldValue;
  }
 catch (  Throwable e) {
    throw rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 46147
Project: 46147
Buggy source:
@Override public int size(){
  ensureOpen();
  try {
    ClientMessage request=CacheSizeCodec.encodeRequest(nameWithPrefix);
    ClientMessage resultMessage=invoke(request);
    return CacheSizeCodec.decodeResponse(resultMessage).response;
  }
 catch (  Throwable t) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(t,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public int size(){
  ensureOpen();
  try {
    ClientMessage request=CacheSizeCodec.encodeRequest(nameWithPrefix);
    ClientMessage resultMessage=invoke(request);
    return CacheSizeCodec.decodeResponse(resultMessage).response;
  }
 catch (  Throwable t) {
    throw rethrowAllowedTypeFirst(t,CacheException.class);
  }
}
Program: 46148
Project: 46148
Buggy source:
private void putToAllPartitionsAndWaitForCompletion(List<Map.Entry<Data,Data>>[] entriesPerPartition,ExpiryPolicy expiryPolicy,long start,Map<Data,Boolean> markers) throws ExecutionException, InterruptedException {
  Data expiryPolicyData=toData(expiryPolicy);
  List<FutureEntriesTuple> futureEntriesTuples=new ArrayList<FutureEntriesTuple>(entriesPerPartition.length);
  for (int partitionId=0; partitionId < entriesPerPartition.length; partitionId++) {
    List<Map.Entry<Data,Data>> entries=entriesPerPartition[partitionId];
    if (entries != null) {
      for (      Map.Entry<Data,Data> entry : entries) {
        Data key=entry.getKey();
        markers.put(key,!cacheOnUpdate || keyStateMarker.markIfUnmarked(key));
      }
      int completionId=nextCompletionId();
      ClientMessage request=CachePutAllCodec.encodeRequest(nameWithPrefix,entries,expiryPolicyData,completionId);
      Future f=invoke(request,partitionId,completionId);
      futureEntriesTuples.add(new FutureEntriesTuple(f,entries));
    }
  }
  waitResponseFromAllPartitionsForPutAll(futureEntriesTuples,start,markers);
}

Fixed version (ground truth):
private void putToAllPartitionsAndWaitForCompletion(List<Map.Entry<Data,Data>>[] entriesPerPartition,ExpiryPolicy expiryPolicy,long start) throws ExecutionException, InterruptedException {
  Data expiryPolicyData=toData(expiryPolicy);
  List<FutureEntriesTuple> futureEntriesTuples=new ArrayList<FutureEntriesTuple>(entriesPerPartition.length);
  for (int partitionId=0; partitionId < entriesPerPartition.length; partitionId++) {
    List<Map.Entry<Data,Data>> entries=entriesPerPartition[partitionId];
    if (entries != null) {
      int completionId=nextCompletionId();
      ClientMessage request=CachePutAllCodec.encodeRequest(nameWithPrefix,entries,expiryPolicyData,completionId);
      Future f=invoke(request,partitionId,completionId);
      futureEntriesTuples.add(new FutureEntriesTuple(f,entries));
    }
  }
  waitResponseFromAllPartitionsForPutAll(futureEntriesTuples,start);
}
Program: 46149
Project: 46149
Buggy source:
private void handleNearCacheOnPutAll(List<Map.Entry<Data,Data>> entries,Map<Data,Boolean> markers){
  if (nearCache != null) {
    if (cacheOnUpdate) {
      for (      Map.Entry<Data,Data> entry : entries) {
        Data key=entry.getKey();
        storeInNearCache(key,entry.getValue(),null,markers.get(key));
      }
    }
 else {
      for (      Map.Entry<Data,Data> entry : entries) {
        invalidateNearCache(entry.getKey());
      }
    }
  }
}

Fixed version (ground truth):
private void handleNearCacheOnPutAll(List<Map.Entry<Data,Data>> entries){
  if (nearCache == null) {
    return;
  }
  for (  Map.Entry<Data,Data> entry : entries) {
    if (cacheOnUpdate) {
      storeInNearCache(entry.getKey(),entry.getValue(),null,NOT_RESERVED,cacheOnUpdate);
    }
 else {
      invalidateNearCache(entry.getKey());
    }
  }
}