nus-yam/ex-repair huggingface dataset:
Program: 47387
Project: 47387
Buggy source:
protected ClientConfig createClientConfig(){
  return new ClientConfig();
}

Fixed version (ground truth):
protected ClientConfig createClientConfig(){
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().addAddress("String_Node_Str");
  return clientConfig;
}
Program: 47388
Project: 47388
Buggy source:
@Override protected CachingProvider getCachingProvider(){
  Hazelcast.newHazelcastInstance();
  Hazelcast.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().addAddress("String_Node_Str");
  hazelcastInstance=HazelcastClient.newHazelcastClient(clientConfig);
  return HazelcastClientCachingProvider.createCachingProvider(hazelcastInstance);
}

Fixed version (ground truth):
@Override protected CachingProvider getCachingProvider(){
  Config config=new Config();
  JoinConfig joinConfig=config.getNetworkConfig().getJoin();
  joinConfig.getAwsConfig().setEnabled(false);
  joinConfig.getMulticastConfig().setEnabled(false);
  joinConfig.getTcpIpConfig().setEnabled(false);
  Hazelcast.newHazelcastInstance(config);
  Hazelcast.newHazelcastInstance(config);
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().addAddress("String_Node_Str");
  hazelcastInstance=HazelcastClient.newHazelcastClient(clientConfig);
  return HazelcastClientCachingProvider.createCachingProvider(hazelcastInstance);
}
Program: 47389
Project: 47389
Buggy source:
protected ClientConfig createClientConfig(){
  return new ClientConfig();
}

Fixed version (ground truth):
protected ClientConfig createClientConfig(){
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().addAddress("String_Node_Str");
  return clientConfig;
}
Program: 47390
Project: 47390
Buggy source:
static void assertTotalInvocations(final SlowOperationLog log,final int totalInvocations){
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      assertEqualsStringFormat("String_Node_Str" + log.createDTO().toJson(),totalInvocations,log.totalInvocations.get());
    }
  }
,ASSERT_TRUE_TIMEOUT);
}

Fixed version (ground truth):
static void assertTotalInvocations(final SlowOperationLog log,final int totalInvocations){
  assertEqualsStringFormat("String_Node_Str" + log.createDTO().toJson(),totalInvocations,log.totalInvocations.get());
}
Program: 47391
Project: 47391
Buggy source:
static void assertNumberOfSlowOperationLogs(final Collection<SlowOperationLog> logs,final int expected){
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      assertEqualsStringFormat("String_Node_Str",expected,logs.size());
    }
  }
,ASSERT_TRUE_TIMEOUT);
}

