nus-yam/ex-repair huggingface dataset:
Program: 46058
Project: 46058
Buggy source:
@Test public void testPutAsyncOperationSuccessfulWhenQuorumSizeMet() throws Exception {
  Future<Object> foo=map1.putAsync("String_Node_Str","String_Node_Str");
  foo.get();
}

Fixed version (ground truth):
@Test public void testPutAsyncOperationSuccessfulWhenQuorumSizeMet() throws Exception {
  Future<Object> future=map1.putAsync("String_Node_Str","String_Node_Str");
  future.get();
}
Program: 46059
Project: 46059
Buggy source:
@Test(expected=ExecutionException.class) public void testRemoveAsyncOperationThrowsExceptionWhenQuorumSizeNotMet() throws Exception {
  Future<Object> foo=map4.removeAsync("String_Node_Str");
  foo.get();
}

Fixed version (ground truth):
@Test(expected=ExecutionException.class) public void testRemoveAsyncOperationThrowsExceptionWhenQuorumSizeNotMet() throws Exception {
  Future<Object> future=map4.removeAsync("String_Node_Str");
  future.get();
}
Program: 46060
Project: 46060
Buggy source:
@Test(expected=ExecutionException.class) public void testSubmitToKeyOperationThrowsExceptionWhenQuorumSizeNotMet() throws Exception {
  Future foo=map4.submitToKey("String_Node_Str",new TestLoggingEntryProcessor());
  foo.get();
}

Fixed version (ground truth):
@Test(expected=ExecutionException.class) public void testSubmitToKeyOperationThrowsExceptionWhenQuorumSizeNotMet() throws Exception {
  Future future=map4.submitToKey("String_Node_Str",new TestLoggingEntryProcessor());
  future.get();
}
Program: 46061
Project: 46061
Buggy source:
private static void initializeCaches(){
  cachingProvider1=HazelcastClientCachingProvider.createCachingProvider(c1);
  cachingProvider2=HazelcastClientCachingProvider.createCachingProvider(c2);
  cachingProvider3=HazelcastClientCachingProvider.createCachingProvider(c3);
  cachingProvider4=HazelcastClientCachingProvider.createCachingProvider(c4);
  cachingProvider5=HazelcastClientCachingProvider.createCachingProvider(c5);
  String cacheName=CACHE_NAME_PREFIX + randomString();
  cache1=(ICache)cachingProvider1.getCacheManager().getCache(cacheName);
  cache2=(ICache)cachingProvider2.getCacheManager().getCache(cacheName);
  cache3=(ICache)cachingProvider3.getCacheManager().getCache(cacheName);
  cache4=(ICache)cachingProvider4.getCacheManager().getCache(cacheName);
  cache5=(ICache)cachingProvider5.getCacheManager().getCache(cacheName);
}

Fixed version (ground truth):
private static void initializeCaches(){
  HazelcastClientCachingProvider cachingProvider1=HazelcastClientCachingProvider.createCachingProvider(c1);
  HazelcastClientCachingProvider cachingProvider2=HazelcastClientCachingProvider.createCachingProvider(c2);
  HazelcastClientCachingProvider cachingProvider3=HazelcastClientCachingProvider.createCachingProvider(c3);
  HazelcastClientCachingProvider cachingProvider4=HazelcastClientCachingProvider.createCachingProvider(c4);
  HazelcastClientCachingProvider cachingProvider5=HazelcastClientCachingProvider.createCachingProvider(c5);
  String cacheName=CACHE_NAME_PREFIX + randomString();
  cache1=(ICache<Integer,String>)cachingProvider1.getCacheManager().<Integer,String>getCache(cacheName);
  cache2=(ICache<Integer,String>)cachingProvider2.getCacheManager().<Integer,String>getCache(cacheName);
  cache3=(ICache<Integer,String>)cachingProvider3.getCacheManager().<Integer,String>getCache(cacheName);
  cache4=(ICache<Integer,String>)cachingProvider4.getCacheManager().<Integer,String>getCache(cacheName);
  cache5=(ICache<Integer,String>)cachingProvider5.getCacheManager().<Integer,String>getCache(cacheName);
}
Program: 46062
Project: 46062
Buggy source:
@Test(expected=ExecutionException.class) public void testGetAsyncOperationThrowsExceptionWhenQuorumSizeNotMet() throws Exception {
  Future<String> foo=cache4.getAsync(1);
  foo.get();
}

Fixed version (ground truth):
@Test(expected=ExecutionException.class) public void testGetAsyncOperationThrowsExceptionWhenQuorumSizeNotMet() throws Exception {
  Future<String> future=cache4.getAsync(1);
  future.get();
}
Program: 46063
Project: 46063
Buggy source:
@Test public void testGetAsyncOperationSuccessfulWhenQuorumSizeMet() throws Exception {
  Future<String> foo=cache1.getAsync(1);
  foo.get();
}

Fixed version (ground truth):
@Test public void testGetAsyncOperationSuccessfulWhenQuorumSizeMet() throws Exception {
  Future<String> future=cache1.getAsync(1);
  future.get();
}
Program: 46064
Project: 46064
Buggy source:
@BeforeClass public static void initialize() throws Exception {
  QuorumConfig quorumConfig=new QuorumConfig();
  quorumConfig.setName(QUORUM_ID);
  quorumConfig.setType(QuorumType.READ);
  quorumConfig.setEnabled(true);
  quorumConfig.setSize(3);
  CacheSimpleConfig cacheConfig=new CacheSimpleConfig();
  cacheConfig.setName(CACHE_NAME_PREFIX + "String_Node_Str");
  cacheConfig.setQuorumName(QUORUM_ID);
  factory=new TestHazelcastFactory();
  cluster=new PartitionedCluster(factory).createFiveMemberCluster(cacheConfig,quorumConfig);
  initializeClients();
  initializeCaches();
  cluster.splitFiveMembersThreeAndTwo();
  verifyClients();
}

