nus-yam/ex-repair huggingface dataset:
Program: 47427
Project: 47427
Buggy source:
@Override public boolean deregisterListener(String name,String registrationId){
  final EventService eventService=getNodeEngine().getEventService();
  return eventService.deregisterListener(SERVICE_NAME,name,registrationId);
}

Fixed version (ground truth):
@Override public boolean deregisterListener(String name,String registrationId){
  final EventService eventService=getNodeEngine().getEventService();
  final boolean result=eventService.deregisterListener(SERVICE_NAME,name,registrationId);
  Closeable listener=closeableListeners.remove(registrationId);
  if (listener != null) {
    IOUtil.closeResource(listener);
  }
  return result;
}
Program: 47428
Project: 47428
Buggy source:
@Override public String registerListener(String distributedObjectName,CacheEventListener listener){
  final EventService eventService=getNodeEngine().getEventService();
  final EventRegistration registration=eventService.registerListener(AbstractCacheService.SERVICE_NAME,distributedObjectName,listener);
  return registration.getId();
}

Fixed version (ground truth):
@Override public String registerListener(String distributedObjectName,CacheEventListener listener){
  final EventService eventService=getNodeEngine().getEventService();
  final EventRegistration registration=eventService.registerListener(AbstractCacheService.SERVICE_NAME,distributedObjectName,listener);
  final String id=registration.getId();
  if (listener instanceof Closeable) {
    closeableListeners.put(id,(Closeable)listener);
  }
 else   if (listener instanceof CacheEntryListenerProvider) {
    CacheEntryListener cacheEntryListener=((CacheEntryListenerProvider)listener).getCacheEntryListener();
    if (cacheEntryListener instanceof Closeable) {
      closeableListeners.put(id,(Closeable)cacheEntryListener);
    }
  }
  return id;
}
Program: 47429
Project: 47429
Buggy source:
@Override public void deregisterAllListener(String name){
  nodeEngine.getEventService().deregisterAllListeners(AbstractCacheService.SERVICE_NAME,name);
}

Fixed version (ground truth):
@Override public void deregisterAllListener(String name){
  final EventService eventService=getNodeEngine().getEventService();
  final Collection<EventRegistration> registrations=eventService.getRegistrations(SERVICE_NAME,name);
  if (registrations != null) {
    for (    EventRegistration registration : registrations) {
      Closeable listener=closeableListeners.remove(registration.getId());
      if (listener != null) {
        IOUtil.closeResource(listener);
      }
    }
  }
  eventService.deregisterAllListeners(AbstractCacheService.SERVICE_NAME,name);
}
Program: 47430
Project: 47430
Buggy source:
@Override public void destroyCache(String objectName,boolean isLocal,String callerUuid){
  CacheConfig config=deleteCacheConfig(objectName);
  destroySegments(objectName);
  if (!isLocal) {
    deregisterAllListener(objectName);
  }
  operationProviderCache.remove(objectName);
  setStatisticsEnabled(config,objectName,false);
  setManagementEnabled(config,objectName,false);
  deleteCacheConfig(objectName);
  deleteCacheStat(objectName);
  if (!isLocal) {
    destroyCacheOnAllMembers(objectName,callerUuid);
  }
}

Fixed version (ground truth):
@Override public void destroyCache(String objectName,boolean isLocal,String callerUuid){
  CacheConfig config=deleteCacheConfig(objectName);
  destroySegments(objectName);
  if (!isLocal) {
    deregisterAllListener(objectName);
  }
  operationProviderCache.remove(objectName);
  setStatisticsEnabled(config,objectName,false);
  setManagementEnabled(config,objectName,false);
  deleteCacheConfig(objectName);
  deleteCacheStat(objectName);
  deleteCacheResources(objectName);
  if (!isLocal) {
    destroyCacheOnAllMembers(objectName,callerUuid);
  }
}
Program: 47431
Project: 47431
Buggy source:
public CacheEventListenerAdaptor(ICache<K,V> source,CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration,SerializationService serializationService){
  this.source=source;
  this.serializationService=serializationService;
  final CacheEntryListener<? super K,? super V> cacheEntryListener=cacheEntryListenerConfiguration.getCacheEntryListenerFactory().create();
  if (cacheEntryListener instanceof CacheEntryCreatedListener) {
    this.cacheEntryCreatedListener=(CacheEntryCreatedListener)cacheEntryListener;
  }
 else {
    this.cacheEntryCreatedListener=null;
  }
  if (cacheEntryListener instanceof CacheEntryRemovedListener) {
    this.cacheEntryRemovedListener=(CacheEntryRemovedListener)cacheEntryListener;
  }
 else {
    this.cacheEntryRemovedListener=null;
  }
  if (cacheEntryListener instanceof CacheEntryUpdatedListener) {
    this.cacheEntryUpdatedListener=(CacheEntryUpdatedListener)cacheEntryListener;
  }
 else {
    this.cacheEntryUpdatedListener=null;
  }
  if (cacheEntryListener instanceof CacheEntryExpiredListener) {
    this.cacheEntryExpiredListener=(CacheEntryExpiredListener)cacheEntryListener;
  }
 else {
    this.cacheEntryExpiredListener=null;
  }
  final Factory<CacheEntryEventFilter<? super K,? super V>> filterFactory=cacheEntryListenerConfiguration.getCacheEntryEventFilterFactory();
  if (filterFactory != null) {
    filter=filterFactory.create();
  }
 else {
    filter=null;
  }
  isOldValueRequired=cacheEntryListenerConfiguration.isOldValueRequired();
}