Fixed version (ground truth):
static void assertNumberOfSlowOperationLogs(final Collection<SlowOperationLog> logs,final int expected){
  assertEqualsStringFormat("String_Node_Str",expected,logs.size());
}
Program: 47392
Project: 47392
Buggy source:
@Test public void testSlowOperationOnPartitionOperationThread(){
  instance=getSingleNodeCluster(1000);
  SlowOperation operation=new SlowOperation(4,1);
  executeOperation(instance,operation);
  operation.await();
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,1);
  assertOperationContainsClassName(firstLog,"String_Node_Str");
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSlowOperationOnPartitionOperationThread(){
  instance=getSingleNodeCluster(1000);
  SlowOperation operation=new SlowOperation(4,2);
  executeOperation(instance,operation);
  operation.await();
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,1);
  assertOperationContainsClassName(firstLog,"String_Node_Str");
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
}
Program: 47393
Project: 47393
Buggy source:
@Test public void testSlowOperationOnGenericOperationThread(){
  instance=getSingleNodeCluster(1000);
  SlowOperation operation=new SlowOperation(2);
  executeOperation(instance,operation);
  operation.await();
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,1);
  assertOperationContainsClassName(firstLog,"String_Node_Str");
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSlowOperationOnGenericOperationThread(){
  instance=getSingleNodeCluster(1000);
  SlowOperation operation=new SlowOperation(3);
  executeOperation(instance,operation);
  operation.await();
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,1);
  assertOperationContainsClassName(firstLog,"String_Node_Str");
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
}
Program: 47394
Project: 47394
Buggy source:
@Test public void testSlowRecursiveOperation(){
  int partitionThreads=32;
  int numberOfOperations=50;
  int recursionDepth=20;
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_SLOW_OPERATION_DETECTOR_THRESHOLD_MILLIS,"String_Node_Str");
  config.setProperty(GroupProperties.PROP_PARTITION_OPERATION_THREAD_COUNT,String.valueOf(partitionThreads));
  instance=createHazelcastInstance(config);
  List<SlowRecursiveOperation> operations=new ArrayList<SlowRecursiveOperation>(numberOfOperations);
  int partitionCount=getNode(instance).nodeEngine.getPartitionService().getPartitionCount();
  int partitionIndex=1;
  for (int i=0; i < numberOfOperations; i++) {
    int partitionId=partitionIndex % partitionCount;
    SlowRecursiveOperation operation=new SlowRecursiveOperation(partitionId,recursionDepth,3);
    operations.add(operation);
    executeOperation(instance,operation);
    partitionIndex+=partitionCount / partitionThreads + 1;
  }
  for (  SlowRecursiveOperation operation : operations) {
    operation.await();
  }
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,numberOfOperations);
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSlowRecursiveOperation(){
  int partitionThreads=32;
  int numberOfOperations=40;
  int recursionDepth=15;
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_SLOW_OPERATION_DETECTOR_THRESHOLD_MILLIS,"String_Node_Str");
  config.setProperty(GroupProperties.PROP_SLOW_OPERATION_DETECTOR_LOG_RETENTION_SECONDS,String.valueOf(Integer.MAX_VALUE));
  config.setProperty(GroupProperties.PROP_PARTITION_OPERATION_THREAD_COUNT,String.valueOf(partitionThreads));
  instance=createHazelcastInstance(config);
  List<SlowRecursiveOperation> operations=new ArrayList<SlowRecursiveOperation>(numberOfOperations);
  int partitionCount=getNode(instance).nodeEngine.getPartitionService().getPartitionCount();
  int partitionIndex=1;
  for (int i=0; i < numberOfOperations; i++) {
    int partitionId=partitionIndex % partitionCount;
    SlowRecursiveOperation operation=new SlowRecursiveOperation(partitionId,recursionDepth,4);
    operations.add(operation);
    executeOperation(instance,operation);
    partitionIndex+=partitionCount / partitionThreads + 1;
  }
  for (  SlowRecursiveOperation operation : operations) {
    operation.await();
  }
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,numberOfOperations);
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
}
Program: 47395
Project: 47395
Buggy source:
@Test public void testNestedSlowEntryProcessor(){
  HazelcastInstance instance=getSingleNodeCluster(1000);
  IMap<String,String> map=getMapWithSingleElement(instance);
  NestedSlowEntryProcessor entryProcessor=new NestedSlowEntryProcessor(map,2);
  map.executeOnEntries(entryProcessor);
  entryProcessor.await();
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,1);
  assertEntryProcessorOperation(firstLog);
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testNestedSlowEntryProcessor(){
  HazelcastInstance instance=getSingleNodeCluster(1000);
  IMap<String,String> map=getMapWithSingleElement(instance);
  NestedSlowEntryProcessor entryProcessor=new NestedSlowEntryProcessor(map,3);
  map.executeOnEntries(entryProcessor);
  entryProcessor.await();
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,1);
  assertEntryProcessorOperation(firstLog);
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
}
Program: 47396
Project: 47396
Buggy source:
@Test public void testSlowEntryProcessor() throws InterruptedException {
  HazelcastInstance instance=getSingleNodeCluster(2000);
  IMap<String,String> map=getMapWithSingleElement(instance);
  for (int i=0; i < 3; i++) {
    map.executeOnEntries(getSlowEntryProcessor(3));
  }
  map.executeOnEntries(getSlowEntryProcessor(6));
  awaitSlowEntryProcessors();
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,4);
  assertEntryProcessorOperation(firstLog);
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
  Collection<SlowOperationLog.Invocation> invocations=getInvocations(firstLog);
  assertEqualsStringFormat("String_Node_Str",4,invocations.size());
  for (  SlowOperationLog.Invocation invocation : invocations) {
    assertInvocationDurationBetween(invocation,2000,6500);
  }
}