Fixed version (ground truth):
@BeforeClass public static void initialize(){
  QuorumConfig quorumConfig=new QuorumConfig();
  quorumConfig.setName(QUORUM_ID);
  quorumConfig.setType(QuorumType.READ);
  quorumConfig.setEnabled(true);
  quorumConfig.setSize(3);
  CacheSimpleConfig cacheConfig=new CacheSimpleConfig();
  cacheConfig.setName(CACHE_NAME_PREFIX + "String_Node_Str");
  cacheConfig.setQuorumName(QUORUM_ID);
  factory=new TestHazelcastFactory();
  cluster=new PartitionedCluster(factory).createFiveMemberCluster(cacheConfig,quorumConfig);
  initializeClients();
  initializeCaches();
  cluster.splitFiveMembersThreeAndTwo();
  verifyClients();
}
Program: 46065
Project: 46065
Buggy source:
@Test public void testLifecycleListener_registeredViaClassName(){
  assertTrue(StaticListener.calledAtLeastOnce);
}

Fixed version (ground truth):
@Test public void testLifecycleListener_registeredViaClassName(){
  assertTrue(StaticListener.CALLED_AT_LEAST_ONCE.get());
}
Program: 46066
Project: 46066
Buggy source:
@Override public void stateChanged(LifecycleEvent event){
  calledAtLeastOnce=true;
}

Fixed version (ground truth):
@Override public void stateChanged(LifecycleEvent event){
  CALLED_AT_LEAST_ONCE.set(true);
}
Program: 46067
Project: 46067
Buggy source:
@Test(timeout=120000) public void testPresharedAttributes() throws Exception {
  Config c=new Config();
  JoinConfig join=c.getNetworkConfig().getJoin();
  join.getTcpIpConfig().addMember("String_Node_Str").setEnabled(true);
  join.getMulticastConfig().setEnabled(false);
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  HazelcastInstance h1=hazelcastFactory.newHazelcastInstance(c);
  Member m1=h1.getCluster().getLocalMember();
  m1.setIntAttribute("String_Node_Str",123);
  HazelcastInstance h2=hazelcastFactory.newHazelcastInstance(c);
  assertClusterSize(2,h2);
  Member member=null;
  for (  Member m : h2.getCluster().getMembers()) {
    if (m == h2.getCluster().getLocalMember()) {
      continue;
    }
    member=m;
  }
  assertNotNull(member);
  assertEquals(m1,member);
  assertNotNull(member.getIntAttribute("String_Node_Str"));
  assertEquals(123,(int)member.getIntAttribute("String_Node_Str"));
  boolean found=false;
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  Collection<Member> members=client.getCluster().getMembers();
  for (  Member m : members) {
    if (m.equals(m1)) {
      assertEquals(123,(int)m.getIntAttribute("String_Node_Str"));
      found=true;
    }
  }
  assertTrue(found);
}

Fixed version (ground truth):
@Test(timeout=120000) public void testPresharedAttributes() throws Exception {
  Config c=new Config();
  JoinConfig join=c.getNetworkConfig().getJoin();
  join.getTcpIpConfig().addMember("String_Node_Str").setEnabled(true);
  join.getMulticastConfig().setEnabled(false);
  HazelcastInstance h1=hazelcastFactory.newHazelcastInstance(c);
  Member m1=h1.getCluster().getLocalMember();
  m1.setIntAttribute("String_Node_Str",123);
  HazelcastInstance h2=hazelcastFactory.newHazelcastInstance(c);
  assertClusterSize(2,h2);
  Member member=null;
  for (  Member m : h2.getCluster().getMembers()) {
    if (m == h2.getCluster().getLocalMember()) {
      continue;
    }
    member=m;
  }
  assertNotNull(member);
  assertEquals(m1,member);
  assertNotNull(member.getIntAttribute("String_Node_Str"));
  assertEquals(123,(int)member.getIntAttribute("String_Node_Str"));
  boolean found=false;
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  Collection<Member> members=client.getCluster().getMembers();
  for (  Member m : members) {
    if (m.equals(m1)) {
      assertEquals(123,(int)m.getIntAttribute("String_Node_Str"));
      found=true;
    }
  }
  assertTrue(found);
}
Program: 46068
Project: 46068
Buggy source:
@Test(timeout=120000) public void testMemberAddedWithListeners_thenCheckOperationsNotHanging() throws Exception {
  hazelcastFactory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.setProperty(ClientExecutionServiceImpl.INTERNAL_EXECUTOR_POOL_SIZE.getName(),"String_Node_Str");
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  IMap map=client.getMap("String_Node_Str");
  map.addEntryListener(mock(MapListener.class),true);
  HazelcastInstance h2=hazelcastFactory.newHazelcastInstance();
  String key=generateKeyOwnedBy(h2);
  map.get(key);
}