Fixed version (ground truth):
public CacheEventListenerAdaptor(ICache<K,V> source,CacheEntryListenerConfiguration<K,V> cacheEntryListenerConfiguration,SerializationService serializationService){
  this.source=source;
  this.serializationService=serializationService;
  final CacheEntryListener<? super K,? super V> cacheEntryListener=cacheEntryListenerConfiguration.getCacheEntryListenerFactory().create();
  this.cacheEntryListener=(CacheEntryListener<K,V>)cacheEntryListener;
  if (cacheEntryListener instanceof CacheEntryCreatedListener) {
    this.cacheEntryCreatedListener=(CacheEntryCreatedListener)cacheEntryListener;
  }
 else {
    this.cacheEntryCreatedListener=null;
  }
  if (cacheEntryListener instanceof CacheEntryRemovedListener) {
    this.cacheEntryRemovedListener=(CacheEntryRemovedListener)cacheEntryListener;
  }
 else {
    this.cacheEntryRemovedListener=null;
  }
  if (cacheEntryListener instanceof CacheEntryUpdatedListener) {
    this.cacheEntryUpdatedListener=(CacheEntryUpdatedListener)cacheEntryListener;
  }
 else {
    this.cacheEntryUpdatedListener=null;
  }
  if (cacheEntryListener instanceof CacheEntryExpiredListener) {
    this.cacheEntryExpiredListener=(CacheEntryExpiredListener)cacheEntryListener;
  }
 else {
    this.cacheEntryExpiredListener=null;
  }
  final Factory<CacheEntryEventFilter<? super K,? super V>> filterFactory=cacheEntryListenerConfiguration.getCacheEntryEventFilterFactory();
  if (filterFactory != null) {
    this.filter=filterFactory.create();
  }
 else {
    this.filter=null;
  }
  this.isOldValueRequired=cacheEntryListenerConfiguration.isOldValueRequired();
}
Program: 47432
Project: 47432
Buggy source:
@Override public <K,V>ICache<K,V> getCache(String cacheName){
  checkIfManagerNotClosed();
  ICacheInternal<?,?> cache=getCacheUnchecked(cacheName);
  if (cache != null) {
    Configuration<?,?> configuration=cache.getConfiguration(CacheConfig.class);
    if (Object.class.equals(configuration.getKeyType()) && Object.class.equals(configuration.getValueType())) {
      return ensureOpenIfAvailable((ICacheInternal<K,V>)cache);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + cacheName + "String_Node_Str"+ "String_Node_Str"+ configuration.getKeyType()+ "String_Node_Str"+ configuration.getValueType()+ "String_Node_Str"+ "String_Node_Str");
    }
  }
  return ensureOpenIfAvailable((ICacheInternal<K,V>)cache);
}

Fixed version (ground truth):
@Override public <K,V>ICache<K,V> getCache(String cacheName){
  checkIfManagerNotClosed();
  ICacheInternal<?,?> cache=getCacheUnchecked(cacheName);
  if (cache != null) {
    Configuration<?,?> configuration=cache.getConfiguration(CacheConfig.class);
    if (Object.class.equals(configuration.getKeyType()) && Object.class.equals(configuration.getValueType())) {
      return ensureOpenIfAvailable((ICacheInternal<K,V>)cache);
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + cacheName + "String_Node_Str"+ "String_Node_Str"+ configuration.getKeyType()+ "String_Node_Str"+ configuration.getValueType()+ "String_Node_Str"+ "String_Node_Str");
    }
  }
  return null;
}
Program: 47433
Project: 47433
Buggy source:
@Override public void destroy(){
  clear();
  closeResources();
  closeListeners();
  onDestroy();
}

Fixed version (ground truth):
@Override public void destroy(){
  clear();
  closeListeners();
  onDestroy();
}
Program: 47435
Project: 47435
Buggy source:
@Override public void destroyCache(String objectName,boolean isLocal,String callerUuid){
  CacheConfig config=deleteCacheConfig(objectName);
  destroySegments(objectName);
  if (!isLocal) {
    deregisterAllListener(objectName);
  }
  operationProviderCache.remove(objectName);
  setStatisticsEnabled(config,objectName,false);
  setManagementEnabled(config,objectName,false);
  deleteCacheConfig(objectName);
  deleteCacheStat(objectName);
  if (!isLocal) {
    destroyCacheOnAllMembers(objectName,callerUuid);
  }
}