Fixed version (ground truth):
@Test public void testSlowEntryProcessor() throws InterruptedException {
  HazelcastInstance instance=getSingleNodeCluster(1000);
  IMap<String,String> map=getMapWithSingleElement(instance);
  for (int i=0; i < 3; i++) {
    map.executeOnEntries(getSlowEntryProcessor(3));
  }
  map.executeOnEntries(getSlowEntryProcessor(6));
  awaitSlowEntryProcessors();
  Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,1);
  SlowOperationLog firstLog=logs.iterator().next();
  assertTotalInvocations(firstLog,4);
  assertEntryProcessorOperation(firstLog);
  assertStackTraceContainsClassName(firstLog,"String_Node_Str");
  Collection<SlowOperationLog.Invocation> invocations=getInvocations(firstLog);
  assertEqualsStringFormat("String_Node_Str",4,invocations.size());
  for (  SlowOperationLog.Invocation invocation : invocations) {
    assertInvocationDurationBetween(invocation,1000,6500);
  }
}
Program: 47397
Project: 47397
Buggy source:
@Test public void testMultipleSlowEntryProcessorClasses() throws InterruptedException {
  HazelcastInstance instance=getSingleNodeCluster(2000);
  IMap<String,String> map=getMapWithSingleElement(instance);
  for (int i=0; i < 3; i++) {
    map.executeOnEntries(getSlowEntryProcessor(3));
  }
  SlowEntryProcessorChild entryProcessorChild=new SlowEntryProcessorChild(3);
  map.executeOnEntries(entryProcessorChild);
  map.executeOnEntries(getSlowEntryProcessor(5));
  awaitSlowEntryProcessors();
  entryProcessorChild.await();
  final Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,2);
  assertTrueEventually(new AssertTask(){
    @Override public void run() throws Exception {
      Iterator<SlowOperationLog> iterator=logs.iterator();
      SlowOperationLog firstLog=iterator.next();
      SlowOperationLog secondLog=iterator.next();
      int firstSize=getInvocations(firstLog).size();
      int secondSize=getInvocations(secondLog).size();
      assertTrue(format("String_Node_Str",firstSize,secondSize,firstLog.createDTO().toJson(),secondLog.createDTO().toJson()),(firstSize == 1 ^ secondSize == 1) && (firstSize == 4 ^ secondSize == 4));
    }
  }
,ASSERT_TRUE_TIMEOUT);
}

Fixed version (ground truth):
@Test public void testMultipleSlowEntryProcessorClasses() throws InterruptedException {
  HazelcastInstance instance=getSingleNodeCluster(1000);
  IMap<String,String> map=getMapWithSingleElement(instance);
  for (int i=0; i < 3; i++) {
    map.executeOnEntries(getSlowEntryProcessor(3));
  }
  SlowEntryProcessorChild entryProcessorChild=new SlowEntryProcessorChild(3);
  map.executeOnEntries(entryProcessorChild);
  map.executeOnEntries(getSlowEntryProcessor(5));
  awaitSlowEntryProcessors();
  entryProcessorChild.await();
  final Collection<SlowOperationLog> logs=getSlowOperationLogs(instance);
  assertNumberOfSlowOperationLogs(logs,2);
  Iterator<SlowOperationLog> iterator=logs.iterator();
  SlowOperationLog firstLog=iterator.next();
  SlowOperationLog secondLog=iterator.next();
  Collection<SlowOperationLog.Invocation> firstInvocations=getInvocations(firstLog);
  Collection<SlowOperationLog.Invocation> secondInvocations=getInvocations(secondLog);
  int firstSize=firstInvocations.size();
  int secondSize=secondInvocations.size();
  assertTrue(format("String_Node_Str",firstSize,secondSize,firstLog.createDTO().toJson(),secondLog.createDTO().toJson()),(firstSize == 1 ^ secondSize == 1) && (firstSize == 4 ^ secondSize == 4));
  for (  SlowOperationLog.Invocation invocation : firstInvocations) {
    assertInvocationDurationBetween(invocation,1000,5500);
  }
  for (  SlowOperationLog.Invocation invocation : secondInvocations) {
    assertInvocationDurationBetween(invocation,1000,5500);
  }
}
Program: 47398
Project: 47398
Buggy source:
@Test public void testJSON_SlowEntryProcessor(){
  for (int i=0; i < 2; i++) {
    map.executeOnEntries(getSlowEntryProcessor(2));
  }
  map.executeOnEntries(getSlowEntryProcessor(3));
  map.executeOnEntries(getSlowEntryProcessor(2));
  awaitSlowEntryProcessors();
  logger.finest(getOperationStats(instance).toString());
  JsonObject firstLogJsonObject=getSlowOperationLogsJsonArray(instance).get(0).asObject();
  assertJSONContainsClassName(firstLogJsonObject,"String_Node_Str");
  assertEqualsStringFormat("String_Node_Str",4,firstLogJsonObject.get("String_Node_Str").asArray().size());
}