Fixed version (ground truth):
@Test(timeout=120000) public void testMemberAddedWithListeners_thenCheckOperationsNotHanging(){
  hazelcastFactory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.setProperty(ClientExecutionServiceImpl.INTERNAL_EXECUTOR_POOL_SIZE.getName(),"String_Node_Str");
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  IMap map=client.getMap("String_Node_Str");
  map.addEntryListener(mock(MapListener.class),true);
  HazelcastInstance h2=hazelcastFactory.newHazelcastInstance();
  String key=generateKeyOwnedBy(h2);
  map.get(key);
}
Program: 46069
Project: 46069
Buggy source:
@Test public void testInterceptor() throws InterruptedException {
  final HazelcastInstance instance=hazelcastFactory.newHazelcastInstance();
  final HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final IMap<Object,Object> map=client.getMap("String_Node_Str");
  final MapInterceptorImpl interceptor=new MapInterceptorImpl();
  final String id=map.addInterceptor(interceptor);
  assertNotNull(id);
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertFalse(map.replace("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertTrue(map.replace("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.remove("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testInterceptor(){
  hazelcastFactory.newHazelcastInstance();
  final HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final IMap<Object,Object> map=client.getMap("String_Node_Str");
  final MapInterceptorImpl interceptor=new MapInterceptorImpl();
  final String id=map.addInterceptor(interceptor);
  assertNotNull(id);
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertFalse(map.replace("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertTrue(map.replace("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  map.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",map.get("String_Node_Str"));
  assertEquals("String_Node_Str",map.remove("String_Node_Str"));
}
Program: 46070
Project: 46070
Buggy source:
public void testListenerReconnect() throws InterruptedException {
  final HazelcastInstance instance1=hazelcastFactory.newHazelcastInstance();
  final HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final CountDownLatch latch=new CountDownLatch(2);
  final IMap<Object,Object> m=client.getMap("String_Node_Str");
  final String id=m.addEntryListener(new EntryAdapter(){
    public void entryAdded(    EntryEvent event){
      latch.countDown();
    }
    @Override public void entryUpdated(    EntryEvent event){
      latch.countDown();
    }
  }
,true);
  m.put("String_Node_Str","String_Node_Str");
  final HazelcastInstance instance2=hazelcastFactory.newHazelcastInstance();
  instance1.shutdown();
  final Thread thread=new Thread(){
    @Override public void run(){
      while (!isInterrupted()) {
        m.put("String_Node_Str","String_Node_Str");
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException ignored) {
        }
      }
    }
  }
;
  thread.start();
  assertOpenEventually(latch,10);
  thread.interrupt();
  assertTrue(m.removeEntryListener(id));
  assertFalse(m.removeEntryListener("String_Node_Str"));
}

Fixed version (ground truth):
public void testListenerReconnect(){
  final HazelcastInstance instance=hazelcastFactory.newHazelcastInstance();
  final HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  final CountDownLatch latch=new CountDownLatch(2);
  final IMap<Object,Object> m=client.getMap("String_Node_Str");
  final String id=m.addEntryListener(new EntryAdapter(){
    public void entryAdded(    EntryEvent event){
      latch.countDown();
    }
    @Override public void entryUpdated(    EntryEvent event){
      latch.countDown();
    }
  }
,true);
  m.put("String_Node_Str","String_Node_Str");
  hazelcastFactory.newHazelcastInstance();
  instance.shutdown();
  final Thread thread=new Thread(){
    @Override public void run(){
      while (!isInterrupted()) {
        m.put("String_Node_Str","String_Node_Str");
        try {
          Thread.sleep(100);
        }
 catch (        InterruptedException ignored) {
        }
      }
    }
  }
;
  thread.start();
  assertOpenEventually(latch,10);
  thread.interrupt();
  assertJoinable(thread);
  assertTrue(m.removeEntryListener(id));
  assertFalse(m.removeEntryListener("String_Node_Str"));
}
Program: 46071
Project: 46071
Buggy source:
@Test public void testMapDestroyIssue764() throws Exception {
  HazelcastInstance server=hazelcastFactory.newHazelcastInstance();
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  assertNoOfDistributedObject("String_Node_Str",0,server.getDistributedObjects());
  assertNoOfDistributedObject("String_Node_Str",0,client.getDistributedObjects());
  IMap map=client.getMap("String_Node_Str");
  assertNoOfDistributedObject("String_Node_Str",1,server.getDistributedObjects());
  assertNoOfDistributedObject("String_Node_Str",1,client.getDistributedObjects());
  map.destroy();
  Collection<DistributedObject> serverDistributedObjects=server.getDistributedObjects();
  Collection<DistributedObject> clientDistributedObjects=client.getDistributedObjects();
  assertNoOfDistributedObject("String_Node_Str",0,serverDistributedObjects);
  assertNoOfDistributedObject("String_Node_Str",0,clientDistributedObjects);
}

Fixed version (ground truth):
@Test public void testMapDestroyIssue764(){
  HazelcastInstance server=hazelcastFactory.newHazelcastInstance();
  HazelcastInstance client=hazelcastFactory.newHazelcastClient();
  assertNoOfDistributedObject("String_Node_Str",0,server.getDistributedObjects());
  assertNoOfDistributedObject("String_Node_Str",0,client.getDistributedObjects());
  IMap map=client.getMap("String_Node_Str");
  assertNoOfDistributedObject("String_Node_Str",1,server.getDistributedObjects());
  assertNoOfDistributedObject("String_Node_Str",1,client.getDistributedObjects());
  map.destroy();
  Collection<DistributedObject> serverDistributedObjects=server.getDistributedObjects();
  Collection<DistributedObject> clientDistributedObjects=client.getDistributedObjects();
  assertNoOfDistributedObject("String_Node_Str",0,serverDistributedObjects);
  assertNoOfDistributedObject("String_Node_Str",0,clientDistributedObjects);
}
Program: 46072
Project: 46072
Buggy source:
@Test(timeout=60000) public void testOperationRedo() throws Exception {
  final HazelcastInstance hz1=hazelcastFactory.newHazelcastInstance();
  hazelcastFactory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setRedoOperation(true);
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  final Thread thread=new Thread(){
    public void run(){
      try {
        Thread.sleep(100);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      hz1.getLifecycleService().shutdown();
    }
  }
;
  final IMap map=client.getMap("String_Node_Str");
  thread.start();
  int expected=1000;
  for (int i=0; i < expected; i++) {
    map.put(i,"String_Node_Str" + i);
  }
  thread.join();
  assertEquals(expected,map.size());
}

Fixed version (ground truth):
@Test(timeout=60000) public void testOperationRedo(){
  final HazelcastInstance hz1=hazelcastFactory.newHazelcastInstance();
  hazelcastFactory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setRedoOperation(true);
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  final Thread thread=new Thread(){
    public void run(){
      try {
        Thread.sleep(100);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      hz1.getLifecycleService().shutdown();
    }
  }
;
  final IMap<Integer,String> map=client.getMap("String_Node_Str");
  thread.start();
  int expected=1000;
  for (int i=0; i < expected; i++) {
    map.put(i,"String_Node_Str" + i);
  }
  assertJoinable(thread);
  assertEquals(expected,map.size());
}
Program: 46073
Project: 46073
Buggy source:
@Test public void testOperationRedo_smartRoutingDisabled() throws Exception {
  final HazelcastInstance hz1=hazelcastFactory.newHazelcastInstance();
  hazelcastFactory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.setRedoOperation(true);
  clientConfig.setSmartRouting(false);
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  final Thread thread=new Thread(){
    public void run(){
      try {
        Thread.sleep(10);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      hz1.getLifecycleService().shutdown();
    }
  }
;
  final IMap map=client.getMap("String_Node_Str");
  thread.start();
  int expected=1000;
  for (int i=0; i < expected; i++) {
    map.put(i,i);
  }
  thread.join();
  assertEquals(expected,map.size());
}

Fixed version (ground truth):
@Test public void testOperationRedo_smartRoutingDisabled(){
  final HazelcastInstance hz1=hazelcastFactory.newHazelcastInstance();
  hazelcastFactory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.setRedoOperation(true);
  clientConfig.setSmartRouting(false);
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  final Thread thread=new Thread(){
    public void run(){
      try {
        Thread.sleep(10);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
      hz1.getLifecycleService().shutdown();
    }
  }
;
  final IMap<Integer,Integer> map=client.getMap("String_Node_Str");
  thread.start();
  int expected=1000;
  for (int i=0; i < expected; i++) {
    map.put(i,i);
  }
  assertJoinable(thread);
  assertEquals(expected,map.size());
}
Program: 46074
Project: 46074
Buggy source:
@Category(NightlyTest.class) @Test public void testLock_WhenSmartClientAndOwnerNodeDiesTogether() throws InterruptedException {
  testLock_WhenClientAndOwnerNodeDiesTogether(true);
}

Fixed version (ground truth):
@Category(NightlyTest.class) @Test public void testLock_WhenSmartClientAndOwnerNodeDiesTogether() throws Exception {
  testLock_WhenClientAndOwnerNodeDiesTogether(true);
}
Program: 46075
Project: 46075
Buggy source:
/** 
 * Test for issues #267 and #493
 */
@Test public void testIssue493() throws Exception {
  final HazelcastInstance hz1=hazelcastFactory.newHazelcastInstance();
  hazelcastFactory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setRedoOperation(true);
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  final ILock lock=client.getLock("String_Node_Str");
  for (int k=0; k < 10; k++) {
    lock.lock();
    try {
      Thread.sleep(100);
    }
  finally {
      lock.unlock();
    }
  }
  lock.lock();
  hz1.shutdown();
  lock.unlock();
}

Fixed version (ground truth):
/** 
 * Test for issues #267 and #493
 */
@Test public void testIssue493(){
  final HazelcastInstance hz1=hazelcastFactory.newHazelcastInstance();
  hazelcastFactory.newHazelcastInstance();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setRedoOperation(true);
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  final ILock lock=client.getLock("String_Node_Str");
  for (int k=0; k < 10; k++) {
    lock.lock();
    try {
      sleepMillis(100);
    }
  finally {
      lock.unlock();
    }
  }
  lock.lock();
  hz1.shutdown();
  lock.unlock();
}
Program: 46076
Project: 46076
Buggy source:
private void testLock_WhenClientAndOwnerNodeDiesTogether(boolean smart) throws InterruptedException {
  hazelcastFactory.newHazelcastInstance();
  final ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(smart);
  final int tryCount=5;
  for (int i=0; i < tryCount; i++) {
    final HazelcastInstance instance=hazelcastFactory.newHazelcastInstance();
    final HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
    final ILock lock=client.getLock("String_Node_Str");
    assertTrue(lock.tryLock(1,TimeUnit.MINUTES));
    client.getLifecycleService().terminate();
    instance.getLifecycleService().terminate();
  }
}

Fixed version (ground truth):
private void testLock_WhenClientAndOwnerNodeDiesTogether(boolean smart) throws Exception {
  hazelcastFactory.newHazelcastInstance();
  final ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setSmartRouting(smart);
  final int tryCount=5;
  for (int i=0; i < tryCount; i++) {
    final HazelcastInstance instance=hazelcastFactory.newHazelcastInstance();
    final HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
    final ILock lock=client.getLock("String_Node_Str");
    assertTrue(lock.tryLock(1,TimeUnit.MINUTES));
    client.getLifecycleService().terminate();
    instance.getLifecycleService().terminate();
  }
}
Program: 46077
Project: 46077
Buggy source:
@Test public void testCredentials(){
  final Config config=new Config();
  config.getGroupConfig().setName("String_Node_Str").setPassword("String_Node_Str");
  final HazelcastInstance instance=hazelcastFactory.newHazelcastInstance(config);
  final ClientConfig clientConfig=new ClientConfig();
  final ClientSecurityConfig securityConfig=clientConfig.getSecurityConfig();
  securityConfig.setCredentialsClassname(MyCredentials.class.getName());
  final HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
}

Fixed version (ground truth):
@Test public void testCredentials(){
  final Config config=new Config();
  config.getGroupConfig().setName("String_Node_Str").setPassword("String_Node_Str");
  hazelcastFactory.newHazelcastInstance(config);
  final ClientConfig clientConfig=new ClientConfig();
  final ClientSecurityConfig securityConfig=clientConfig.getSecurityConfig();
  securityConfig.setCredentialsClassname(MyCredentials.class.getName());
  hazelcastFactory.newHazelcastClient(clientConfig);
}
Program: 46078
Project: 46078
Buggy source:
@Category(NightlyTest.class) @Test public void testLock_WhenDummyClientAndOwnerNodeDiesTogether() throws InterruptedException {
  testLock_WhenClientAndOwnerNodeDiesTogether(false);
}

Fixed version (ground truth):
@Category(NightlyTest.class) @Test public void testLock_WhenDummyClientAndOwnerNodeDiesTogether() throws Exception {
  testLock_WhenClientAndOwnerNodeDiesTogether(false);
}
Program: 46079
Project: 46079
Buggy source:
@Test public void testClientReconnect_thenCheckRequestsAreRetriedWithoutException() throws Exception {
  final HazelcastInstance hazelcastInstance=hazelcastFactory.newHazelcastInstance();
  final CountDownLatch clientStartedDoingRequests=new CountDownLatch(1);
  new Thread(new Runnable(){
    @Override public void run(){
      try {
        clientStartedDoingRequests.await();
      }
 catch (      InterruptedException ignored) {
      }
      hazelcastInstance.shutdown();
      hazelcastFactory.newHazelcastInstance();
    }
  }
).start();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setRedoOperation(true);
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  clientConfig.setProperty(ClientProperty.INVOCATION_TIMEOUT_SECONDS.getName(),String.valueOf(Integer.MAX_VALUE));
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  IMap<Object,Object> map=client.getMap(randomMapName());
  int mapSize=1000;
  for (int i=0; i < mapSize; i++) {
    if (i == mapSize / 4) {
      clientStartedDoingRequests.countDown();
    }
    try {
      map.put(i,i);
    }
 catch (    Exception e) {
      assertTrue("String_Node_Str" + i,false);
    }
  }
}

Fixed version (ground truth):
@Test public void testClientReconnect_thenCheckRequestsAreRetriedWithoutException(){
  final HazelcastInstance hazelcastInstance=hazelcastFactory.newHazelcastInstance();
  final CountDownLatch clientStartedDoingRequests=new CountDownLatch(1);
  new Thread(new Runnable(){
    @Override public void run(){
      try {
        clientStartedDoingRequests.await();
      }
 catch (      InterruptedException ignored) {
      }
      hazelcastInstance.shutdown();
      hazelcastFactory.newHazelcastInstance();
    }
  }
).start();
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getNetworkConfig().setRedoOperation(true);
  clientConfig.getNetworkConfig().setConnectionAttemptLimit(Integer.MAX_VALUE);
  clientConfig.setProperty(ClientProperty.INVOCATION_TIMEOUT_SECONDS.getName(),String.valueOf(Integer.MAX_VALUE));
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  IMap<Object,Object> map=client.getMap(randomMapName());
  int mapSize=1000;
  for (int i=0; i < mapSize; i++) {
    if (i == mapSize / 4) {
      clientStartedDoingRequests.countDown();
    }
    try {
      map.put(i,i);
    }
 catch (    Exception e) {
      assertTrue("String_Node_Str" + i,false);
    }
  }
}
Program: 46081
Project: 46081
Buggy source:
@Test public void testClientPortConnection(){
  final Config config1=new Config();
  config1.getGroupConfig().setName("String_Node_Str");
  config1.getNetworkConfig().setPort(5701);
  final HazelcastInstance instance1=Hazelcast.newHazelcastInstance(config1);
  instance1.getMap("String_Node_Str").put("String_Node_Str","String_Node_Str");
  final Config config2=new Config();
  config2.getGroupConfig().setName("String_Node_Str");
  config2.getNetworkConfig().setPort(5702);
  HazelcastInstance instance2=Hazelcast.newHazelcastInstance(config2);
  final ClientConfig clientConfig=new ClientConfig();
  clientConfig.getGroupConfig().setName("String_Node_Str");
  final HazelcastInstance client=HazelcastClient.newHazelcastClient(clientConfig);
  final IMap<Object,Object> map=client.getMap("String_Node_Str");
  assertNull(map.put("String_Node_Str","String_Node_Str"));
  assertEquals(1,map.size());
}

Fixed version (ground truth):
@Test public void testClientPortConnection(){
  final Config config1=new Config();
  config1.getGroupConfig().setName("String_Node_Str");
  config1.getNetworkConfig().setPort(5701);
  final HazelcastInstance instance1=Hazelcast.newHazelcastInstance(config1);
  instance1.getMap("String_Node_Str").put("String_Node_Str","String_Node_Str");
  final Config config2=new Config();
  config2.getGroupConfig().setName("String_Node_Str");
  config2.getNetworkConfig().setPort(5702);
  Hazelcast.newHazelcastInstance(config2);
  final ClientConfig clientConfig=new ClientConfig();
  clientConfig.getGroupConfig().setName("String_Node_Str");
  final HazelcastInstance client=HazelcastClient.newHazelcastClient(clientConfig);
  final IMap<Object,Object> map=client.getMap("String_Node_Str");
  assertNull(map.put("String_Node_Str","String_Node_Str"));
  assertEquals(1,map.size());
}
Program: 46082
Project: 46082
Buggy source:
@Test public void testClientConnectionBeforeServerReady() throws InterruptedException {
  ExecutorService executorService=Executors.newFixedThreadPool(2);
  executorService.submit(new Runnable(){
    @Override public void run(){
      Hazelcast.newHazelcastInstance();
    }
  }
);
  final CountDownLatch clientLatch=new CountDownLatch(1);
  executorService.submit(new Runnable(){
    @Override public void run(){
      ClientConfig config=new ClientConfig();
      config.getNetworkConfig().setConnectionAttemptLimit(10);
      HazelcastInstance client=HazelcastClient.newHazelcastClient(config);
      clientLatch.countDown();
    }
  }
);
  assertOpenEventually(clientLatch);
}

Fixed version (ground truth):
@Test public void testClientConnectionBeforeServerReady() throws InterruptedException {
  ExecutorService executorService=Executors.newFixedThreadPool(2);
  executorService.submit(new Runnable(){
    @Override public void run(){
      Hazelcast.newHazelcastInstance();
    }
  }
);
  final CountDownLatch clientLatch=new CountDownLatch(1);
  executorService.submit(new Runnable(){
    @Override public void run(){
      ClientConfig config=new ClientConfig();
      config.getNetworkConfig().setConnectionAttemptLimit(10);
      HazelcastClient.newHazelcastClient(config);
      clientLatch.countDown();
    }
  }
);
  assertOpenEventually(clientLatch);
}
Program: 46083
Project: 46083
Buggy source:
@Override public void run(){
  ClientConfig config=new ClientConfig();
  config.getNetworkConfig().setConnectionAttemptLimit(10);
  HazelcastInstance client=HazelcastClient.newHazelcastClient(config);
  clientLatch.countDown();
}

Fixed version (ground truth):
@Override public void run(){
  ClientConfig config=new ClientConfig();
  config.getNetworkConfig().setConnectionAttemptLimit(10);
  HazelcastClient.newHazelcastClient(config);
  clientLatch.countDown();
}
Program: 46084
Project: 46084
Buggy source:
@Test(timeout=20000,expected=IllegalStateException.class) public void testTimeoutToOutsideNetwork() throws Exception {
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getGroupConfig().setName("String_Node_Str").setPassword("String_Node_Str");
  clientConfig.getNetworkConfig().addAddress("String_Node_Str");
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  IList<Object> list=client.getList("String_Node_Str");
}

Fixed version (ground truth):
@Test(timeout=20000,expected=IllegalStateException.class) public void testTimeoutToOutsideNetwork() throws Exception {
  ClientConfig clientConfig=new ClientConfig();
  clientConfig.getGroupConfig().setName("String_Node_Str").setPassword("String_Node_Str");
  clientConfig.getNetworkConfig().addAddress("String_Node_Str");
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(clientConfig);
  client.getList("String_Node_Str");
}
Program: 46086
Project: 46086
Buggy source:
protected void testLoggingWithConfiguration(boolean programmaticConfiguration) throws IOException {
  hazelcastFactory=new TestHazelcastFactory();
  Config cg=new Config();
  cg.setProperty("String_Node_Str","String_Node_Str");
  hazelcastFactory.newHazelcastInstance(cg);
  ClientConfig config=new ClientConfig();
  if (programmaticConfiguration) {
    config.setProperty("String_Node_Str","String_Node_Str");
  }
 else {
    System.setProperty("String_Node_Str","String_Node_Str");
  }
  client=hazelcastFactory.newHazelcastClient(config);
  ILogger clientLogger=client.getLoggingService().getLogger("String_Node_Str");
  ILogger actualLogger=(ILogger)getFromField(clientLogger,"String_Node_Str");
  Class<?> clientLoggerClass=actualLogger.getClass();
  ILogger expectedLogger=new Log4j2Factory().getLogger("String_Node_Str");
  Class<?> expectedLoggerClass=expectedLogger.getClass();
  assertSame(expectedLoggerClass,clientLoggerClass);
}

Fixed version (ground truth):
protected void testLoggingWithConfiguration(boolean programmaticConfiguration) throws IOException {
  hazelcastFactory=new TestHazelcastFactory();
  Config cg=new Config();
  cg.setProperty("String_Node_Str","String_Node_Str");
  hazelcastFactory.newHazelcastInstance(cg);
  ClientConfig config=new ClientConfig();
  if (programmaticConfiguration) {
    config.setProperty("String_Node_Str","String_Node_Str");
  }
 else {
    System.setProperty("String_Node_Str","String_Node_Str");
  }
  HazelcastInstance client=hazelcastFactory.newHazelcastClient(config);
  ILogger clientLogger=client.getLoggingService().getLogger("String_Node_Str");
  ILogger actualLogger=(ILogger)getFromField(clientLogger,"String_Node_Str");
  Class<?> clientLoggerClass=actualLogger.getClass();
  ILogger expectedLogger=new Log4j2Factory().getLogger("String_Node_Str");
  Class<?> expectedLoggerClass=expectedLogger.getClass();
  assertSame(expectedLoggerClass,clientLoggerClass);
}
Program: 46087
Project: 46087
Buggy source:
@Before public void init(){
  Config config=new Config();
  config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
  config.getNetworkConfig().setPort(5701);
  config.getGroupConfig().setName("String_Node_Str");
  config.getGroupConfig().setPassword("String_Node_Str");
  final HazelcastInstance hz1=Hazelcast.newHazelcastInstance(config);
  Config config2=new Config();
  config2.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
  config2.getNetworkConfig().setPort(5702);
  config2.getGroupConfig().setName("String_Node_Str");
  config2.getGroupConfig().setPassword("String_Node_Str");
  final HazelcastInstance hz2=Hazelcast.newHazelcastInstance(config2);
}

Fixed version (ground truth):
@Before public void init(){
  Config config=new Config();
  config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
  config.getNetworkConfig().setPort(5701);
  config.getGroupConfig().setName("String_Node_Str");
  config.getGroupConfig().setPassword("String_Node_Str");
  Hazelcast.newHazelcastInstance(config);
  Config config2=new Config();
  config2.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
  config2.getNetworkConfig().setPort(5702);
  config2.getGroupConfig().setName("String_Node_Str");
  config2.getGroupConfig().setPassword("String_Node_Str");
  Hazelcast.newHazelcastInstance(config2);
}
Program: 46088
Project: 46088
Buggy source:
@Test public void testMultiClusterMultipleClients() throws MalformedURLException, URISyntaxException {
  final String cacheName="String_Node_Str";
  final String key1="String_Node_Str";
  final String valuecm1="String_Node_Str";
  final String valuecm2="String_Node_Str";
  final HazelcastClientCachingProvider cachingProvider=new HazelcastClientCachingProvider();
  final CacheManager cm1=cachingProvider.getCacheManager(uri1,null);
  final CacheManager cm2=cachingProvider.getCacheManager(uri2,null);
  final CacheConfig<String,String> cacheConfig=new CacheConfig<String,String>();
  final Cache<String,String> cache1=cm1.createCache(cacheName,cacheConfig);
  final Cache<String,String> cache2=cm2.createCache(cacheName,cacheConfig);
  cache1.put(key1,valuecm1);
  cache2.put(key1,valuecm2);
  assertEquals(valuecm1,cache1.get(key1));
  assertEquals(valuecm2,cache2.get(key1));
  cachingProvider.close(uri1,null);
  cachingProvider.close(uri2,null);
  final CacheManager cm11=cachingProvider.getCacheManager(uri1,null);
  final Cache<String,String> cache11=cm11.getCache(cacheName);
  assertEquals(valuecm1,cache11.get(key1));
  cm11.close();
}

Fixed version (ground truth):
@Test public void testMultiClusterMultipleClients(){
  final String cacheName="String_Node_Str";
  final String key1="String_Node_Str";
  final String valuecm1="String_Node_Str";
  final String valuecm2="String_Node_Str";
  final HazelcastClientCachingProvider cachingProvider=new HazelcastClientCachingProvider();
  final CacheManager cm1=cachingProvider.getCacheManager(uri1,null);
  final CacheManager cm2=cachingProvider.getCacheManager(uri2,null);
  final CacheConfig<String,String> cacheConfig=new CacheConfig<String,String>();
  final Cache<String,String> cache1=cm1.createCache(cacheName,cacheConfig);
  final Cache<String,String> cache2=cm2.createCache(cacheName,cacheConfig);
  cache1.put(key1,valuecm1);
  cache2.put(key1,valuecm2);
  assertEquals(valuecm1,cache1.get(key1));
  assertEquals(valuecm2,cache2.get(key1));
  cachingProvider.close(uri1,null);
  cachingProvider.close(uri2,null);
  final CacheManager cm11=cachingProvider.getCacheManager(uri1,null);
  final Cache<String,String> cache11=cm11.getCache(cacheName);
  assertEquals(valuecm1,cache11.get(key1));
  cm11.close();
}
Program: 46089
Project: 46089
Buggy source:
protected void testLoadAllNearCacheInvalidation(InMemoryFormat inMemoryFormat) throws Exception {
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  nearCacheConfig.setInvalidateOnChange(true);
  NearCacheTestContext nearCacheTestContext1=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  final NearCacheTestContext nearCacheTestContext2=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  Set<Integer> testKeys=new HashSet<Integer>(DEFAULT_RECORD_COUNT);
  Set<Integer> loadKeys=new HashSet<Integer>(DEFAULT_RECORD_COUNT / 2);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    if (i % 2 == 0) {
      loadKeys.add(i);
    }
    testKeys.add(i);
  }
  for (  int i : testKeys) {
    nearCacheTestContext1.cache.put(i,generateValueFromKey(i));
  }
  final CountDownLatch completed=new CountDownLatch(1);
  nearCacheTestContext1.cache.loadAll(loadKeys,true,new CompletionListener(){
    @Override public void onCompletion(){
      completed.countDown();
    }
    @Override public void onException(    Exception e){
    }
  }
);
  completed.await(3,TimeUnit.SECONDS);
  for (  int i : loadKeys) {
    final int key=i;
    assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        Data keyData=nearCacheTestContext2.serializationService.toData(key);
        assertNull(nearCacheTestContext2.nearCache.get(keyData));
      }
    }
);
  }
}

Fixed version (ground truth):
protected void testLoadAllNearCacheInvalidation(InMemoryFormat inMemoryFormat) throws Exception {
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  nearCacheConfig.setInvalidateOnChange(true);
  NearCacheTestContext nearCacheTestContext1=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  final NearCacheTestContext nearCacheTestContext2=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  Set<Integer> testKeys=new HashSet<Integer>(DEFAULT_RECORD_COUNT);
  Set<Integer> loadKeys=new HashSet<Integer>(DEFAULT_RECORD_COUNT / 2);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    if (i % 2 == 0) {
      loadKeys.add(i);
    }
    testKeys.add(i);
  }
  for (  int i : testKeys) {
    nearCacheTestContext1.cache.put(i,generateValueFromKey(i));
  }
  final CountDownLatch completed=new CountDownLatch(1);
  nearCacheTestContext1.cache.loadAll(loadKeys,true,new CompletionListener(){
    @Override public void onCompletion(){
      completed.countDown();
    }
    @Override public void onException(    Exception e){
    }
  }
);
  assertTrue(completed.await(3,TimeUnit.SECONDS));
  for (  int i : loadKeys) {
    final int key=i;
    assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        Data keyData=nearCacheTestContext2.serializationService.toData(key);
        assertNull(nearCacheTestContext2.nearCache.get(keyData));
      }
    }
);
  }
}
Program: 46090
Project: 46090
Buggy source:
@Test public void cacheEntryListenerCountIncreasedAndDecreasedCorrectly(){
  final CachingProvider provider=getCachingProvider();
  CacheManager cacheManager=provider.getCacheManager();
  CompleteConfiguration<String,String> config=new MutableConfiguration<String,String>().addCacheEntryListenerConfiguration(new MutableCacheEntryListenerConfiguration<String,String>(FactoryBuilder.factoryOf(new TestListener(new AtomicInteger())),null,true,true));
  final Cache<String,String> cache=cacheManager.createCache("String_Node_Str",config);
}

