nus-yam/ex-repair huggingface dataset:
Program: 47204
Project: 47204
Buggy source:
public void updateMembers(Collection<MemberInfo> members){
  lock.lock();
  try {
    Map<Address,MemberImpl> oldMemberMap=membersMapRef.get();
    if (oldMemberMap.size() == members.size()) {
      boolean same=true;
      for (      MemberInfo memberInfo : members) {
        MemberImpl member=oldMemberMap.get(memberInfo.getAddress());
        if (member == null || !member.getUuid().equals(memberInfo.getUuid())) {
          same=false;
          break;
        }
      }
      if (same) {
        logger.finest("String_Node_Str");
        return;
      }
    }
    MemberImpl[] newMembers=new MemberImpl[members.size()];
    int k=0;
    for (    MemberInfo memberInfo : members) {
      MemberImpl member=oldMemberMap.get(memberInfo.getAddress());
      if (member == null) {
        member=createMember(memberInfo.getAddress(),memberInfo.getUuid(),thisAddress.getScopeId(),memberInfo.getAttributes());
      }
      newMembers[k++]=member;
      member.didRead();
    }
    setMembers(newMembers);
    if (!getMemberList().contains(thisMember)) {
      throw new HazelcastException("String_Node_Str");
    }
    joinReset();
    heartBeater();
    node.setJoined();
    logger.info(membersString());
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
public void updateMembers(Collection<MemberInfo> members){
  lock.lock();
  try {
    Map<Address,MemberImpl> currentMemberMap=membersMapRef.get();
    if (!shouldProcessMemberUpdate(currentMemberMap,members)) {
      return;
    }
    MemberImpl[] newMembers=new MemberImpl[members.size()];
    int k=0;
    for (    MemberInfo memberInfo : members) {
      MemberImpl member=currentMemberMap.get(memberInfo.getAddress());
      if (member == null) {
        member=createMember(memberInfo.getAddress(),memberInfo.getUuid(),thisAddress.getScopeId(),memberInfo.getAttributes());
      }
      newMembers[k++]=member;
      member.didRead();
    }
    setMembers(newMembers);
    if (!getMemberList().contains(thisMember)) {
      throw new HazelcastException("String_Node_Str");
    }
    joinReset();
    heartBeater();
    node.setJoined();
    logger.info(membersString());
  }
  finally {
    lock.unlock();
  }
}
Program: 47205
Project: 47205
Buggy source:
SerializationServiceImpl(InputOutputFactory inputOutputFactory,int version,ClassLoader classLoader,Map<Integer,? extends DataSerializableFactory> dataSerializableFactories,Map<Integer,? extends PortableFactory> portableFactories,Collection<ClassDefinition> classDefinitions,boolean checkClassDefErrors,ManagedContext managedContext,PartitioningStrategy partitionStrategy,int initialOutputBufferSize,boolean enableCompression,boolean enableSharedObject){
  this.inputOutputFactory=inputOutputFactory;
  this.classLoader=classLoader;
  this.managedContext=managedContext;
  this.globalPartitioningStrategy=partitionStrategy;
  this.outputBufferSize=initialOutputBufferSize;
  dataOutputQueue=new ThreadLocalOutputCache(this);
  PortableHookLoader loader=new PortableHookLoader(portableFactories,classLoader);
  portableContext=new PortableContextImpl(this,version);
  for (  ClassDefinition cd : loader.getDefinitions()) {
    portableContext.registerClassDefinition(cd);
  }
  dataSerializerAdapter=createSerializerAdapter(new DataSerializer(dataSerializableFactories,classLoader));
  portableSerializer=new PortableSerializer(portableContext,loader.getFactories());
  portableSerializerAdapter=createSerializerAdapter(portableSerializer);
  registerConstantSerializers();
  registerJvmTypeSerializers(enableCompression,enableSharedObject);
  registerClassDefinitions(classDefinitions,checkClassDefErrors);
}

Fixed version (ground truth):
SerializationServiceImpl(InputOutputFactory inputOutputFactory,int version,ClassLoader classLoader,Map<Integer,? extends DataSerializableFactory> dataSerializableFactories,Map<Integer,? extends PortableFactory> portableFactories,Collection<ClassDefinition> classDefinitions,boolean checkClassDefErrors,ManagedContext managedContext,PartitioningStrategy partitionStrategy,int initialOutputBufferSize,boolean enableCompression,boolean enableSharedObject){
  this.inputOutputFactory=inputOutputFactory;
  this.classLoader=classLoader;
  this.managedContext=managedContext;
  this.globalPartitioningStrategy=partitionStrategy;
  this.outputBufferSize=initialOutputBufferSize;
  this.overrideCustomSerialization=parseBoolean(System.getProperty(SERIALIZATION_CUSTOM_OVERRIDE,"String_Node_Str"));
  dataOutputQueue=new ThreadLocalOutputCache(this);
  PortableHookLoader loader=new PortableHookLoader(portableFactories,classLoader);
  portableContext=new PortableContextImpl(this,version);
  for (  ClassDefinition cd : loader.getDefinitions()) {
    portableContext.registerClassDefinition(cd);
  }
  dataSerializerAdapter=createSerializerAdapter(new DataSerializer(dataSerializableFactories,classLoader));
  portableSerializer=new PortableSerializer(portableContext,loader.getFactories());
  portableSerializerAdapter=createSerializerAdapter(portableSerializer);
  registerConstantSerializers();
  registerJvmTypeSerializers(enableCompression,enableSharedObject);
  registerClassDefinitions(classDefinitions,checkClassDefErrors);
}
Program: 47206
Project: 47206
Buggy source:
private boolean isJoinRequestFromAnExistingMember(JoinRequest joinRequest,Connection connection){
  MemberImpl member=getMember(joinRequest.getAddress());
  if (member == null) {
    return false;
  }
  Address target=member.getAddress();
  if (joinRequest.getUuid().equals(member.getUuid())) {
    if (node.isMaster()) {
      if (logger.isFinestEnabled()) {
        String message="String_Node_Str" + joinRequest;
        logger.finest(message);
      }
      final Operation[] postJoinOps=nodeEngine.getPostJoinOperations();
      final PostJoinOperation postJoinOp=postJoinOps != null && postJoinOps.length > 0 ? new PostJoinOperation(postJoinOps) : null;
      Operation op=new FinalizeJoinOperation(createMemberInfos(getMemberList()),postJoinOp,clusterClock.getClusterTime(),false);
      nodeEngine.getOperationService().send(op,target);
    }
 else {
      sendMasterAnswer(target);
    }
    return true;
  }
  if (node.isMaster() || target.equals(node.getMasterAddress())) {
    logger.warning("String_Node_Str" + member + "String_Node_Str");
    doRemoveAddress(target,false);
    Connection existing=node.connectionManager.getConnection(target);
    if (existing != connection) {
      node.connectionManager.destroyConnection(existing);
      node.connectionManager.registerConnection(target,connection);
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean isJoinRequestFromAnExistingMember(JoinRequest joinRequest,Connection connection){
  MemberImpl member=getMember(joinRequest.getAddress());
  if (member == null) {
    return false;
  }
  Address target=member.getAddress();
  if (joinRequest.getUuid().equals(member.getUuid())) {
    if (node.isMaster()) {
      if (logger.isFinestEnabled()) {
        String message="String_Node_Str" + joinRequest;
        logger.finest(message);
      }
      final Operation[] postJoinOps=nodeEngine.getPostJoinOperations();
      final PostJoinOperation postJoinOp=postJoinOps != null && postJoinOps.length > 0 ? new PostJoinOperation(postJoinOps) : null;
      Operation op=new FinalizeJoinOperation(createMemberInfoList(getMemberList()),postJoinOp,clusterClock.getClusterTime(),false);
      nodeEngine.getOperationService().send(op,target);
    }
 else {
      sendMasterAnswer(target);
    }
    return true;
  }
  if (node.isMaster() || target.equals(node.getMasterAddress())) {
    logger.warning("String_Node_Str" + member + "String_Node_Str");
    doRemoveAddress(target,false);
    Connection existing=node.connectionManager.getConnection(target);
    if (existing != connection) {
      node.connectionManager.destroyConnection(existing);
      node.connectionManager.registerConnection(target,connection);
    }
    return false;
  }
  return true;
}
Program: 47208
Project: 47208
Buggy source:
private void sendMemberListToOthers(){
  if (!isMaster()) {
    return;
  }
  final Collection<MemberImpl> members=getMemberList();
  MemberInfoUpdateOperation op=new MemberInfoUpdateOperation(createMemberInfos(members),clusterClock.getClusterTime(),false);
  for (  MemberImpl member : members) {
    if (member.equals(thisMember)) {
      continue;
    }
    nodeEngine.getOperationService().send(op,member.getAddress());
  }
}

Fixed version (ground truth):
private void sendMemberListToOthers(){
  if (!isMaster()) {
    return;
  }
  final Collection<MemberImpl> members=getMemberList();
  MemberInfoUpdateOperation op=new MemberInfoUpdateOperation(createMemberInfoList(members),clusterClock.getClusterTime(),false);
  for (  MemberImpl member : members) {
    if (member.equals(thisMember)) {
      continue;
    }
    nodeEngine.getOperationService().send(op,member.getAddress());
  }
}
Program: 47209
Project: 47209
Buggy source:
public void updateMembers(Collection<MemberInfo> members){
  lock.lock();
  try {
    Map<Address,MemberImpl> oldMemberMap=membersMapRef.get();
    if (oldMemberMap.size() == members.size()) {
      boolean same=true;
      for (      MemberInfo memberInfo : members) {
        MemberImpl member=oldMemberMap.get(memberInfo.getAddress());
        if (member == null || !member.getUuid().equals(memberInfo.getUuid())) {
          same=false;
          break;
        }
      }
      if (same) {
        logger.finest("String_Node_Str");
        return;
      }
    }
    MemberImpl[] newMembers=new MemberImpl[members.size()];
    int k=0;
    for (    MemberInfo memberInfo : members) {
      MemberImpl member=oldMemberMap.get(memberInfo.getAddress());
      if (member == null) {
        member=createMember(memberInfo.getAddress(),memberInfo.getUuid(),thisAddress.getScopeId(),memberInfo.getAttributes());
      }
      newMembers[k++]=member;
      member.didRead();
    }
    setMembers(newMembers);
    if (!getMemberList().contains(thisMember)) {
      throw new HazelcastException("String_Node_Str");
    }
    joinReset();
    heartBeater();
    node.setJoined();
    logger.info(membersString());
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
public void updateMembers(Collection<MemberInfo> members){
  lock.lock();
  try {
    Map<Address,MemberImpl> currentMemberMap=membersMapRef.get();
    if (!shouldProcessMemberUpdate(currentMemberMap,members)) {
      return;
    }
    MemberImpl[] newMembers=new MemberImpl[members.size()];
    int k=0;
    for (    MemberInfo memberInfo : members) {
      MemberImpl member=currentMemberMap.get(memberInfo.getAddress());
      if (member == null) {
        member=createMember(memberInfo.getAddress(),memberInfo.getUuid(),thisAddress.getScopeId(),memberInfo.getAttributes());
      }
      newMembers[k++]=member;
      member.didRead();
    }
    setMembers(newMembers);
    if (!getMemberList().contains(thisMember)) {
      throw new HazelcastException("String_Node_Str");
    }
    joinReset();
    heartBeater();
    node.setJoined();
    logger.info(membersString());
  }
  finally {
    lock.unlock();
  }
}
Program: 47210
Project: 47210
Buggy source:
SerializationServiceImpl(InputOutputFactory inputOutputFactory,int version,ClassLoader classLoader,Map<Integer,? extends DataSerializableFactory> dataSerializableFactories,Map<Integer,? extends PortableFactory> portableFactories,Collection<ClassDefinition> classDefinitions,boolean checkClassDefErrors,ManagedContext managedContext,PartitioningStrategy partitionStrategy,int initialOutputBufferSize,boolean enableCompression,boolean enableSharedObject){
  this.inputOutputFactory=inputOutputFactory;
  this.classLoader=classLoader;
  this.managedContext=managedContext;
  this.globalPartitioningStrategy=partitionStrategy;
  this.outputBufferSize=initialOutputBufferSize;
  dataOutputQueue=new ThreadLocalOutputCache(this);
  PortableHookLoader loader=new PortableHookLoader(portableFactories,classLoader);
  portableContext=new PortableContextImpl(this,version);
  for (  ClassDefinition cd : loader.getDefinitions()) {
    portableContext.registerClassDefinition(cd);
  }
  dataSerializerAdapter=createSerializerAdapter(new DataSerializer(dataSerializableFactories,classLoader));
  portableSerializer=new PortableSerializer(portableContext,loader.getFactories());
  portableSerializerAdapter=createSerializerAdapter(portableSerializer);
  registerConstantSerializers();
  registerJvmTypeSerializers(enableCompression,enableSharedObject);
  registerClassDefinitions(classDefinitions,checkClassDefErrors);
}

Fixed version (ground truth):
SerializationServiceImpl(InputOutputFactory inputOutputFactory,int version,ClassLoader classLoader,Map<Integer,? extends DataSerializableFactory> dataSerializableFactories,Map<Integer,? extends PortableFactory> portableFactories,Collection<ClassDefinition> classDefinitions,boolean checkClassDefErrors,ManagedContext managedContext,PartitioningStrategy partitionStrategy,int initialOutputBufferSize,boolean enableCompression,boolean enableSharedObject){
  this.inputOutputFactory=inputOutputFactory;
  this.classLoader=classLoader;
  this.managedContext=managedContext;
  this.globalPartitioningStrategy=partitionStrategy;
  this.outputBufferSize=initialOutputBufferSize;
  this.overrideCustomSerialization=parseBoolean(System.getProperty(SERIALIZATION_CUSTOM_OVERRIDE,"String_Node_Str"));
  dataOutputQueue=new ThreadLocalOutputCache(this);
  PortableHookLoader loader=new PortableHookLoader(portableFactories,classLoader);
  portableContext=new PortableContextImpl(this,version);
  for (  ClassDefinition cd : loader.getDefinitions()) {
    portableContext.registerClassDefinition(cd);
  }
  dataSerializerAdapter=createSerializerAdapter(new DataSerializer(dataSerializableFactories,classLoader));
  portableSerializer=new PortableSerializer(portableContext,loader.getFactories());
  portableSerializerAdapter=createSerializerAdapter(portableSerializer);
  registerConstantSerializers();
  registerJvmTypeSerializers(enableCompression,enableSharedObject);
  registerClassDefinitions(classDefinitions,checkClassDefErrors);
}
Program: 47211
Project: 47211
Buggy source:
private V getResult(){
  if (defaultValue != null) {
    return defaultValue;
  }
  return deserializedValue;
}

Fixed version (ground truth):
private V getResult(){
  if (defaultValue != null) {
    return defaultValue;
  }
  if (deserializedValue != null) {
    return deserializedValue;
  }
 else {
    if (valueData != null) {
      deserializedValue=serializationService.toObject(valueData);
    }
    return deserializedValue;
  }
}
Program: 47212
Project: 47212
Buggy source:
private Object handleAuthenticated(){
  if (isOwnerConnection()) {
    final String uuid=getUuid();
    final String localMemberUUID=clientEngine.getLocalMember().getUuid();
    principal=new ClientPrincipal(uuid,localMemberUUID);
    reAuthLocal();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    for (    MemberImpl member : members) {
      if (!member.localMember()) {
        ClientReAuthOperation op=new ClientReAuthOperation(uuid);
        op.setCallerUuid(localMemberUUID);
        nodeEngine.getOperationService().send(op,member.getAddress());
      }
    }
  }
  boolean isMember=clientEngine.getClusterService().getMember(principal.getOwnerUuid()) == null;
  if (isMember) {
    throw new AuthenticationException("String_Node_Str" + principal.getOwnerUuid() + "String_Node_Str");
  }
  endpoint.authenticated(principal,credentials,isOwnerConnection());
  endpointManager.registerEndpoint(endpoint);
  clientEngine.bind(endpoint);
  final Address thisAddress=clientEngine.getThisAddress();
  return encodeAuth(thisAddress,principal.getUuid(),principal.getOwnerUuid());
}

Fixed version (ground truth):
private Object handleAuthenticated(){
  if (isOwnerConnection()) {
    final String uuid=getUuid();
    final String localMemberUUID=clientEngine.getLocalMember().getUuid();
    principal=new ClientPrincipal(uuid,localMemberUUID);
    reAuthLocal();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    for (    MemberImpl member : members) {
      if (!member.localMember()) {
        ClientReAuthOperation op=new ClientReAuthOperation(uuid);
        op.setCallerUuid(localMemberUUID);
        nodeEngine.getOperationService().send(op,member.getAddress());
      }
    }
  }
  boolean isNotMember=clientEngine.getClusterService().getMember(principal.getOwnerUuid()) == null;
  if (isNotMember) {
    throw new AuthenticationException("String_Node_Str" + principal.getOwnerUuid() + "String_Node_Str");
  }
  endpoint.authenticated(principal,credentials,isOwnerConnection());
  endpointManager.registerEndpoint(endpoint);
  clientEngine.bind(endpoint);
  final Address thisAddress=clientEngine.getThisAddress();
  return encodeAuth(thisAddress,principal.getUuid(),principal.getOwnerUuid());
}
Program: 47213
Project: 47213
Buggy source:
@Override protected Object call() throws Exception {
  ReplicatedMapService replicatedMapService=getService(ReplicatedMapService.SERVICE_NAME);
  ReplicatedRecordStore recordStore=replicatedMapService.getReplicatedRecordStore(parameters.name,true);
  return recordStore.containsKey(parameters.key);
}

Fixed version (ground truth):
@Override protected Object call() throws Exception {
  ReplicatedMapService replicatedMapService=getService(ReplicatedMapService.SERVICE_NAME);
  ReplicatedRecordStore recordStore=replicatedMapService.getReplicatedRecordStore(parameters.name,true);
  return recordStore.containsKey(serializationService.toObject(parameters.key));
}
Program: 47214
Project: 47214
Buggy source:
@Override protected Object call() throws Exception {
  ReplicatedMapService replicatedMapService=getService(ReplicatedMapService.SERVICE_NAME);
  ReplicatedRecordStore recordStore=replicatedMapService.getReplicatedRecordStore(parameters.name,true);
  return recordStore.containsValue(parameters.value);
}

Fixed version (ground truth):
@Override protected Object call() throws Exception {
  ReplicatedMapService replicatedMapService=getService(ReplicatedMapService.SERVICE_NAME);
  ReplicatedRecordStore recordStore=replicatedMapService.getReplicatedRecordStore(parameters.name,true);
  return recordStore.containsValue(serializationService.toObject(parameters.value));
}
Program: 47215
Project: 47215
Buggy source:
@Override protected Object call() throws Exception {
  ReplicatedMapService replicatedMapService=getService(ReplicatedMapService.SERVICE_NAME);
  ReplicatedRecordStore recordStore=replicatedMapService.getReplicatedRecordStore(parameters.name,true);
  Object returnValue=recordStore.put(parameters.key,parameters.value,parameters.ttl,TimeUnit.MILLISECONDS);
  return serializationService.toData(returnValue);
}

Fixed version (ground truth):
@Override protected Object call() throws Exception {
  ReplicatedMapService replicatedMapService=getService(ReplicatedMapService.SERVICE_NAME);
  ReplicatedRecordStore recordStore=replicatedMapService.getReplicatedRecordStore(parameters.name,true);
  Object returnValue=recordStore.put(serializationService.toObject(parameters.key),serializationService.toObject(parameters.value),parameters.ttl,TimeUnit.MILLISECONDS);
  return serializationService.toData(returnValue);
}
Program: 47216
Project: 47216
Buggy source:
@Override protected Object call() throws Exception {
  ReplicatedMapService replicatedMapService=getService(ReplicatedMapService.SERVICE_NAME);
  ReplicatedRecordStore recordStore=replicatedMapService.getReplicatedRecordStore(parameters.name,true);
  Object returnValue=recordStore.remove(parameters.key);
  return serializationService.toData(returnValue);
}

Fixed version (ground truth):
@Override protected Object call() throws Exception {
  ReplicatedMapService replicatedMapService=getService(ReplicatedMapService.SERVICE_NAME);
  ReplicatedRecordStore recordStore=replicatedMapService.getReplicatedRecordStore(parameters.name,true);
  Object returnValue=recordStore.remove(serializationService.toObject(parameters.key));
  return serializationService.toData(returnValue);
}
Program: 47217
Project: 47217
Buggy source:
/** 
 * Sends an invalidation event for given <code>cacheName</code> with specified <code>key</code> from mentioned source with <code>sourceUuid</code>.
 * @param name       the name of the cache that invalidation event is sent for
 * @param key        the {@link Data} represents the invalidation event
 * @param sourceUuid an id that represents the source for invalidation event
 */
@Override public void sendInvalidationEvent(String name,Data key,String sourceUuid){
  if (key == null) {
    sendSingleInvalidationEvent(name,key,sourceUuid);
  }
 else {
    if (invalidationMessageBatchEnabled) {
      sendBatchInvalidationEvent(name,key,sourceUuid);
    }
 else {
      sendSingleInvalidationEvent(name,key,sourceUuid);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sends an invalidation event for given <code>cacheName</code> with specified <code>key</code> from mentioned source with <code>sourceUuid</code>.
 * @param name       the name of the cache that invalidation event is sent for
 * @param key        the {@link Data} represents the invalidation event
 * @param sourceUuid an id that represents the source for invalidation event
 */
@Override public void sendInvalidationEvent(String name,Data key,String sourceUuid){
  if (key == null) {
    sendSingleInvalidationEvent(name,null,sourceUuid);
  }
 else {
    if (invalidationMessageBatchEnabled) {
      sendBatchInvalidationEvent(name,key,sourceUuid);
    }
 else {
      sendSingleInvalidationEvent(name,key,sourceUuid);
    }
  }
}
Program: 47218
Project: 47218
Buggy source:
/** 
 * It may be useful to use this   {@code init} method in some cases that same instance of this class can be usedinstead of creating a new one for every iteration when scanning large data sets, for example: <pre> <code>Predicate predicate = ... QueryEntry entry = new QueryEntry() for(i == 0; i < HUGE_NUMBER; i++) { entry.init(...) boolean valid = predicate.apply(queryEntry); if(valid) { .... } } </code> </pre>
 */
public void init(SerializationService serializationService,Data indexKey,Object key,Object value){
  if (indexKey == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.indexKey=indexKey;
  this.serializationService=serializationService;
  if (key instanceof Data) {
    this.keyData=(Data)key;
  }
 else {
    this.keyObject=key;
  }
  if (value instanceof Data) {
    this.valueData=(Data)value;
  }
 else {
    this.valueObject=value;
  }
}

Fixed version (ground truth):
/** 
 * It may be useful to use this   {@code init} method in some cases that same instance of this class can be usedinstead of creating a new one for every iteration when scanning large data sets, for example: <pre> <code>Predicate predicate = ... QueryEntry entry = new QueryEntry() for(i == 0; i < HUGE_NUMBER; i++) { entry.init(...) boolean valid = predicate.apply(queryEntry); if(valid) { .... } } </code> </pre>
 */
public void init(SerializationService serializationService,Data indexKey,Object key,Object value){
  if (indexKey == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.indexKey=indexKey;
  this.serializationService=serializationService;
  keyData=null;
  keyObject=null;
  if (key instanceof Data) {
    this.keyData=(Data)key;
  }
 else {
    this.keyObject=key;
  }
  valueData=null;
  valueObject=null;
  if (value instanceof Data) {
    this.valueData=(Data)value;
  }
 else {
    this.valueObject=value;
  }
}
Program: 47220
Project: 47220
Buggy source:
@Override public Map<K,V> getAll(Set<? extends K> keys,ExpiryPolicy expiryPolicy){
  ensureOpen();
  validateNotNull(keys);
  if (keys.isEmpty()) {
    return Collections.EMPTY_MAP;
  }
  final Set<Data> keySet=new HashSet(keys.size());
  for (  K key : keys) {
    final Data k=toData(key);
    keySet.add(k);
  }
  Map<K,V> result=getAllFromNearCache(keySet);
  if (keySet.isEmpty()) {
    return result;
  }
  final CacheGetAllRequest request=new CacheGetAllRequest(nameWithPrefix,keySet,expiryPolicy);
  final MapEntrySet mapEntrySet=toObject(invoke(request));
  final Set<Map.Entry<Data,Data>> entrySet=mapEntrySet.getEntrySet();
  for (  Map.Entry<Data,Data> dataEntry : entrySet) {
    final Data keyData=dataEntry.getKey();
    final Data valueData=dataEntry.getValue();
    final K key=toObject(keyData);
    final V value=toObject(valueData);
    result.put(key,value);
    storeInNearCache(keyData,valueData,value);
  }
  return result;
}

Fixed version (ground truth):
@Override public Map<K,V> getAll(Set<? extends K> keys,ExpiryPolicy expiryPolicy){
  ensureOpen();
  validateNotNull(keys);
  if (keys.isEmpty()) {
    return Collections.EMPTY_MAP;
  }
  final Set<Data> keySet=new HashSet(keys.size());
  for (  K key : keys) {
    final Data k=toData(key);
    keySet.add(k);
  }
  Map<K,V> result=getAllFromNearCache(keySet);
  if (keySet.isEmpty()) {
    return result;
  }
  final Data expiryPolicyData=expiryPolicy != null ? toData(expiryPolicy) : DefaultData.NULL_DATA;
  final ClientMessage request=CacheGetAllParameters.encode(nameWithPrefix,keySet,expiryPolicyData);
  final ClientMessage responseMessage=invoke(request);
  final Map<Data,Data> mapEntrySet=MapDataDataResultParameters.decode(responseMessage).map;
  final Set<Map.Entry<Data,Data>> entrySet=mapEntrySet.entrySet();
  for (  Map.Entry<Data,Data> dataEntry : entrySet) {
    final Data keyData=dataEntry.getKey();
    final Data valueData=dataEntry.getValue();
    final K key=toObject(keyData);
    final V value=toObject(valueData);
    result.put(key,value);
    storeInNearCache(keyData,valueData,value);
  }
  return result;
}
Program: 47221
Project: 47221
Buggy source:
@Override public ICompletableFuture<V> getAsync(K key,ExpiryPolicy expiryPolicy){
  ensureOpen();
  validateNotNull(key);
  final Data keyData=toData(key);
  Object cached=nearCache != null ? nearCache.get(keyData) : null;
  if (cached != null && !NearCache.NULL_OBJECT.equals(cached)) {
    return createCompletedFuture(cached);
  }
  CacheGetRequest request=new CacheGetRequest(nameWithPrefix,keyData,expiryPolicy,cacheConfig.getInMemoryFormat());
  ClientInvocationFuture future;
  try {
    final int partitionId=clientContext.getPartitionService().getPartitionId(key);
    final HazelcastClientInstanceImpl client=(HazelcastClientInstanceImpl)clientContext.getHazelcastInstance();
    final ClientInvocation clientInvocation=new ClientInvocation(client,request,partitionId);
    future=clientInvocation.invoke();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  SerializationService serializationService=clientContext.getSerializationService();
  ClientDelegatingFuture<V> delegatingFuture=new ClientDelegatingFuture<V>(future,serializationService);
  if (nearCache != null) {
    delegatingFuture.andThenInternal(new ExecutionCallback<Data>(){
      public void onResponse(      Data valueData){
        storeInNearCache(keyData,valueData,null);
      }
      public void onFailure(      Throwable t){
      }
    }
);
  }
  return delegatingFuture;
}

Fixed version (ground truth):
@Override public ICompletableFuture<V> getAsync(K key,ExpiryPolicy expiryPolicy){
}
Program: 47222
Project: 47222
Buggy source:
@Override public V getAndPut(K key,V value,ExpiryPolicy expiryPolicy){
  final ICompletableFuture<V> f=putAsyncInternal(key,value,expiryPolicy,true,true);
  try {
    return toObject(f.get());
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
@Override public V getAndPut(K key,V value,ExpiryPolicy expiryPolicy){
  final ICompletableFuture<V> f=putAsyncInternal(key,value,expiryPolicy,true,true);
  try {
    return f.get();
  }
 catch (  Throwable e) {
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47223
Project: 47223
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(){
}
Program: 47224
Project: 47224
Buggy source:
public void destroy(){
  close();
  if (!isDestroyed.compareAndSet(false,true)) {
    return;
  }
  isClosed.set(true);
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(nameWithPrefix);
    CacheDestroyRequest request=new CacheDestroyRequest(nameWithPrefix,partitionId);
    final ClientInvocation clientInvocation=new ClientInvocation((HazelcastClientInstanceImpl)clientContext.getHazelcastInstance(),request,partitionId);
    clientInvocation.invoke().get();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

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

Fixed version (ground truth):
protected ClientMessage invoke(ClientMessage clientMessage,Data keyData){
  try {
    if (keyData != null) {
      final int partitionId=clientContext.getPartitionService().getPartitionId(keyData);
      final Future future=new ClientInvocation((HazelcastClientInstanceImpl)clientContext.getHazelcastInstance(),clientMessage,partitionId).invoke();
      return (ClientMessage)future.get();
    }
    final Future<ClientMessage> future=new ClientInvocation((HazelcastClientInstanceImpl)clientContext.getHazelcastInstance(),clientMessage).invoke();
    return future.get();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 47226
Project: 47226
Buggy source:
protected <T>ICompletableFuture<T> invoke(ClientMessage req,Data keyData,boolean completionOperation){
  Integer completionId=null;
  if (completionOperation) {
    completionId=registerCompletionLatch(1);
  }
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(keyData);
    HazelcastClientInstanceImpl client=(HazelcastClientInstanceImpl)clientContext.getHazelcastInstance();
    final ClientInvocation clientInvocation=new ClientInvocation(client,req,partitionId);
    ClientInvocationFuture f=clientInvocation.invoke();
    if (completionOperation) {
      waitCompletionLatch(completionId,f);
    }
    return new ClientDelegatingFuture<T>(f,clientContext.getSerializationService());
  }
 catch (  Throwable e) {
    if (e instanceof IllegalStateException) {
      close();
    }
    if (completionOperation) {
      deregisterCompletionLatch(completionId);
    }
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}

Fixed version (ground truth):
protected <T>ICompletableFuture<T> invoke(ClientMessage req,Data keyData,int completionId){
  final boolean completionOperation=completionId != -1;
  if (completionOperation) {
    registerCompletionLatch(completionId,1);
  }
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(keyData);
    HazelcastClientInstanceImpl client=(HazelcastClientInstanceImpl)clientContext.getHazelcastInstance();
    final ClientInvocation clientInvocation=new ClientInvocation(client,req,partitionId);
    ClientInvocationFuture f=clientInvocation.invoke();
    if (completionOperation) {
      waitCompletionLatch(completionId,f);
    }
    return new ClientDelegatingFuture<T>(f,clientContext.getSerializationService());
  }
 catch (  Throwable e) {
    if (e instanceof IllegalStateException) {
      close();
    }
    if (completionOperation) {
      deregisterCompletionLatch(completionId);
    }
    throw ExceptionUtil.rethrowAllowedTypeFirst(e,CacheException.class);
  }
}
Program: 47227
Project: 47227
Buggy source:
protected Integer registerCompletionLatch(int count){
  if (!syncListenerRegistrations.isEmpty()) {
    final int id=completionIdCounter.incrementAndGet();
    int size=syncListenerRegistrations.size();
    CountDownLatch countDownLatch=new CountDownLatch(count * size);
    syncLocks.put(id,countDownLatch);
    return id;
  }
  return MutableOperation.IGNORE_COMPLETION;
}

Fixed version (ground truth):
protected Integer registerCompletionLatch(Integer countDownLatchId,int count){
  if (!syncListenerRegistrations.isEmpty()) {
    int size=syncListenerRegistrations.size();
    CountDownLatch countDownLatch=new CountDownLatch(count * size);
    syncLocks.put(countDownLatchId,countDownLatch);
    return countDownLatchId;
  }
  return MutableOperation.IGNORE_COMPLETION;
}
Program: 47228
Project: 47228
Buggy source:
protected void removeAllInternal(Set<? extends K> keys){
  final Set<Data> keysData;
  if (keys != null) {
    keysData=new HashSet<Data>();
    for (    K key : keys) {
      keysData.add(toData(key));
    }
  }
 else {
    keysData=null;
  }
  final int partitionCount=clientContext.getPartitionService().getPartitionCount();
  int completionId=registerCompletionLatch(partitionCount);
  ClientMessage request=CacheRemoveAllCodec.encodeRequest(nameWithPrefix,keysData,completionId);
  try {
    invoke(request);
    waitCompletionLatch(completionId,null);
  }
 catch (  Throwable t) {
    deregisterCompletionLatch(completionId);
    throw ExceptionUtil.rethrowAllowedTypeFirst(t,CacheException.class);
  }
}

Fixed version (ground truth):
protected void removeAllInternal(Set<? extends K> keys){
  final Set<Data> keysData;
  if (keys != null) {
    keysData=new HashSet<Data>();
    for (    K key : keys) {
      keysData.add(toData(key));
    }
  }
 else {
    keysData=null;
  }
  final int partitionCount=clientContext.getPartitionService().getPartitionCount();
  final int completionId=nextCompletionId();
  ClientMessage request=CacheRemoveAllCodec.encodeRequest(nameWithPrefix,keysData,completionId);
  try {
    invoke(request);
    waitCompletionLatch(completionId,null);
  }
 catch (  Throwable t) {
    deregisterCompletionLatch(completionId);
    throw ExceptionUtil.rethrowAllowedTypeFirst(t,CacheException.class);
  }
}
Program: 47229
Project: 47229
Buggy source:
protected <T>ICompletableFuture<T> removeAsyncInternal(K key,V oldValue,boolean hasOldValue,boolean isGet,boolean withCompletionEvent){
  ensureOpen();
  if (hasOldValue) {
    validateNotNull(key,oldValue);
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,oldValue);
  }
 else {
    validateNotNull(key);
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key);
  }
  final Data keyData=toData(key);
  final Data oldValueData=oldValue != null ? toData(oldValue) : null;
  ClientMessage request;
  if (isGet) {
    request=CacheGetAndRemoveCodec.encodeRequest(nameWithPrefix,keyData);
  }
 else {
    request=CacheRemoveCodec.encodeRequest(nameWithPrefix,keyData,oldValueData);
  }
  ICompletableFuture future;
  try {
    future=invoke(request,keyData,withCompletionEvent);
    invalidateNearCache(keyData);
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return future;
}

Fixed version (ground truth):
protected <T>ICompletableFuture<T> removeAsyncInternal(K key,V oldValue,boolean hasOldValue,boolean isGet,boolean withCompletionEvent){
  ensureOpen();
  if (hasOldValue) {
    validateNotNull(key,oldValue);
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,oldValue);
  }
 else {
    validateNotNull(key);
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key);
  }
  final Data keyData=toData(key);
  final Data oldValueData=oldValue != null ? toData(oldValue) : DefaultData.NULL_DATA;
  final int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ClientMessage request;
  if (isGet) {
    request=CacheGetAndRemoveCodec.encodeRequest(nameWithPrefix,keyData);
  }
 else {
    request=CacheRemoveCodec.encodeRequest(nameWithPrefix,keyData,oldValueData);
  }
  ICompletableFuture future;
  try {
    future=invoke(request,keyData,completionId);
    invalidateNearCache(keyData);
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return future;
}
Program: 47230
Project: 47230
Buggy source:
protected ICompletableFuture<Boolean> putIfAbsentAsyncInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean withCompletionEvent){
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  final Data keyData=toData(key);
  final Data valueData=toData(value);
  final Data expiryPolicyData=toData(expiryPolicy);
  ClientMessage request=CachePutIfAbsentCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData);
  ICompletableFuture<Boolean> future;
  try {
    future=invoke(request,keyData,withCompletionEvent);
    if (cacheOnUpdate) {
      storeInNearCache(keyData,valueData,value);
    }
 else {
      invalidateNearCache(keyData);
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return future;
}

Fixed version (ground truth):
protected ICompletableFuture<Boolean> putIfAbsentAsyncInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean withCompletionEvent){
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  final Data keyData=toData(key);
  final Data valueData=toData(value);
  final Data expiryPolicyData=toData(expiryPolicy);
  ClientMessage request=CachePutIfAbsentCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData);
  final int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ICompletableFuture<Boolean> future;
  try {
    future=invoke(request,keyData,completionId);
    if (cacheOnUpdate) {
      storeInNearCache(keyData,valueData,value);
    }
 else {
      invalidateNearCache(keyData);
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return future;
}
Program: 47231
Project: 47231
Buggy source:
protected <T>ICompletableFuture<T> putAsyncInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean isGet,boolean withCompletionEvent){
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  final Data keyData=toData(key);
  final Data valueData=toData(value);
  final Data expiryPolicyData=toData(expiryPolicy);
  ClientMessage request=CachePutCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData,isGet);
  ICompletableFuture future;
  try {
    future=invoke(request,keyData,withCompletionEvent);
    if (cacheOnUpdate) {
      storeInNearCache(keyData,valueData,value);
    }
 else {
      invalidateNearCache(keyData);
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return future;
}

Fixed version (ground truth):
protected <T>ICompletableFuture<T> putAsyncInternal(K key,V value,ExpiryPolicy expiryPolicy,boolean isGet,boolean withCompletionEvent){
  ensureOpen();
  validateNotNull(key,value);
  CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,value);
  final Data keyData=toData(key);
  final Data valueData=toData(value);
  final Data expiryPolicyData=toData(expiryPolicy);
  ClientMessage request=CachePutCodec.encodeRequest(nameWithPrefix,keyData,valueData,expiryPolicyData,isGet);
  final int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ICompletableFuture future;
  try {
    future=invoke(request,keyData,completionId);
    if (cacheOnUpdate) {
      storeInNearCache(keyData,valueData,value);
    }
 else {
      invalidateNearCache(keyData);
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return new DelegatingFuture<T>(future,clientContext.getSerializationService());
}
Program: 47232
Project: 47232
Buggy source:
protected <T>ICompletableFuture<T> replaceAsyncInternal(K key,V oldValue,V newValue,ExpiryPolicy expiryPolicy,boolean hasOldValue,boolean isGet,boolean withCompletionEvent){
  ensureOpen();
  if (hasOldValue) {
    validateNotNull(key,oldValue,newValue);
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,oldValue,newValue);
  }
 else {
    validateNotNull(key,newValue);
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,newValue);
  }
  final Data keyData=toData(key);
  final Data oldValueData=oldValue != null ? toData(oldValue) : null;
  final Data newValueData=newValue != null ? toData(newValue) : null;
  final Data expiryPolicyData=toData(expiryPolicy);
  ClientMessage request;
  if (isGet) {
    request=CacheGetAndReplaceCodec.encodeRequest(nameWithPrefix,keyData,newValueData,expiryPolicyData);
  }
 else {
    request=CacheReplaceCodec.encodeRequest(nameWithPrefix,keyData,oldValueData,newValueData,expiryPolicyData);
  }
  ICompletableFuture future;
  try {
    future=invoke(request,keyData,withCompletionEvent);
    invalidateNearCache(keyData);
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return future;
}

Fixed version (ground truth):
protected <T>ICompletableFuture<T> replaceAsyncInternal(K key,V oldValue,V newValue,ExpiryPolicy expiryPolicy,boolean hasOldValue,boolean isGet,boolean withCompletionEvent){
  ensureOpen();
  if (hasOldValue) {
    validateNotNull(key,oldValue,newValue);
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,oldValue,newValue);
  }
 else {
    validateNotNull(key,newValue);
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key,newValue);
  }
  final Data keyData=toData(key);
  final Data oldValueData=oldValue != null ? toData(oldValue) : DefaultData.NULL_DATA;
  final Data newValueData=newValue != null ? toData(newValue) : DefaultData.NULL_DATA;
  final Data expiryPolicyData=expiryPolicy != null ? toData(expiryPolicy) : DefaultData.NULL_DATA;
  final int completionId=withCompletionEvent ? nextCompletionId() : -1;
  ClientMessage request;
  if (isGet) {
    request=CacheGetAndReplaceCodec.encodeRequest(nameWithPrefix,keyData,newValueData,expiryPolicyData);
  }
 else {
    request=CacheReplaceCodec.encodeRequest(nameWithPrefix,keyData,oldValueData,newValueData,expiryPolicyData);
  }
  ICompletableFuture future;
  try {
    future=invoke(request,keyData,completionId);
    invalidateNearCache(keyData);
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return future;
}
Program: 47233
Project: 47233
Buggy source:
@Override public <T>T invoke(K key,EntryProcessor<K,V,T> entryProcessor,Object... arguments) throws EntryProcessorException {
  ensureOpen();
  validateNotNull(key);
  if (entryProcessor == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final Data keyData=toData(key);
  Data epData=toData(entryProcessor);
  List<Data> argumentsData=null;
  if (arguments != null) {
    argumentsData=new ArrayList<Data>(arguments.length);
    for (int i=0; i < arguments.length; i++) {
      argumentsData.add(toData(arguments[i]));
    }
  }
  final ClientMessage request=CacheEntryProcessorCodec.encodeRequest(nameWithPrefix,keyData,epData,argumentsData);
  try {
    final ICompletableFuture<ClientMessage> f=invoke(request,keyData,true);
    final ClientMessage response=getSafely(f);
    final Data data=CacheEntryProcessorCodec.decodeResponse(response).response;
    return toObject(data);
  }
 catch (  CacheException ce) {
    throw ce;
  }
catch (  Exception e) {
    throw new EntryProcessorException(e);
  }
}

Fixed version (ground truth):
@Override public <T>T invoke(K key,EntryProcessor<K,V,T> entryProcessor,Object... arguments) throws EntryProcessorException {
  ensureOpen();
  validateNotNull(key);
  if (entryProcessor == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final Data keyData=toData(key);
  Data epData=toData(entryProcessor);
  List<Data> argumentsData=null;
  if (arguments != null) {
    argumentsData=new ArrayList<Data>(arguments.length);
    for (int i=0; i < arguments.length; i++) {
      argumentsData.add(toData(arguments[i]));
    }
  }
  final ClientMessage request=CacheEntryProcessorCodec.encodeRequest(nameWithPrefix,keyData,epData,argumentsData);
  final int completionId=nextCompletionId();
  try {
    final ICompletableFuture<ClientMessage> f=invoke(request,keyData,completionId);
    final ClientMessage response=getSafely(f);
    final Data data=CacheEntryProcessorCodec.decodeResponse(response).response;
    return toObject(data);
  }
 catch (  CacheException ce) {
    throw ce;
  }
catch (  Exception e) {
    throw new EntryProcessorException(e);
  }
}
Program: 47234
Project: 47234
Buggy source:
protected CacheKeyIteratorResult fetch(){
  CacheIterateRequest request=new CacheIterateRequest(cacheProxy.getNameWithPrefix(),partitionIndex,lastTableIndex,fetchSize,cacheProxy.cacheConfig.getInMemoryFormat());
  final HazelcastClientInstanceImpl client=(HazelcastClientInstanceImpl)context.getHazelcastInstance();
  try {
    final ClientInvocation clientInvocation=new ClientInvocation(client,request);
    final Future f=clientInvocation.invoke();
    return toObject(f.get());
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
protected CacheKeyIteratorResult fetch(){
  ClientMessage request=CacheIterateParameters.encode(cacheProxy.getNameWithPrefix(),partitionIndex,lastTableIndex,fetchSize);
  final HazelcastClientInstanceImpl client=(HazelcastClientInstanceImpl)context.getHazelcastInstance();
  try {
    final ClientInvocation clientInvocation=new ClientInvocation(client,request);
    final Future f=clientInvocation.invoke();
    return toObject(f.get());
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 47235
Project: 47235
Buggy source:
@Override public double getRatio(){
  return ((double)hits / misses) * 100.0;
}

Fixed version (ground truth):
@Override public double getRatio(){
  if (misses == 0) {
    if (hits == 0) {
      return Double.NaN;
    }
 else {
      return Double.POSITIVE_INFINITY;
    }
  }
 else {
    return ((double)hits / misses) * PERCENTAGE;
  }
}
Program: 47236
Project: 47236
Buggy source:
@Override public <R>R apply(IFunction<E,R> function){
  isNotNull(function,"String_Node_Str");
  ClientMessage request=AtomicReferenceApplyCodec.encodeRequest(name,toData(function));
  AtomicReferenceApplyCodec.ResponseParameters resultParameters=AtomicReferenceApplyCodec.decodeResponse((ClientMessage)invoke(request));
  return toObject(resultParameters.response);
}

Fixed version (ground truth):
@Override public <R>R apply(IFunction<E,R> function){
  isNotNull(function,"String_Node_Str");
  ClientMessage request=AtomicReferenceApplyCodec.encodeRequest(name,toData(function));
  ClientMessage response=invoke(request);
  AtomicReferenceApplyCodec.ResponseParameters resultParameters=AtomicReferenceApplyCodec.decodeResponse(response);
  return toObject(resultParameters.response);
}
Program: 47237
Project: 47237
Buggy source:
@Override public E setAndGet(E update){
  ClientMessage request=AtomicReferenceSetAndGetCodec.encodeRequest(name,toData(update));
  AtomicReferenceSetAndGetCodec.ResponseParameters resultParameters=AtomicReferenceSetAndGetCodec.decodeResponse((ClientMessage)invoke(request));
  return toObject(resultParameters.response);
}

Fixed version (ground truth):
@Override public E setAndGet(E update){
  ClientMessage request=AtomicReferenceSetAndGetCodec.encodeRequest(name,toData(update));
  ClientMessage response=invoke(request);
  return toObject(AtomicReferenceSetAndGetCodec.decodeResponse(response).response);
}