Fixed version (ground truth):
@Test public void testJSON_SlowEntryProcessor(){
  for (int i=0; i < 2; i++) {
    map.executeOnEntries(getSlowEntryProcessor(3));
  }
  map.executeOnEntries(getSlowEntryProcessor(4));
  map.executeOnEntries(getSlowEntryProcessor(3));
  awaitSlowEntryProcessors();
  logger.finest(getOperationStats(instance).toString());
  JsonObject firstLogJsonObject=getSlowOperationLogsJsonArray(instance).get(0).asObject();
  assertJSONContainsClassName(firstLogJsonObject,"String_Node_Str");
  assertEqualsStringFormat("String_Node_Str",4,firstLogJsonObject.get("String_Node_Str").asArray().size());
}
Program: 47399
Project: 47399
Buggy source:
@Test public void testJSON_multipleEntryProcessorClasses() throws InterruptedException {
  for (int i=0; i < 2; i++) {
    map.executeOnEntries(getSlowEntryProcessor(2));
  }
  SlowEntryProcessorChild entryProcessorChild=new SlowEntryProcessorChild(2);
  map.executeOnEntries(entryProcessorChild);
  map.executeOnEntries(getSlowEntryProcessor(4));
  awaitSlowEntryProcessors();
  entryProcessorChild.await();
  logger.finest(getOperationStats(instance).toString());
  JsonArray slowOperationLogsJsonArray=getSlowOperationLogsJsonArray(instance);
  JsonObject firstLogJsonObject=slowOperationLogsJsonArray.get(0).asObject();
  JsonObject secondLogJsonObject=slowOperationLogsJsonArray.get(1).asObject();
  assertJSONContainsClassNameJustOnce(firstLogJsonObject,secondLogJsonObject,"String_Node_Str");
  assertJSONContainsClassNameJustOnce(firstLogJsonObject,secondLogJsonObject,"String_Node_Str");
  int firstSize=firstLogJsonObject.get("String_Node_Str").asArray().size();
  int secondSize=secondLogJsonObject.get("String_Node_Str").asArray().size();
  assertTrue(format("String_Node_Str",firstSize,secondSize),(firstSize == 1 ^ secondSize == 1) && (firstSize == 3 ^ secondSize == 3));
}