Fixed version (ground truth):
@Test public void cacheEntryListenerCountIncreasedAndDecreasedCorrectly(){
  final CachingProvider provider=getCachingProvider();
  CacheManager cacheManager=provider.getCacheManager();
  CompleteConfiguration<String,String> config=new MutableConfiguration<String,String>().addCacheEntryListenerConfiguration(new MutableCacheEntryListenerConfiguration<String,String>(FactoryBuilder.factoryOf(new TestListener(new AtomicInteger())),null,true,true));
  cacheManager.createCache("String_Node_Str",config);
}
Program: 46092
Project: 46092
Buggy source:
@Override public void write(Cache.Entry<? extends Integer,? extends Integer> entry) throws CacheWriterException {
  Integer value=entry.getValue().intValue();
  if (!isAcceptableValue(value)) {
    throw new CacheWriterException("String_Node_Str" + value);
  }
}

Fixed version (ground truth):
@Override public void write(Cache.Entry<? extends Integer,? extends Integer> entry) throws CacheWriterException {
  Integer value=entry.getValue();
  if (!isAcceptableValue(value)) {
    throw new CacheWriterException("String_Node_Str" + value);
  }
}
Program: 46093
Project: 46093
Buggy source:
private int getPartitionCount(){
  Node node=getNode(getHazelcastInstance());
  if (node != null) {
    return node.getProperties().getInteger(GroupProperty.PARTITION_COUNT);
  }
  return Integer.valueOf(GroupProperty.PARTITION_COUNT.getDefaultValue());
}