Fixed version (ground truth):
@Override public void destroyCache(String objectName,boolean isLocal,String callerUuid){
  CacheConfig config=deleteCacheConfig(objectName);
  destroySegments(objectName);
  if (!isLocal) {
    deregisterAllListener(objectName);
  }
  operationProviderCache.remove(objectName);
  setStatisticsEnabled(config,objectName,false);
  setManagementEnabled(config,objectName,false);
  deleteCacheConfig(objectName);
  deleteCacheStat(objectName);
  deleteCacheResources(objectName);
  if (!isLocal) {
    destroyCacheOnAllMembers(objectName,callerUuid);
  }
}
Program: 47436
Project: 47436
Buggy source:
@Override public void run() throws Exception {
  AbstractCacheService service=getService();
  response=service.createCacheConfigIfAbsent(config);
  if (createAlsoOnOthers && response == null) {
    NodeEngine nodeEngine=getNodeEngine();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    int remoteNodeCount=members.size() - 1;
    if (remoteNodeCount > 0) {
      postponeReturnResponse();
      Callback<Object> callback=new CacheConfigCreateCallback(getResponseHandler(),remoteNodeCount);
      OperationService operationService=nodeEngine.getOperationService();
      for (      MemberImpl member : members) {
        if (!member.localMember()) {
          CacheCreateConfigOperation op=new CacheCreateConfigOperation(config,true);
          operationService.createInvocationBuilder(AbstractCacheService.SERVICE_NAME,op,member.getAddress()).setCallback(callback).invoke();
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  AbstractCacheService service=getService();
  response=service.createCacheConfigIfAbsent(config);
  if (createAlsoOnOthers) {
    NodeEngine nodeEngine=getNodeEngine();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    int remoteNodeCount=members.size() - 1;
    if (remoteNodeCount > 0) {
      postponeReturnResponse();
      Callback<Object> callback=new CacheConfigCreateCallback(getResponseHandler(),remoteNodeCount);
      OperationService operationService=nodeEngine.getOperationService();
      for (      MemberImpl member : members) {
        if (!member.localMember()) {
          CacheCreateConfigOperation op=new CacheCreateConfigOperation(config,false);
          operationService.createInvocationBuilder(AbstractCacheService.SERVICE_NAME,op,member.getAddress()).setCallback(callback).invoke();
        }
      }
    }
  }
}
Program: 47437
Project: 47437
Buggy source:
protected void doListNearCaches(){
  NearCacheManager nearCacheManager=createNearCacheManager();
  Collection<NearCache> nearCaches1=nearCacheManager.listAllNearCaches();
  assertEquals(0,nearCaches1.size());
  for (int i=0; i < DEFAULT_NEAR_CACHE_COUNT; i++) {
    createNearCache(nearCacheManager,DEFAULT_NEAR_CACHE_NAME + "String_Node_Str" + i);
  }
  Collection<NearCache> nearCaches2=nearCacheManager.listAllNearCaches();
  assertEquals(DEFAULT_NEAR_CACHE_COUNT,nearCaches2.size());
  int i=0;
  for (  NearCache nearCache : nearCaches2) {
    assertEquals(DEFAULT_NEAR_CACHE_NAME + "String_Node_Str" + (i++),nearCache.getName());
  }
}

Fixed version (ground truth):
protected void doListNearCaches(){
  NearCacheManager nearCacheManager=createNearCacheManager();
  Set<String> nearCacheNames=new HashSet<String>();
  Collection<NearCache> nearCaches1=nearCacheManager.listAllNearCaches();
  assertEquals(0,nearCaches1.size());
  for (int i=0; i < DEFAULT_NEAR_CACHE_COUNT; i++) {
    String nearCacheName=DEFAULT_NEAR_CACHE_NAME + "String_Node_Str" + i;
    createNearCache(nearCacheManager,nearCacheName);
    nearCacheNames.add(nearCacheName);
  }
  Collection<NearCache> nearCaches2=nearCacheManager.listAllNearCaches();
  assertEquals(DEFAULT_NEAR_CACHE_COUNT,nearCaches2.size());
  for (  NearCache nearCache : nearCaches2) {
    assertTrue(nearCacheNames.contains(nearCache.getName()));
  }
}
Program: 47438
Project: 47438
Buggy source:
private HazelcastServerCachingProvider createCachingProvider(Config hzConfig){
  HazelcastInstance hazelcastInstance=createHazelcastInstance(hzConfig);
  HazelcastServerCachingProvider cachingProvider=HazelcastServerCachingProvider.createCachingProvider(hazelcastInstance);
  return cachingProvider;
}

Fixed version (ground truth):
private HazelcastServerCachingProvider createCachingProvider(Config hzConfig){
  HazelcastInstance hazelcastInstance=Hazelcast.newHazelcastInstance(hzConfig);
  HazelcastServerCachingProvider cachingProvider=HazelcastServerCachingProvider.createCachingProvider(hazelcastInstance);
  return cachingProvider;
}
Program: 47440
Project: 47440
Buggy source:
@Override public boolean isDone(){
  return response != null;
}

Fixed version (ground truth):
@Override public boolean isDone(){
  return responseAvailable(response);
}
Program: 47441
Project: 47441
Buggy source:
@Override public <K,V>NearCache<K,V> getOrCreateNearCache(String name,NearCacheConfig nearCacheConfig,NearCacheContext nearCacheContext){
  NearCache<K,V> nearCache=nearCacheMap.get(name);
  if (nearCache == null) {
synchronized (nearCacheMap) {
      nearCache=nearCacheMap.get(name);
      if (nearCache == null) {
        nearCache=createNearCache(name,nearCacheConfig,nearCacheContext);
        nearCacheMap.put(name,nearCache);
      }
    }
  }
  return nearCache;
}

Fixed version (ground truth):
@Override public <K,V>NearCache<K,V> getOrCreateNearCache(String name,NearCacheConfig nearCacheConfig,NearCacheContext nearCacheContext){
  NearCache<K,V> nearCache=nearCacheMap.get(name);
  if (nearCache == null) {
synchronized (mutex) {
      nearCache=nearCacheMap.get(name);
      if (nearCache == null) {
        nearCache=createNearCache(name,nearCacheConfig,nearCacheContext);
        nearCacheMap.put(name,nearCache);
      }
    }
  }
  return nearCache;
}
Program: 47442
Project: 47442
Buggy source:
@Override public void run() throws Exception {
  AbstractCacheService service=getService();
  response=service.createCacheConfigIfAbsent(config);
  if (createAlsoOnOthers && response == null) {
    NodeEngine nodeEngine=getNodeEngine();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    int remoteNodeCount=members.size() - 1;
    if (remoteNodeCount > 0) {
      postponeReturnResponse();
      Callback<Object> callback=new CacheConfigCreateCallback(getResponseHandler(),remoteNodeCount);
      OperationService operationService=nodeEngine.getOperationService();
      for (      MemberImpl member : members) {
        if (!member.localMember()) {
          CacheCreateConfigOperation op=new CacheCreateConfigOperation(config,true);
          operationService.createInvocationBuilder(AbstractCacheService.SERVICE_NAME,op,member.getAddress()).setCallback(callback).invoke();
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  AbstractCacheService service=getService();
  response=service.createCacheConfigIfAbsent(config);
  if (createAlsoOnOthers) {
    NodeEngine nodeEngine=getNodeEngine();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    int remoteNodeCount=members.size() - 1;
    if (remoteNodeCount > 0) {
      postponeReturnResponse();
      Callback<Object> callback=new CacheConfigCreateCallback(getResponseHandler(),remoteNodeCount);
      OperationService operationService=nodeEngine.getOperationService();
      for (      MemberImpl member : members) {
        if (!member.localMember()) {
          CacheCreateConfigOperation op=new CacheCreateConfigOperation(config,false);
          operationService.createInvocationBuilder(AbstractCacheService.SERVICE_NAME,op,member.getAddress()).setCallback(callback).invoke();
        }
      }
    }
  }
}
Program: 47443
Project: 47443
Buggy source:
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,createAlsoOnOthers,false);
}

Fixed version (ground truth):
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,createAlsoOnOthers);
}
Program: 47444
Project: 47444
Buggy source:
public CacheCreateConfigOperation(CacheConfig config,boolean createAlsoOnOthers,boolean ignoreLocal){
  super(config.getNameWithPrefix());
  this.config=config;
  this.createAlsoOnOthers=createAlsoOnOthers;
  this.ignoreLocal=ignoreLocal;
}

Fixed version (ground truth):
public CacheCreateConfigOperation(CacheConfig config,boolean createAlsoOnOthers){
  super(config.getNameWithPrefix());
  this.config=config;
  this.createAlsoOnOthers=createAlsoOnOthers;
}
Program: 47445
Project: 47445
Buggy source:
@Override public void run() throws Exception {
  AbstractCacheService service=getService();
  if (!ignoreLocal) {
    response=service.createCacheConfigIfAbsent(config);
  }
  if (createAlsoOnOthers && response == null) {
    NodeEngine nodeEngine=getNodeEngine();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    int remoteNodeCount=members.size() - 1;
    if (remoteNodeCount > 0) {
      postponeReturnResponse();
      Callback<Object> callback=new CacheConfigCreateCallback(getResponseHandler(),remoteNodeCount);
      OperationService operationService=nodeEngine.getOperationService();
      for (      MemberImpl member : members) {
        if (!member.localMember()) {
          CacheCreateConfigOperation op=new CacheCreateConfigOperation(config,true);
          operationService.createInvocationBuilder(AbstractCacheService.SERVICE_NAME,op,member.getAddress()).setCallback(callback).invoke();
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  AbstractCacheService service=getService();
  response=service.createCacheConfigIfAbsent(config);
  if (createAlsoOnOthers && response == null) {
    NodeEngine nodeEngine=getNodeEngine();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    int remoteNodeCount=members.size() - 1;
    if (remoteNodeCount > 0) {
      postponeReturnResponse();
      Callback<Object> callback=new CacheConfigCreateCallback(getResponseHandler(),remoteNodeCount);
      OperationService operationService=nodeEngine.getOperationService();
      for (      MemberImpl member : members) {
        if (!member.localMember()) {
          CacheCreateConfigOperation op=new CacheCreateConfigOperation(config,true);
          operationService.createInvocationBuilder(AbstractCacheService.SERVICE_NAME,op,member.getAddress()).setCallback(callback).invoke();
        }
      }
    }
  }
}
Program: 47446
Project: 47446
Buggy source:
@Override protected void readInternal(ObjectDataInput in) throws IOException {
  super.readInternal(in);
  config=in.readObject();
  createAlsoOnOthers=in.readBoolean();
  ignoreLocal=in.readBoolean();
}

Fixed version (ground truth):
@Override protected void readInternal(ObjectDataInput in) throws IOException {
  super.readInternal(in);
  config=in.readObject();
  createAlsoOnOthers=in.readBoolean();
}
Program: 47447
Project: 47447
Buggy source:
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  out.writeObject(config);
  out.writeBoolean(createAlsoOnOthers);
  out.writeBoolean(ignoreLocal);
}

Fixed version (ground truth):
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  out.writeObject(config);
  out.writeBoolean(createAlsoOnOthers);
}
Program: 47448
Project: 47448
Buggy source:
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,createAlsoOnOthers,false);
}

Fixed version (ground truth):
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,createAlsoOnOthers);
}
Program: 47449
Project: 47449
Buggy source:
public CacheCreateConfigOperation(CacheConfig config,boolean createAlsoOnOthers,boolean ignoreLocal){
  super(config.getNameWithPrefix());
  this.config=config;
  this.createAlsoOnOthers=createAlsoOnOthers;
  this.ignoreLocal=ignoreLocal;
}

Fixed version (ground truth):
public CacheCreateConfigOperation(CacheConfig config,boolean createAlsoOnOthers){
  super(config.getNameWithPrefix());
  this.config=config;
  this.createAlsoOnOthers=createAlsoOnOthers;
}
Program: 47450
Project: 47450
Buggy source:
@Override public void run() throws Exception {
  AbstractCacheService service=getService();
  if (!ignoreLocal) {
    response=service.createCacheConfigIfAbsent(config);
  }
  if (createAlsoOnOthers && response == null) {
    NodeEngine nodeEngine=getNodeEngine();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    int remoteNodeCount=members.size() - 1;
    if (remoteNodeCount > 0) {
      postponeReturnResponse();
      Callback<Object> callback=new CacheConfigCreateCallback(getResponseHandler(),remoteNodeCount);
      OperationService operationService=nodeEngine.getOperationService();
      for (      MemberImpl member : members) {
        if (!member.localMember()) {
          CacheCreateConfigOperation op=new CacheCreateConfigOperation(config,true);
          operationService.createInvocationBuilder(AbstractCacheService.SERVICE_NAME,op,member.getAddress()).setCallback(callback).invoke();
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  AbstractCacheService service=getService();
  response=service.createCacheConfigIfAbsent(config);
  if (createAlsoOnOthers && response == null) {
    NodeEngine nodeEngine=getNodeEngine();
    Collection<MemberImpl> members=nodeEngine.getClusterService().getMemberList();
    int remoteNodeCount=members.size() - 1;
    if (remoteNodeCount > 0) {
      postponeReturnResponse();
      Callback<Object> callback=new CacheConfigCreateCallback(getResponseHandler(),remoteNodeCount);
      OperationService operationService=nodeEngine.getOperationService();
      for (      MemberImpl member : members) {
        if (!member.localMember()) {
          CacheCreateConfigOperation op=new CacheCreateConfigOperation(config,true);
          operationService.createInvocationBuilder(AbstractCacheService.SERVICE_NAME,op,member.getAddress()).setCallback(callback).invoke();
        }
      }
    }
  }
}
Program: 47451
Project: 47451
Buggy source:
@Override protected void readInternal(ObjectDataInput in) throws IOException {
  super.readInternal(in);
  config=in.readObject();
  createAlsoOnOthers=in.readBoolean();
  ignoreLocal=in.readBoolean();
}

Fixed version (ground truth):
@Override protected void readInternal(ObjectDataInput in) throws IOException {
  super.readInternal(in);
  config=in.readObject();
  createAlsoOnOthers=in.readBoolean();
}
Program: 47452
Project: 47452
Buggy source:
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  out.writeObject(config);
  out.writeBoolean(createAlsoOnOthers);
  out.writeBoolean(ignoreLocal);
}

Fixed version (ground truth):
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  out.writeObject(config);
  out.writeBoolean(createAlsoOnOthers);
}
Program: 47453
Project: 47453
Buggy source:
private EventHandler<PortableEntryEvent> createHandler(final MapListener listener,final boolean includeValue){
  final ListenerAdapter listenerAdaptor=createMapListenerAdaptor(listener);
  return new ClientMapEventHandler(listenerAdaptor,includeValue);
}

Fixed version (ground truth):
private EventHandler<PortableEntryEvent> createHandler(final Object listener,final boolean includeValue){
  final ListenerAdapter listenerAdaptor=createListenerAdapter(listener);
  return new ClientMapEventHandler(listenerAdaptor,includeValue);
}
Program: 47454
Project: 47454
Buggy source:
@Override public String addLocalEntryListener(MapListener listener,Predicate<K,V> predicate,K key,boolean includeValue){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public String addLocalEntryListener(EntryListener listener,Predicate<K,V> predicate,K key,boolean includeValue){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 47455
Project: 47455
Buggy source:
@Override public String addEntryListener(MapListener listener,Predicate<K,V> predicate,boolean includeValue){
  MapAddEntryListenerRequest request=new MapAddEntryListenerRequest(name,null,includeValue,predicate);
  EventHandler<PortableEntryEvent> handler=createHandler(listener,includeValue);
  return listen(request,null,handler);
}

Fixed version (ground truth):
@Override public String addEntryListener(EntryListener listener,Predicate<K,V> predicate,boolean includeValue){
  MapAddEntryListenerRequest request=new MapAddEntryListenerRequest(name,null,includeValue,predicate);
  EventHandler<PortableEntryEvent> handler=createHandler(listener,includeValue);
  return listen(request,null,handler);
}
Program: 47456
Project: 47456
Buggy source:
private EventHandler<PortableEntryEvent> createHandler(final MapListener listener,final boolean includeValue){
  final ListenerAdapter listenerAdaptor=createMapListenerAdaptor(listener);
  return new ClientMapEventHandler(listenerAdaptor,includeValue);
}

Fixed version (ground truth):
private EventHandler<PortableEntryEvent> createHandler(final Object listener,final boolean includeValue){
  final ListenerAdapter listenerAdaptor=createListenerAdapter(listener);
  return new ClientMapEventHandler(listenerAdaptor,includeValue);
}
Program: 47457
Project: 47457
Buggy source:
@Override public String addLocalEntryListener(MapListener listener,Predicate<K,V> predicate,K key,boolean includeValue){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public String addLocalEntryListener(EntryListener listener,Predicate<K,V> predicate,K key,boolean includeValue){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 47458
Project: 47458
Buggy source:
@Override public String addEntryListener(MapListener listener,Predicate<K,V> predicate,boolean includeValue){
  MapAddEntryListenerRequest request=new MapAddEntryListenerRequest(name,null,includeValue,predicate);
  EventHandler<PortableEntryEvent> handler=createHandler(listener,includeValue);
  return listen(request,null,handler);
}

Fixed version (ground truth):
@Override public String addEntryListener(EntryListener listener,Predicate<K,V> predicate,boolean includeValue){
  MapAddEntryListenerRequest request=new MapAddEntryListenerRequest(name,null,includeValue,predicate);
  EventHandler<PortableEntryEvent> handler=createHandler(listener,includeValue);
  return listen(request,null,handler);
}
Program: 47459
Project: 47459
Buggy source:
@Override protected <K,V>CacheConfig<K,V> createConfigOnPartition(CacheConfig<K,V> cacheConfig){
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(cacheConfig.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(cacheConfig,true,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheConfig.getNameWithPrefix());
    return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
@Override protected <K,V>CacheConfig<K,V> createConfigOnPartition(CacheConfig<K,V> cacheConfig){
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(cacheConfig.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(cacheConfig,false,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheConfig.getNameWithPrefix());
    return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 47460
Project: 47460
Buggy source:
public void read(PortableReader reader) throws IOException {
  create=reader.readBoolean("String_Node_Str");
  partitionId=reader.readInt("String_Node_Str");
  final ObjectDataInput in=reader.getRawDataInput();
  cacheConfig=in.readObject();
}

Fixed version (ground truth):
public void read(PortableReader reader) throws IOException {
  createAlsoOnOthers=reader.readBoolean("String_Node_Str");
  partitionId=reader.readInt("String_Node_Str");
  final ObjectDataInput in=reader.getRawDataInput();
  cacheConfig=in.readObject();
}
Program: 47461
Project: 47461
Buggy source:
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,create,false);
}

Fixed version (ground truth):
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,createAlsoOnOthers,false);
}
Program: 47462
Project: 47462
Buggy source:
public CacheCreateConfigRequest(CacheConfig cacheConfig,boolean create,int partitionId){
  this.cacheConfig=cacheConfig;
  this.create=create;
  this.partitionId=partitionId;
}

Fixed version (ground truth):
public CacheCreateConfigRequest(CacheConfig cacheConfig,boolean createAlsoOnOthers,int partitionId){
  this.cacheConfig=cacheConfig;
  this.createAlsoOnOthers=createAlsoOnOthers;
  this.partitionId=partitionId;
}
Program: 47463
Project: 47463
Buggy source:
public void write(PortableWriter writer) throws IOException {
  writer.writeBoolean("String_Node_Str",create);
  writer.writeInt("String_Node_Str",partitionId);
  final ObjectDataOutput out=writer.getRawDataOutput();
  out.writeObject(cacheConfig);
}

Fixed version (ground truth):
public void write(PortableWriter writer) throws IOException {
  writer.writeBoolean("String_Node_Str",createAlsoOnOthers);
  writer.writeInt("String_Node_Str",partitionId);
  final ObjectDataOutput out=writer.getRawDataOutput();
  out.writeObject(cacheConfig);
}
Program: 47464
Project: 47464
Buggy source:
@Override protected <K,V>CacheConfig<K,V> createConfigOnPartition(CacheConfig<K,V> cacheConfig){
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(cacheConfig.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(cacheConfig,false,false,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheConfig.getNameWithPrefix());
    return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
@Override protected <K,V>CacheConfig<K,V> createConfigOnPartition(CacheConfig<K,V> cacheConfig){
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(cacheConfig.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(cacheConfig,true,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheConfig.getNameWithPrefix());
    return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 47465
Project: 47465
Buggy source:
@Override protected <K,V>CacheConfig<K,V> createConfig(String cacheName,CacheConfig<K,V> config,boolean createAlsoOnOthers,boolean syncCreate){
  CacheConfig<K,V> currentCacheConfig=configs.get(cacheName);
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(config.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(config,createAlsoOnOthers,false,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheName);
    if (syncCreate) {
      return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
    }
 else {
      return currentCacheConfig;
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
@Override protected <K,V>CacheConfig<K,V> createConfig(String cacheName,CacheConfig<K,V> config,boolean createAlsoOnOthers,boolean syncCreate){
  CacheConfig<K,V> currentCacheConfig=configs.get(cacheName);
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(config.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(config,createAlsoOnOthers,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheName);
    if (syncCreate) {
      return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
    }
 else {
      return currentCacheConfig;
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 47466
Project: 47466
Buggy source:
public void read(PortableReader reader) throws IOException {
  createAlsoOnOthers=reader.readBoolean("String_Node_Str");
  ignoreLocal=reader.readBoolean("String_Node_Str");
  partitionId=reader.readInt("String_Node_Str");
  final ObjectDataInput in=reader.getRawDataInput();
  cacheConfig=in.readObject();
}

Fixed version (ground truth):
public void read(PortableReader reader) throws IOException {
  create=reader.readBoolean("String_Node_Str");
  partitionId=reader.readInt("String_Node_Str");
  final ObjectDataInput in=reader.getRawDataInput();
  cacheConfig=in.readObject();
}
Program: 47467
Project: 47467
Buggy source:
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,createAlsoOnOthers,ignoreLocal);
}

Fixed version (ground truth):
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,create,false);
}
Program: 47468
Project: 47468
Buggy source:
public CacheCreateConfigRequest(CacheConfig cacheConfig,boolean createAlsoOnOthers,boolean ignoreLocal,int partitionId){
  this.cacheConfig=cacheConfig;
  this.createAlsoOnOthers=createAlsoOnOthers;
  this.ignoreLocal=ignoreLocal;
  this.partitionId=partitionId;
}

Fixed version (ground truth):
public CacheCreateConfigRequest(CacheConfig cacheConfig,boolean create,int partitionId){
  this.cacheConfig=cacheConfig;
  this.create=create;
  this.partitionId=partitionId;
}
Program: 47469
Project: 47469
Buggy source:
public void write(PortableWriter writer) throws IOException {
  writer.writeBoolean("String_Node_Str",createAlsoOnOthers);
  writer.writeBoolean("String_Node_Str",ignoreLocal);
  writer.writeInt("String_Node_Str",partitionId);
  final ObjectDataOutput out=writer.getRawDataOutput();
  out.writeObject(cacheConfig);
}

Fixed version (ground truth):
public void write(PortableWriter writer) throws IOException {
  writer.writeBoolean("String_Node_Str",create);
  writer.writeInt("String_Node_Str",partitionId);
  final ObjectDataOutput out=writer.getRawDataOutput();
  out.writeObject(cacheConfig);
}
Program: 47470
Project: 47470
Buggy source:
@Override protected <K,V>CacheConfig<K,V> createConfigOnPartition(CacheConfig<K,V> cacheConfig){
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(cacheConfig.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(cacheConfig,false,false,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheConfig.getNameWithPrefix());
    return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
@Override protected <K,V>CacheConfig<K,V> createConfigOnPartition(CacheConfig<K,V> cacheConfig){
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(cacheConfig.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(cacheConfig,false,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheConfig.getNameWithPrefix());
    return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 47471
Project: 47471
Buggy source:
@Override protected <K,V>CacheConfig<K,V> createConfig(String cacheName,CacheConfig<K,V> config,boolean createAlsoOnOthers,boolean syncCreate){
  CacheConfig<K,V> currentCacheConfig=configs.get(cacheName);
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(config.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(config,createAlsoOnOthers,false,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheName);
    if (syncCreate) {
      return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
    }
 else {
      return currentCacheConfig;
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
@Override protected <K,V>CacheConfig<K,V> createConfig(String cacheName,CacheConfig<K,V> config,boolean createAlsoOnOthers,boolean syncCreate){
  CacheConfig<K,V> currentCacheConfig=configs.get(cacheName);
  try {
    int partitionId=clientContext.getPartitionService().getPartitionId(config.getNameWithPrefix());
    CacheCreateConfigRequest request=new CacheCreateConfigRequest(config,createAlsoOnOthers,partitionId);
    Future future=clientContext.getInvocationService().invokeOnKeyOwner(request,cacheName);
    if (syncCreate) {
      return (CacheConfig<K,V>)clientContext.getSerializationService().toObject(future.get());
    }
 else {
      return currentCacheConfig;
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 47472
Project: 47472
Buggy source:
public void read(PortableReader reader) throws IOException {
  createAlsoOnOthers=reader.readBoolean("String_Node_Str");
  ignoreLocal=reader.readBoolean("String_Node_Str");
  partitionId=reader.readInt("String_Node_Str");
  final ObjectDataInput in=reader.getRawDataInput();
  cacheConfig=in.readObject();
}

Fixed version (ground truth):
public void read(PortableReader reader) throws IOException {
  createAlsoOnOthers=reader.readBoolean("String_Node_Str");
  partitionId=reader.readInt("String_Node_Str");
  final ObjectDataInput in=reader.getRawDataInput();
  cacheConfig=in.readObject();
}
Program: 47473
Project: 47473
Buggy source:
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,createAlsoOnOthers,ignoreLocal);
}

Fixed version (ground truth):
protected Operation prepareOperation(){
  return new CacheCreateConfigOperation(cacheConfig,createAlsoOnOthers,false);
}
Program: 47474
Project: 47474
Buggy source:
public CacheCreateConfigRequest(CacheConfig cacheConfig,boolean createAlsoOnOthers,boolean ignoreLocal,int partitionId){
  this.cacheConfig=cacheConfig;
  this.createAlsoOnOthers=createAlsoOnOthers;
  this.ignoreLocal=ignoreLocal;
  this.partitionId=partitionId;
}

Fixed version (ground truth):
public CacheCreateConfigRequest(CacheConfig cacheConfig,boolean createAlsoOnOthers,int partitionId){
  this.cacheConfig=cacheConfig;
  this.createAlsoOnOthers=createAlsoOnOthers;
  this.partitionId=partitionId;
}
Program: 47475
Project: 47475
Buggy source:
public void write(PortableWriter writer) throws IOException {
  writer.writeBoolean("String_Node_Str",createAlsoOnOthers);
  writer.writeBoolean("String_Node_Str",ignoreLocal);
  writer.writeInt("String_Node_Str",partitionId);
  final ObjectDataOutput out=writer.getRawDataOutput();
  out.writeObject(cacheConfig);
}

Fixed version (ground truth):
public void write(PortableWriter writer) throws IOException {
  writer.writeBoolean("String_Node_Str",createAlsoOnOthers);
  writer.writeInt("String_Node_Str",partitionId);
  final ObjectDataOutput out=writer.getRawDataOutput();
  out.writeObject(cacheConfig);
}
Program: 47476
Project: 47476
Buggy source:
private void pollResponse(final long pollTimeoutMs) throws InterruptedException {
  if (pollTimeoutMs > 0 && response == null) {
    long currentTimeoutMs=pollTimeoutMs;
    final long waitStart=Clock.currentTimeMillis();
synchronized (this) {
      while (currentTimeoutMs > 0 && response == null) {
        wait(currentTimeoutMs);
        currentTimeoutMs=pollTimeoutMs - (Clock.currentTimeMillis() - waitStart);
      }
    }
  }
}

Fixed version (ground truth):
private void pollResponse(final long pollTimeoutMs) throws InterruptedException {
  if (pollTimeoutMs > 0 && response == null) {
    long currentTimeoutMs=pollTimeoutMs;
    final long waitStart=Clock.currentTimeMillis();
synchronized (this) {
      while (currentTimeoutMs > 0 && response == null) {
        wait(currentTimeoutMs);
        currentTimeoutMs=pollTimeoutMs - (Clock.currentTimeMillis() - waitStart);
      }
      notifyAll();
    }
  }
}
Program: 47477
Project: 47477
Buggy source:
@Override public void run() throws Exception {
  CacheService service=getService();
  for (  Map.Entry<String,Map<Data,CacheRecord>> entry : data.entrySet()) {
    ICacheRecordStore cache=service.getOrCreateCache(entry.getKey(),getPartitionId());
    Map<Data,CacheRecord> map=entry.getValue();
    Iterator<Map.Entry<Data,CacheRecord>> iter=map.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry<Data,CacheRecord> next=iter.next();
      Data key=next.getKey();
      CacheRecord record=next.getValue();
      iter.remove();
      cache.setRecord(key,record);
    }
  }
  data.clear();
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  CacheService service=getService();
  for (  Map.Entry<String,Map<Data,CacheRecord>> entry : data.entrySet()) {
    ICacheRecordStore cache=service.getOrCreateCache(entry.getKey(),getPartitionId());
    Map<Data,CacheRecord> map=entry.getValue();
    Iterator<Map.Entry<Data,CacheRecord>> iter=map.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry<Data,CacheRecord> next=iter.next();
      Data key=next.getKey();
      CacheRecord record=next.getValue();
      iter.remove();
      cache.putRecord(key,record);
    }
  }
  data.clear();
}
Program: 47478
Project: 47478
Buggy source:
@Override public void run() throws Exception {
  CacheService service=getService();
  for (  Map.Entry<String,Map<Data,CacheRecord>> entry : data.entrySet()) {
    ICacheRecordStore cache=service.getOrCreateCache(entry.getKey(),getPartitionId());
    Map<Data,CacheRecord> map=entry.getValue();
    Iterator<Map.Entry<Data,CacheRecord>> iter=map.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry<Data,CacheRecord> next=iter.next();
      Data key=next.getKey();
      CacheRecord record=next.getValue();
      iter.remove();
      cache.setRecord(key,record);
    }
  }
  data.clear();
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  CacheService service=getService();
  for (  Map.Entry<String,Map<Data,CacheRecord>> entry : data.entrySet()) {
    ICacheRecordStore cache=service.getOrCreateCache(entry.getKey(),getPartitionId());
    Map<Data,CacheRecord> map=entry.getValue();
    Iterator<Map.Entry<Data,CacheRecord>> iter=map.entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry<Data,CacheRecord> next=iter.next();
      Data key=next.getKey();
      CacheRecord record=next.getValue();
      iter.remove();
      cache.putRecord(key,record);
    }
  }
  data.clear();
}
Program: 47479
Project: 47479
Buggy source:
@Test public void testCompletionTest() throws InterruptedException {
  String cacheName="String_Node_Str";
  CacheManager cacheManager=cachingProvider1.getCacheManager();
  CacheConfig<Integer,String> config=new CacheConfig<Integer,String>();
  SimpleEntryListener<Integer,String> listener=new SimpleEntryListener<Integer,String>();
  MutableCacheEntryListenerConfiguration<Integer,String> listenerConfiguration=new MutableCacheEntryListenerConfiguration<Integer,String>(FactoryBuilder.factoryOf(listener),null,true,true);
  config.addCacheEntryListenerConfiguration(listenerConfiguration);
  Cache<Integer,String> cache=cacheManager.createCache(cacheName,config);
  assertNotNull(cache);
  Integer key1=1;
  String value1="String_Node_Str";
  cache.put(key1,value1);
  assertEquals(1,listener.created.get());
  Integer key2=2;
  String value2="String_Node_Str";
  cache.put(key2,value2);
  assertEquals(2,listener.created.get());
  Set<Integer> keys=new HashSet<Integer>();
  keys.add(key1);
  keys.add(key2);
  cache.removeAll(keys);
  assertEquals(2,listener.removed.get());
}

Fixed version (ground truth):
@Test public void testCompletionTest() throws InterruptedException {
  String cacheName="String_Node_Str";
  CacheManager cacheManager=cachingProvider1.getCacheManager();
  CacheConfig<Integer,String> config=new CacheConfig<Integer,String>();
  final SimpleEntryListener<Integer,String> listener=new SimpleEntryListener<Integer,String>();
  MutableCacheEntryListenerConfiguration<Integer,String> listenerConfiguration=new MutableCacheEntryListenerConfiguration<Integer,String>(FactoryBuilder.factoryOf(listener),null,true,true);
  config.addCacheEntryListenerConfiguration(listenerConfiguration);
  Cache<Integer,String> cache=cacheManager.createCache(cacheName,config);
  assertNotNull(cache);
  Integer key1=1;
  String value1="String_Node_Str";
  cache.put(key1,value1);
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      assertEquals(1,listener.created.get());
    }
  }
);
  Integer key2=2;
  String value2="String_Node_Str";
  cache.put(key2,value2);
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      assertEquals(2,listener.created.get());
    }
  }
);
  Set<Integer> keys=new HashSet<Integer>();
  keys.add(key1);
  keys.add(key2);
  cache.removeAll(keys);
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      assertEquals(2,listener.removed.get());
    }
  }
);
}
Program: 47480
Project: 47480
Buggy source:
@Override public void onCreated(Iterable<CacheEntryEvent<? extends K,? extends V>> cacheEntryEvents) throws CacheEntryListenerException {
  try {
    Thread.sleep(3000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  for (  CacheEntryEvent<? extends K,? extends V> cacheEntryEvent : cacheEntryEvents) {
    created.incrementAndGet();
  }
}

Fixed version (ground truth):
@Override public void onCreated(Iterable<CacheEntryEvent<? extends K,? extends V>> cacheEntryEvents) throws CacheEntryListenerException {
  for (  CacheEntryEvent<? extends K,? extends V> cacheEntryEvent : cacheEntryEvents) {
    created.incrementAndGet();
  }
}
Program: 47481
Project: 47481
Buggy source:
private void pollResponse(final long pollTimeoutMs) throws InterruptedException {
  if (pollTimeoutMs > 0 && response == null) {
    long currentTimeoutMs=pollTimeoutMs;
    final long waitStart=Clock.currentTimeMillis();
synchronized (this) {
      while (currentTimeoutMs > 0 && response == null) {
        wait(currentTimeoutMs);
        currentTimeoutMs=pollTimeoutMs - (Clock.currentTimeMillis() - waitStart);
      }
    }
  }
}

Fixed version (ground truth):
private void pollResponse(final long pollTimeoutMs) throws InterruptedException {
  if (pollTimeoutMs > 0 && response == null) {
    long currentTimeoutMs=pollTimeoutMs;
    final long waitStart=Clock.currentTimeMillis();
synchronized (this) {
      while (currentTimeoutMs > 0 && response == null) {
        wait(currentTimeoutMs);
        currentTimeoutMs=pollTimeoutMs - (Clock.currentTimeMillis() - waitStart);
      }
      notifyAll();
    }
  }
}