Fixed version (ground truth):
@Test public void testJSON_multipleEntryProcessorClasses() throws InterruptedException {
  for (int i=0; i < 2; i++) {
    map.executeOnEntries(getSlowEntryProcessor(3));
  }
  SlowEntryProcessorChild entryProcessorChild=new SlowEntryProcessorChild(3);
  map.executeOnEntries(entryProcessorChild);
  map.executeOnEntries(getSlowEntryProcessor(4));
  awaitSlowEntryProcessors();
  entryProcessorChild.await();
  logger.finest(getOperationStats(instance).toString());
  JsonArray slowOperationLogsJsonArray=getSlowOperationLogsJsonArray(instance);
  JsonObject firstLogJsonObject=slowOperationLogsJsonArray.get(0).asObject();
  JsonObject secondLogJsonObject=slowOperationLogsJsonArray.get(1).asObject();
  assertJSONContainsClassNameJustOnce(firstLogJsonObject,secondLogJsonObject,"String_Node_Str");
  assertJSONContainsClassNameJustOnce(firstLogJsonObject,secondLogJsonObject,"String_Node_Str");
  int firstSize=firstLogJsonObject.get("String_Node_Str").asArray().size();
  int secondSize=secondLogJsonObject.get("String_Node_Str").asArray().size();
  assertTrue(format("String_Node_Str",firstSize,secondSize),(firstSize == 1 ^ secondSize == 1) && (firstSize == 3 ^ secondSize == 3));
}
Program: 47400
Project: 47400
Buggy source:
/** 
 * Tries to unschedule this WriteHandler. <p/> It will only be unscheduled if: - the outputBuffer is empty - there are no pending packets. <p/> If the outputBuffer is dirty then it will register itself for an OP_WRITE since we are interested in knowing if there is more space in the socket output buffer. If the outputBuffer is not dirty, then it will unregister itself from an OP_WRITE since it isn't interested in space in the socket outputBuffer. <p/> This call is only made by the IO thread.
 */
private void unschedule(){
  if (dirtyOutputBuffer()) {
    registerOp(SelectionKey.OP_WRITE);
    return;
  }
  unregisterOp(SelectionKey.OP_WRITE);
  scheduled.set(false);
  if (writeQueue.isEmpty() && urgentWriteQueue.isEmpty()) {
    return;
  }
  if (!scheduled.compareAndSet(false,true)) {
    return;
  }
  ioSelector.addTask(this);
}

Fixed version (ground truth):
/** 
 * Tries to unschedule this WriteHandler. <p/> It will only be unscheduled if: - the outputBuffer is empty - there are no pending packets. <p/> If the outputBuffer is dirty then it will register itself for an OP_WRITE since we are interested in knowing if there is more space in the socket output buffer. If the outputBuffer is not dirty, then it will unregister itself from an OP_WRITE since it isn't interested in space in the socket outputBuffer. <p/> This call is only made by the IO thread.
 */
private void unschedule(){
  if (dirtyOutputBuffer() || currentPacket != null) {
    registerOp(SelectionKey.OP_WRITE);
    return;
  }
  unregisterOp(SelectionKey.OP_WRITE);
  scheduled.set(false);
  if (writeQueue.isEmpty() && urgentWriteQueue.isEmpty()) {
    return;
  }
  if (!scheduled.compareAndSet(false,true)) {
    return;
  }
  ioSelector.addTask(this);
}
Program: 47401
Project: 47401
Buggy source:
TcpIpConnection assignSocketChannel(SocketChannelWrapper channel,Address endpoint){
  InetSocketAddress remoteSocketAddress=(InetSocketAddress)channel.socket().getRemoteSocketAddress();
  int index=nextSelectorIndex();
  final TcpIpConnection connection=new TcpIpConnection(this,inSelectors[index],outSelectors[index],connectionIdGen.incrementAndGet(),channel);
  ioBalancer.connectionAdded(connection);
  connection.setEndPoint(endpoint);
  activeConnections.add(connection);
  acceptedSockets.remove(channel);
  connection.start();
  log(Level.INFO,"String_Node_Str" + channel.socket().getLocalSocketAddress());
  return connection;
}

Fixed version (ground truth):
TcpIpConnection assignSocketChannel(SocketChannelWrapper channel,Address endpoint){
  int index=nextSelectorIndex();
  final TcpIpConnection connection=new TcpIpConnection(this,inSelectors[index],outSelectors[index],connectionIdGen.incrementAndGet(),channel);
  ioBalancer.connectionAdded(connection);
  connection.setEndPoint(endpoint);
  activeConnections.add(connection);
  acceptedSockets.remove(channel);
  connection.start();
  log(Level.INFO,"String_Node_Str" + channel.socket().getLocalSocketAddress());
  return connection;
}
Program: 47402
Project: 47402
Buggy source:
@Test public void createCache_WhenCacheConfigIsNull(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=Caching.getCachingProvider().getCacheManager();
  try {
    cacheManager.createCache(cacheName,null);
    fail("String_Node_Str");
  }
 catch (  NullPointerException expected) {
    EmptyStatement.ignore(expected);
  }
}