Fixed version (ground truth):
private int getPartitionCount(){
  Node node=getNode(getHazelcastInstance());
  if (node != null) {
    return node.getProperties().getInteger(GroupProperty.PARTITION_COUNT);
  }
  return parseInt(GroupProperty.PARTITION_COUNT.getDefaultValue());
}
Program: 46094
Project: 46094
Buggy source:
@Test public void whenConfigLocationAsProperty_thenThatInstanceIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str"),null,HazelcastCachingProvider.propertiesByLocation("String_Node_Str" + CONFIG_CLASSPATH_LOCATION));
  assertCacheManagerInstance(cacheManager,instance3);
}

Fixed version (ground truth):
@Test public void whenConfigLocationAsProperty_thenThatInstanceIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str"),null,propertiesByLocation("String_Node_Str" + CONFIG_CLASSPATH_LOCATION));
  assertCacheManagerInstance(cacheManager,instance3);
}
Program: 46095
Project: 46095
Buggy source:
@Test public void whenInstanceItselfAsProperty_andInvalidConfigURI_thenInstanceItselfIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str"),null,HazelcastCachingProvider.propertiesByInstanceItself(instance2));
  assertCacheManagerInstance(cacheManager,instance2);
}

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

Fixed version (ground truth):
@Test(expected=CacheException.class) public void whenInvalidConfigLocationAsUri_thenFails() throws URISyntaxException {
  cachingProvider.getCacheManager(new URI("String_Node_Str"),null);
}
Program: 46097
Project: 46097
Buggy source:
@Test public void whenDefaultURI_instanceNameAsProperty_thenThatInstanceIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(null,null,HazelcastCachingProvider.propertiesByInstanceName(INSTANCE_2_NAME));
  assertCacheManagerInstance(cacheManager,instance2);
}

Fixed version (ground truth):
@Test public void whenDefaultURI_instanceNameAsProperty_thenThatInstanceIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(null,null,propertiesByInstanceName(INSTANCE_2_NAME));
  assertCacheManagerInstance(cacheManager,instance2);
}
Program: 46098
Project: 46098
Buggy source:
@Test public void whenInstanceItselfAsProperty_andValidConfigURI_thenInstanceItselfIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str" + CONFIG_CLASSPATH_LOCATION),null,HazelcastCachingProvider.propertiesByInstanceItself(instance2));
  assertCacheManagerInstance(cacheManager,instance2);
}

Fixed version (ground truth):
@Test public void whenInstanceItselfAsProperty_andValidConfigURI_thenInstanceItselfIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str" + CONFIG_CLASSPATH_LOCATION),null,propertiesByInstanceItself(instance2));
  assertCacheManagerInstance(cacheManager,instance2);
}
Program: 46099
Project: 46099
Buggy source:
@Test public void whenOtherURI_instanceNameAsProperty_thenThatInstanceIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str"),null,HazelcastCachingProvider.propertiesByInstanceName(INSTANCE_2_NAME));
  assertCacheManagerInstance(cacheManager,instance2);
}

Fixed version (ground truth):
@Test public void whenOtherURI_instanceNameAsProperty_thenThatInstanceIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str"),null,propertiesByInstanceName(INSTANCE_2_NAME));
  assertCacheManagerInstance(cacheManager,instance2);
}
Program: 46100
Project: 46100
Buggy source:
@Test public void whenInstanceNameAsProperty_thenThatInstanceIsUsed() throws URISyntaxException {
  HazelcastCacheManager cacheManager=(HazelcastCacheManager)cachingProvider.getCacheManager(new URI("String_Node_Str"),null,HazelcastCachingProvider.propertiesByInstanceName(INSTANCE_2_NAME));
  assertCacheManagerInstance(cacheManager,instance2);
}

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

Fixed version (ground truth):
@Test(expected=CacheException.class) public void whenOtherURI_noInstanceName_thenFails() throws URISyntaxException {
  cachingProvider.getCacheManager(new URI("String_Node_Str"),null);
}