Fixed version (ground truth):
@Test public void createCache_WhenCacheConfigIsNull(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=Caching.getCachingProvider().getCacheManager();
  try {
    cacheManager.createCache(cacheName,(Configuration<Object,Object>)null);
    fail("String_Node_Str");
  }
 catch (  NullPointerException expected) {
    EmptyStatement.ignore(expected);
  }
}
Program: 47403
Project: 47403
Buggy source:
@Test public void createCache_WhenCacheConfigIsNull(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=Caching.getCachingProvider().getCacheManager();
  try {
    cacheManager.createCache(cacheName,null);
    fail("String_Node_Str");
  }
 catch (  NullPointerException expected) {
  }
}

Fixed version (ground truth):
@Test public void createCache_WhenCacheConfigIsNull(){
  String cacheName="String_Node_Str";
  CacheManager cacheManager=Caching.getCachingProvider().getCacheManager();
  try {
    cacheManager.createCache(cacheName,null);
    fail("String_Node_Str");
  }
 catch (  NullPointerException expected) {
    EmptyStatement.ignore(expected);
  }
}
Program: 47404
Project: 47404
Buggy source:
private void handleClientMessage(ClientMessage clientMessage) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
  int correlationId=clientMessage.getCorrelationId();
  final ClientInvocation future=deRegisterCallId(correlationId);
  if (future == null) {
    logger.warning("String_Node_Str" + correlationId + "String_Node_Str"+ clientMessage);
    return;
  }
  if (ClientMessageType.EXCEPTION.ordinal() == clientMessage.getMessageType()) {
    ExceptionResultParameters exceptionResultParameters=ExceptionResultParameters.decode(clientMessage);
    Class<?> clazz=Class.forName(exceptionResultParameters.className);
    Throwable exception=(Throwable)clazz.newInstance();
    future.notifyException(exception);
  }
 else {
    future.notify(clientMessage);
  }
}

Fixed version (ground truth):
private void handleClientMessage(ClientMessage clientMessage) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
  int correlationId=clientMessage.getCorrelationId();
  final ClientInvocation future=deRegisterCallId(correlationId);
  if (future == null) {
    logger.warning("String_Node_Str" + correlationId + "String_Node_Str"+ clientMessage);
    return;
  }
  if (ClientMessageType.EXCEPTION.id() == clientMessage.getMessageType()) {
    ExceptionResultParameters exceptionResultParameters=ExceptionResultParameters.decode(clientMessage);
    Class<?> clazz=Class.forName(exceptionResultParameters.className);
    Throwable exception=(Throwable)clazz.newInstance();
    future.notifyException(exception);
  }
 else {
    future.notify(clientMessage);
  }
}
Program: 47405
Project: 47405
Buggy source:
@Override public void authenticate(ClientConnection connection) throws AuthenticationException, IOException {
  final SerializationService ss=client.getSerializationService();
  String uuid="String_Node_Str";
  String ownerUuid="String_Node_Str";
  if (principal != null) {
    uuid=principal.getUuid();
    ownerUuid=principal.getOwnerUuid();
  }
  ClientMessage clientMessage;
  if (credentials instanceof UsernamePasswordCredentials) {
    UsernamePasswordCredentials cr=(UsernamePasswordCredentials)credentials;
    clientMessage=AuthenticationParameters.encode(cr.getUsername(),cr.getPassword(),uuid,ownerUuid,true);
  }
 else {
    Data data=ss.toData(credentials);
    clientMessage=AuthenticationCustomCredentialsParameters.encode(data.toByteArray(),uuid,ownerUuid,true);
  }
  connection.init();
  ClientMessage response;
  final ClientInvocation clientInvocation=new ClientInvocation(client,clientMessage,connection);
  final Future<ClientMessage> future=clientInvocation.invoke();
  try {
    response=ss.toObject(future.get());
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e,IOException.class);
  }
  AuthenticationResultParameters resultParameters=AuthenticationResultParameters.decode(response);
  connection.setRemoteEndpoint(resultParameters.address);
  principal=new ClientPrincipal(resultParameters.uuid,resultParameters.ownerUuid);
}

Fixed version (ground truth):
@Override public void authenticate(ClientConnection connection) throws AuthenticationException, IOException {
  final SerializationService ss=client.getSerializationService();
  String uuid="String_Node_Str";
  String ownerUuid="String_Node_Str";
  if (principal != null) {
    uuid=principal.getUuid();
    ownerUuid=principal.getOwnerUuid();
  }
  ClientMessage clientMessage;
  if (credentials instanceof UsernamePasswordCredentials) {
    UsernamePasswordCredentials cr=(UsernamePasswordCredentials)credentials;
    clientMessage=AuthenticationParameters.encode(cr.getUsername(),cr.getPassword(),uuid,ownerUuid,true);
  }
 else {
    Data data=ss.toData(credentials);
    clientMessage=AuthenticationCustomCredentialsParameters.encode(data.toByteArray(),uuid,ownerUuid,true);
  }
  connection.init();
  ClientMessage response;
  final ClientInvocation clientInvocation=new ClientInvocation(client,clientMessage,connection);
  final Future<ClientMessage> future=clientInvocation.invoke();
  try {
    response=future.get();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e,IOException.class);
  }
  AuthenticationResultParameters resultParameters=AuthenticationResultParameters.decode(response);
  connection.setRemoteEndpoint(resultParameters.address);
  principal=new ClientPrincipal(resultParameters.uuid,resultParameters.ownerUuid);
}
Program: 47406
Project: 47406
Buggy source:
@Override public void destroy(){
  clear();
  closeResources();
  closeListeners();
  onDestroy();
}

Fixed version (ground truth):
@Override public void destroy(){
  clear();
  closeListeners();
  onDestroy();
}
Program: 47408
Project: 47408
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();
  boolean result=eventService.deregisterListener(SERVICE_NAME,name,registrationId);
  Closeable listener=closeableListeners.remove(registrationId);
  if (listener != null) {
    IOUtil.closeResource(listener);
  }
  return result;
}
Program: 47409
Project: 47409
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: 47410
Project: 47410
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: 47411
Project: 47411
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: 47412
Project: 47412
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: 47413
Project: 47413
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();
  boolean result=eventService.deregisterListener(SERVICE_NAME,name,registrationId);
  Closeable listener=closeableListeners.remove(registrationId);
  if (listener != null) {
    IOUtil.closeResource(listener);
  }
  return result;
}
Program: 47414
Project: 47414
Buggy source:
public void addCacheResource(String name,Closeable resource){
  Set<Closeable> cacheResources;
synchronized (resources) {
    cacheResources=resources.get(name);
    if (cacheResources == null) {
      cacheResources=new HashSet<Closeable>();
      resources.put(name,cacheResources);
    }
  }
  cacheResources.add(resource);
}

Fixed version (ground truth):
public void addCacheResource(String name,Closeable resource){
  Set<Closeable> cacheResources=resources.get(name);
  if (cacheResources == null) {
synchronized (resources) {
      cacheResources=resources.get(name);
      if (cacheResources == null) {
        cacheResources=Collections.newSetFromMap(new ConcurrentHashMap<Closeable,Boolean>());
        resources.put(name,cacheResources);
      }
    }
  }
  cacheResources.add(resource);
}
Program: 47415
Project: 47415
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: 47416
Project: 47416
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: 47417
Project: 47417
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: 47418
Project: 47418
Buggy source:
@Override public void destroy(){
  clear();
  closeResources();
  closeListeners();
}

Fixed version (ground truth):
@Override public void destroy(){
  clear();
  closeListeners();
}
Program: 47420
Project: 47420
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: 47421
Project: 47421
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: 47422
Project: 47422
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: 47423
Project: 47423
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: 47424
Project: 47424
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: 47425
Project: 47425
Buggy source:
@Override public void destroy(){
  clear();
  closeResources();
  closeListeners();
}

Fixed version (ground truth):
@Override public void destroy(){
  clear();
  closeListeners();
}