nus-yam/ex-repair huggingface dataset:
Program: 47959
Project: 47959
Buggy source:
@Test @ClientCompatibleTest public void testSimpleUsage() throws InterruptedException {
  final int k=5;
  final Config config=new Config();
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances(config);
  ICountDownLatch latch=instances[0].getCountDownLatch("String_Node_Str");
  latch.trySetCount(k - 1);
  assertEquals(k - 1,latch.getCount());
  new Thread(){
    public void run(){
      for (int i=1; i < k; i++) {
        try {
          sleep(100);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
        final ICountDownLatch l=instances[i].getCountDownLatch("String_Node_Str");
        l.countDown();
        assertEquals(k - 1 - i,l.getCount());
      }
    }
  }
.start();
  assertTrue(latch.await(5000,TimeUnit.MILLISECONDS));
  assertEquals(0,latch.getCount());
}

Fixed version (ground truth):
@Test @ClientCompatibleTest public void testSimpleUsage() throws InterruptedException {
  final int k=5;
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(k);
  final HazelcastInstance[] instances=factory.newInstances();
  ICountDownLatch latch=instances[0].getCountDownLatch("String_Node_Str");
  latch.trySetCount(k - 1);
  assertEquals(k - 1,latch.getCount());
  new Thread(){
    public void run(){
      for (int i=1; i < k; i++) {
        try {
          sleep(100);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
        final ICountDownLatch l=instances[i].getCountDownLatch("String_Node_Str");
        l.countDown();
        assertEquals(k - 1 - i,l.getCount());
      }
    }
  }
.start();
  assertTrue(latch.await(5000,TimeUnit.MILLISECONDS));
  assertEquals(0,latch.getCount());
}
Program: 47960
Project: 47960
Buggy source:
@Test(expected=IllegalArgumentException.class) public void testTrySetCount_whenArgumentNegative(){
  final HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch("String_Node_Str");
  latch.trySetCount(-20);
}

Fixed version (ground truth):
@Test(expected=IllegalArgumentException.class) public void testTrySetCount_whenArgumentNegative(){
  HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch("String_Node_Str");
  latch.trySetCount(-20);
}
Program: 47961
Project: 47961
Buggy source:
@Test public void testTrySetCount_whenCountIsZero(){
  final HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  assertTrue(latch.trySetCount(40));
  assertEquals(40,latch.getCount());
}

Fixed version (ground truth):
@Test public void testTrySetCount_whenCountIsZero(){
  HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  assertTrue(latch.trySetCount(40));
  assertEquals(40,latch.getCount());
}
Program: 47962
Project: 47962
Buggy source:
@Test public void testCountDown_whenReachZero_thenLatchRemoved(){
  final HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  CountDownLatchService service=getNode(instance).getNodeEngine().getService(CountDownLatchService.SERVICE_NAME);
  latch.trySetCount(1);
  assertTrue(service.containsLatch(latch.getName()));
  latch.countDown();
  assertFalse(service.containsLatch(latch.getName()));
}

Fixed version (ground truth):
@Test public void testCountDown_whenReachZero_thenLatchRemoved(){
  HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  CountDownLatchService service=getNode(instance).getNodeEngine().getService(CountDownLatchService.SERVICE_NAME);
  latch.trySetCount(1);
  assertTrue(service.containsLatch(latch.getName()));
  latch.countDown();
  assertFalse(service.containsLatch(latch.getName()));
}
Program: 47963
Project: 47963
Buggy source:
@Test public void testGetCount(){
  final HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  latch.trySetCount(20);
  assertEquals(20,latch.getCount());
}

Fixed version (ground truth):
@Test public void testGetCount(){
  HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  latch.trySetCount(20);
  assertEquals(20,latch.getCount());
}
Program: 47964
Project: 47964
Buggy source:
@Test(timeout=15000) public void testAwait_withManyThreads(){
  final HazelcastInstance instance=createHazelcastInstance();
  final ICountDownLatch latch=instance.getCountDownLatch(randomString());
  final CountDownLatch completedLatch=new CountDownLatch(10);
  latch.trySetCount(1);
  for (int i=0; i < 10; i++) {
    new Thread(){
      public void run(){
        try {
          if (latch.await(1,TimeUnit.MINUTES)) {
            completedLatch.countDown();
          }
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
    }
.start();
  }
  latch.countDown();
  assertOpenEventually(completedLatch);
}

Fixed version (ground truth):
@Test(timeout=15000) public void testAwait_withManyThreads(){
  HazelcastInstance instance=createHazelcastInstance();
  final ICountDownLatch latch=instance.getCountDownLatch(randomString());
  final CountDownLatch completedLatch=new CountDownLatch(10);
  latch.trySetCount(1);
  for (int i=0; i < 10; i++) {
    new TestThread(){
      public void doRun() throws Exception {
        if (latch.await(1,TimeUnit.MINUTES)) {
          completedLatch.countDown();
        }
      }
    }
.start();
  }
  latch.countDown();
  assertOpenEventually(completedLatch);
}
Program: 47965
Project: 47965
Buggy source:
@Test(expected=DistributedObjectDestroyedException.class) @ClientCompatibleTest public void testLatchDestroyed() throws Exception {
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  HazelcastInstance hz1=factory.newHazelcastInstance();
  HazelcastInstance hz2=factory.newHazelcastInstance();
  final ICountDownLatch latch=hz1.getCountDownLatch("String_Node_Str");
  latch.trySetCount(2);
  new Thread(){
    public void run(){
      try {
        sleep(1000);
      }
 catch (      InterruptedException e) {
        return;
      }
      latch.destroy();
    }
  }
.start();
  hz2.getCountDownLatch("String_Node_Str").await(5,TimeUnit.SECONDS);
}

Fixed version (ground truth):
@Test(expected=DistributedObjectDestroyedException.class) @ClientCompatibleTest public void testLatchDestroyed() throws Exception {
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(2);
  HazelcastInstance hz1=factory.newHazelcastInstance();
  HazelcastInstance hz2=factory.newHazelcastInstance();
  final ICountDownLatch latch=hz1.getCountDownLatch("String_Node_Str");
  latch.trySetCount(2);
  new TestThread(){
    public void doRun() throws Exception {
      sleep(1000);
      latch.destroy();
    }
  }
.start();
  hz2.getCountDownLatch("String_Node_Str").await(5,TimeUnit.SECONDS);
}
Program: 47966
Project: 47966
Buggy source:
@Test public void testTrySetCount_whenCountIsNotZero(){
  final HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  latch.trySetCount(10);
  assertFalse(latch.trySetCount(20));
  assertFalse(latch.trySetCount(0));
  assertEquals(10,latch.getCount());
}

Fixed version (ground truth):
@Test public void testTrySetCount_whenCountIsNotZero(){
  HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  latch.trySetCount(10);
  assertFalse(latch.trySetCount(20));
  assertFalse(latch.trySetCount(0));
  assertEquals(10,latch.getCount());
}
Program: 47967
Project: 47967
Buggy source:
@Test public void testTrySetCount_whenAlreadySet(){
  final HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  latch.trySetCount(10);
  assertFalse(latch.trySetCount(20));
  assertFalse(latch.trySetCount(100));
  assertFalse(latch.trySetCount(0));
  assertEquals(10,latch.getCount());
}

Fixed version (ground truth):
@Test public void testTrySetCount_whenAlreadySet(){
  HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  latch.trySetCount(10);
  assertFalse(latch.trySetCount(20));
  assertFalse(latch.trySetCount(100));
  assertFalse(latch.trySetCount(0));
  assertEquals(10,latch.getCount());
}
Program: 47968
Project: 47968
Buggy source:
@Test(timeout=15000) public void testAwait_whenTimeOut() throws InterruptedException {
  final HazelcastInstance instance=createHazelcastInstance();
  final ICountDownLatch latch=instance.getCountDownLatch(randomString());
  latch.trySetCount(1);
  long time=System.currentTimeMillis();
  assertFalse(latch.await(100,TimeUnit.MILLISECONDS));
  long elapsed=System.currentTimeMillis() - time;
  assertTrue(elapsed >= 100);
  assertEquals(1,latch.getCount());
}

Fixed version (ground truth):
@Test(timeout=15000) public void testAwait_whenTimeOut() throws InterruptedException {
  HazelcastInstance instance=createHazelcastInstance();
  ICountDownLatch latch=instance.getCountDownLatch(randomString());
  latch.trySetCount(1);
  long time=System.currentTimeMillis();
  assertFalse(latch.await(100,TimeUnit.MILLISECONDS));
  long elapsed=System.currentTimeMillis() - time;
  assertTrue(elapsed >= 100);
  assertEquals(1,latch.getCount());
}
Program: 47969
Project: 47969
Buggy source:
public void run(){
  try {
    lock.lock();
    syncLatch.countDown();
    condition.await();
    latch.countDown();
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
 finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
public void run(){
  lock.lock();
  try {
    awaitLatch.countDown();
    condition.await();
    if (lock.isLockedByCurrentThread()) {
      count.incrementAndGet();
    }
  }
 catch (  InterruptedException ignored) {
  }
 finally {
    lock.unlock();
    finalLatch.countDown();
  }
}
Program: 47970
Project: 47970
Buggy source:
@Test(timeout=60000,expected=IllegalMonitorStateException.class) public void testAwait_whenOwnedByOtherThread() throws InterruptedException {
  HazelcastInstance instance=createHazelcastInstance();
  final ILock lock=instance.getLock(randomString());
  final ICondition condition=lock.newCondition(randomString());
  final CountDownLatch latch=new CountDownLatch(1);
  new Thread(new Runnable(){
    @Override public void run(){
      lock.lock();
      latch.countDown();
    }
  }
).start();
  latch.await();
  condition.await();
}

Fixed version (ground truth):
@Test(timeout=60000,expected=IllegalMonitorStateException.class) public void testAwait_whenOwnedByOtherThread() throws InterruptedException {
  HazelcastInstance instance=createHazelcastInstance();
  final ILock lock=instance.getLock(randomString());
  final ICondition condition=lock.newCondition(randomString());
  final CountDownLatch latch=new CountDownLatch(1);
  new TestThread(){
    @Override public void doRun(){
      lock.lock();
      latch.countDown();
    }
  }
.start();
  latch.await();
  condition.await();
}
Program: 47971
Project: 47971
Buggy source:
private Thread createThreadWaitsForCondition(final CountDownLatch latch,final ILock lock,final ICondition condition,final CountDownLatch syncLatch){
  Thread t=new Thread(new Runnable(){
    public void run(){
      try {
        lock.lock();
        syncLatch.countDown();
        condition.await();
        latch.countDown();
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
 finally {
        lock.unlock();
      }
    }
  }
);
  return t;
}

Fixed version (ground truth):
private TestThread createThreadWaitsForCondition(final CountDownLatch latch,final ILock lock,final ICondition condition,final CountDownLatch syncLatch){
  TestThread t=new TestThread(){
    public void doRun() throws Exception {
      try {
        lock.lock();
        syncLatch.countDown();
        condition.await();
        latch.countDown();
      }
  finally {
        lock.unlock();
      }
    }
  }
;
  return t;
}
Program: 47972
Project: 47972
Buggy source:
@Override public final void run(){
  try {
    startLatch.await();
    doRun();
  }
 catch (  Throwable t) {
    if (stopOnError) {
      stopTest=true;
    }
    t.printStackTrace();
    this.error=t;
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  assertEquals("String_Node_Str",expectedSize,instance.getCluster().getMembers().size());
}
Program: 47973
Project: 47973
Buggy source:
public MergePolicyProvider(NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  mergePolicyMap=new ConcurrentHashMap<String,MapMergePolicy>();
  addMergePolicies();
}

Fixed version (ground truth):
public MergePolicyProvider(NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  mergePolicyMap=new ConcurrentHashMap<String,MapMergePolicy>();
  addOutOfBoxPolicies();
}
Program: 47974
Project: 47974
Buggy source:
public MapMergePolicy getMergePolicy(String mergePolicyName){
  MapMergePolicy mergePolicy=mergePolicyMap.get(mergePolicyName);
  if (mergePolicy == null && mergePolicyName != null) {
    try {
      mergePolicy=ClassLoaderUtil.newInstance(nodeEngine.getConfigClassLoader(),mergePolicyName);
      mergePolicyMap.put(mergePolicyName,mergePolicy);
    }
 catch (    Exception e) {
      nodeEngine.getLogger(getClass()).severe(e);
      throw ExceptionUtil.rethrow(e);
    }
  }
  if (mergePolicy == null) {
    return mergePolicyMap.get(MapConfig.DEFAULT_MAP_MERGE_POLICY);
  }
  return mergePolicy;
}

Fixed version (ground truth):
public MapMergePolicy getMergePolicy(String className){
  if (className == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return ConcurrencyUtil.getOrPutIfAbsent(mergePolicyMap,className,policyConstructorFunction);
}
Program: 47975
Project: 47975
Buggy source:
@edu.umd.cs.findbugs.annotations.SuppressWarnings("String_Node_Str") void heartBeatingFailed(){
  failedHeartBeat++;
  if (failedHeartBeat == connectionManager.getMaxFailedHeartbeatCount()) {
    connectionManager.onDetectingUnresponsiveConnection(this);
    final Iterator<ClientCallFuture> iterator=eventHandlerMap.values().iterator();
    final TargetDisconnectedException response=new TargetDisconnectedException(remoteEndpoint);
    while (iterator.hasNext()) {
      final ClientCallFuture future=iterator.next();
      iterator.remove();
      future.notify(response);
    }
  }
}

Fixed version (ground truth):
@edu.umd.cs.findbugs.annotations.SuppressWarnings("String_Node_Str") void heartBeatingFailed(){
  failedHeartBeat++;
  final int maxFailedHeartbeatCount=connectionManager.getMaxFailedHeartbeatCount();
  logger.warning("String_Node_Str" + getRemoteEndpoint() + "String_Node_Str"+ "String_Node_Str"+ failedHeartBeat+ "String_Node_Str"+ maxFailedHeartbeatCount);
  if (failedHeartBeat == maxFailedHeartbeatCount) {
    connectionManager.onDetectingUnresponsiveConnection(this);
    final Iterator<ClientCallFuture> iterator=eventHandlerMap.values().iterator();
    final TargetDisconnectedException response=new TargetDisconnectedException(remoteEndpoint);
    while (iterator.hasNext()) {
      final ClientCallFuture future=iterator.next();
      iterator.remove();
      future.notify(response);
    }
  }
}
Program: 47976
Project: 47976
Buggy source:
private void sendInternal(ClientCallFuture future,ClientConnection connection,int partitionId){
  connection.registerCallId(future);
  future.setConnection(connection);
  final SerializationService ss=client.getSerializationService();
  final Data data=ss.toData(future.getRequest());
  Packet packet=new Packet(data,partitionId,ss.getPortableContext());
  if (!connection.write(packet)) {
    final int callId=future.getRequest().getCallId();
    connection.deRegisterCallId(callId);
    connection.deRegisterEventHandler(callId);
    future.notify(new TargetNotMemberException("String_Node_Str" + connection.getRemoteEndpoint()));
  }
}

Fixed version (ground truth):
private void sendInternal(ClientCallFuture future,ClientConnection connection,int partitionId){
  connection.registerCallId(future);
  future.setConnection(connection);
  final SerializationService ss=client.getSerializationService();
  final ClientRequest request=future.getRequest();
  final Data data=ss.toData(request);
  Packet packet=new Packet(data,partitionId,ss.getPortableContext());
  if (!isAllowedToSendRequest(connection,request) || !connection.write(packet)) {
    final int callId=request.getCallId();
    connection.deRegisterCallId(callId);
    connection.deRegisterEventHandler(callId);
    future.notify(new TargetNotMemberException("String_Node_Str" + connection.getRemoteEndpoint()));
  }
}
Program: 47977
Project: 47977
Buggy source:
private void doRun(){
  for (; ; ) {
    Packet task;
    try {
      task=workQueue.take();
    }
 catch (    InterruptedException e) {
      if (isShutdown) {
        return;
      }
      continue;
    }
    if (isShutdown) {
      return;
    }
    process(task);
  }
}

Fixed version (ground truth):
private void doRun(){
  while (true) {
    Packet task;
    try {
      task=workQueue.take();
    }
 catch (    InterruptedException e) {
      if (isShutdown) {
        return;
      }
      continue;
    }
    if (isShutdown) {
      return;
    }
    process(task);
  }
}
Program: 47978
Project: 47978
Buggy source:
@Override public Portable create(int classId){
  Portable portable;
switch (classId) {
case ClientPortableHook.GENERIC_ERROR:
    portable=new GenericError();
  break;
case ClientPortableHook.AUTH:
portable=new AuthenticationRequest();
break;
case ClientPortableHook.PRINCIPAL:
portable=new ClientPrincipal();
break;
case ClientPortableHook.GET_DISTRIBUTED_OBJECT_INFO:
portable=new GetDistributedObjectsRequest();
break;
case ClientPortableHook.DISTRIBUTED_OBJECT_INFO:
portable=new DistributedObjectInfo();
break;
case ClientPortableHook.CREATE_PROXY:
portable=new ClientCreateRequest();
break;
case ClientPortableHook.DESTROY_PROXY:
portable=new ClientDestroyRequest();
break;
case ClientPortableHook.LISTENER:
portable=new DistributedObjectListenerRequest();
break;
case ClientPortableHook.MEMBERSHIP_LISTENER:
portable=new AddMembershipListenerRequest();
break;
case ClientPortableHook.CLIENT_PING:
portable=new ClientPingRequest();
break;
case ClientPortableHook.GET_PARTITIONS:
portable=new GetPartitionsRequest();
break;
case ClientPortableHook.REMOVE_LISTENER:
portable=new RemoveDistributedObjectListenerRequest();
break;
default :
portable=null;
}
return portable;
}

Fixed version (ground truth):
@Override public Portable create(int classId){
  Portable portable;
switch (classId) {
case ClientPortableHook.GENERIC_ERROR:
    portable=new GenericError();
  break;
case ClientPortableHook.AUTH:
portable=new AuthenticationRequest();
break;
case ClientPortableHook.PRINCIPAL:
portable=new ClientPrincipal();
break;
case ClientPortableHook.GET_DISTRIBUTED_OBJECT_INFO:
portable=new GetDistributedObjectsRequest();
break;
case ClientPortableHook.DISTRIBUTED_OBJECT_INFO:
portable=new DistributedObjectInfo();
break;
case ClientPortableHook.CREATE_PROXY:
portable=new ClientCreateRequest();
break;
case ClientPortableHook.DESTROY_PROXY:
portable=new ClientDestroyRequest();
break;
case ClientPortableHook.LISTENER:
portable=new DistributedObjectListenerRequest();
break;
case ClientPortableHook.MEMBERSHIP_LISTENER:
portable=new AddMembershipListenerRequest();
break;
case ClientPortableHook.CLIENT_PING:
portable=new ClientPingRequest();
break;
case ClientPortableHook.GET_PARTITIONS:
portable=new GetPartitionsRequest();
break;
case ClientPortableHook.REMOVE_LISTENER:
portable=new RemoveDistributedObjectListenerRequest();
break;
case ClientPortableHook.REMOVE_ALL_LISTENERS:
portable=new RemoveAllListeners();
break;
default :
portable=null;
}
return portable;
}
Program: 47979
Project: 47979
Buggy source:
@Override public ClientProxy create(String id){
  String instanceName=client.getName();
  return instantiateClientProxy(proxyType,serviceName,id);
}

Fixed version (ground truth):
@Override public ClientProxy create(String id){
  return instantiateClientProxy(proxyType,serviceName,id);
}
Program: 47980
Project: 47980
Buggy source:
public void register(final String serviceName,final Class<? extends ClientProxy> proxyType){
  try {
    register(serviceName,new ClientProxyFactory(){
      @Override public ClientProxy create(      String id){
        String instanceName=client.getName();
        return instantiateClientProxy(proxyType,serviceName,id);
      }
    }
);
  }
 catch (  Exception e) {
    throw new HazelcastException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void register(final String serviceName,final Class<? extends ClientProxy> proxyType){
  try {
    register(serviceName,new ClientProxyFactory(){
      @Override public ClientProxy create(      String id){
        return instantiateClientProxy(proxyType,serviceName,id);
      }
    }
);
  }
 catch (  Exception e) {
    throw new HazelcastException("String_Node_Str",e);
  }
}
Program: 47981
Project: 47981
Buggy source:
public static void enforcePartitionTableWarmup(MapReduceService mapReduceService) throws TimeoutException {
  InternalPartitionService partitionService=mapReduceService.getNodeEngine().getPartitionService();
  InternalPartition[] partitions=partitionService.getPartitions();
  long startTime=Clock.currentTimeMillis();
  for (  InternalPartition partition : partitions) {
    while (partitionService.getPartition(partition.getPartitionId(),true).getOwnerOrNull() == null) {
      try {
        Thread.sleep(RETRY_PARTITION_TABLE_MILLIS);
      }
 catch (      Exception ignore) {
        EmptyStatement.ignore(ignore);
      }
      if (Clock.currentTimeMillis() - startTime > PARTITION_READY_TIMEOUT) {
        throw new TimeoutException("String_Node_Str");
      }
    }
  }
}

Fixed version (ground truth):
public static void enforcePartitionTableWarmup(MapReduceService mapReduceService) throws TimeoutException {
  InternalPartitionService partitionService=mapReduceService.getNodeEngine().getPartitionService();
  InternalPartition[] partitions=partitionService.getPartitions();
  long startTime=Clock.currentTimeMillis();
  for (  InternalPartition partition : partitions) {
    while (partitionService.getPartition(partition.getPartitionId()).getOwner() == null) {
      try {
        Thread.sleep(RETRY_PARTITION_TABLE_MILLIS);
      }
 catch (      Exception ignore) {
        Logger.getLogger(MapReduceUtil.class).finest(ignore);
      }
      if (Clock.currentTimeMillis() - startTime > PARTITION_READY_TIMEOUT) {
        throw new TimeoutException("String_Node_Str");
      }
    }
  }
}
Program: 47982
Project: 47982
Buggy source:
private void setTestSizeEstimator(IMap map,final long oneEntryHeapCostInMegaBytes){
  final MapProxyImpl mapProxy=(MapProxyImpl)map;
  final MapService mapService=mapProxy.getService();
  final NodeEngine nodeEngine=mapService.getNodeEngine();
  final InternalPartitionService partitionService=nodeEngine.getPartitionService();
  for (int i=0; i < partitionService.getPartitionCount(); i++) {
    final Address owner=partitionService.getPartitionOwner(i);
    if (nodeEngine.getThisAddress().equals(owner)) {
      final PartitionContainer container=mapService.getPartitionContainer(i);
      if (container == null) {
        continue;
      }
      final RecordStore recordStore=container.getRecordStore(map.getName());
      final DefaultRecordStore defaultRecordStore=(DefaultRecordStore)recordStore;
      defaultRecordStore.setSizeEstimator(new SizeEstimator(){
        long size;
        @Override public long getSize(){
          return size;
        }
        @Override public void add(        long size){
          this.size+=size;
        }
        @Override public long getCost(        Object record){
          return convertMegaBytesToBytes(oneEntryHeapCostInMegaBytes);
        }
        @Override public void reset(){
          size=0;
        }
      }
);
    }
  }
}

Fixed version (ground truth):
private void setTestSizeEstimator(IMap map,final long oneEntryHeapCostInMegaBytes){
  final MapProxyImpl mapProxy=(MapProxyImpl)map;
  final MapService mapService=(MapService)mapProxy.getService();
  final NodeEngine nodeEngine=mapService.getNodeEngine();
  final InternalPartitionService partitionService=nodeEngine.getPartitionService();
  for (int i=0; i < partitionService.getPartitionCount(); i++) {
    final Address owner=partitionService.getPartitionOwner(i);
    if (nodeEngine.getThisAddress().equals(owner)) {
      final PartitionContainer container=mapService.getPartitionContainer(i);
      if (container == null) {
        continue;
      }
      final RecordStore recordStore=container.getRecordStore(map.getName());
      final DefaultRecordStore defaultRecordStore=(DefaultRecordStore)recordStore;
      defaultRecordStore.setSizeEstimator(new SizeEstimator(){
        long size;
        @Override public long getSize(){
          return size;
        }
        @Override public void add(        long size){
          this.size+=size;
        }
        @Override public long getCost(        Object record){
          return convertMegaBytesToBytes(oneEntryHeapCostInMegaBytes);
        }
        @Override public void reset(){
          size=0;
        }
      }
);
    }
  }
}
Program: 47983
Project: 47983
Buggy source:
protected Config buildConfig(){
  Config config=new XmlConfigBuilder().build();
  config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true).addMember("String_Node_Str");
  return config;
}

Fixed version (ground truth):
protected Config buildConfig(){
  Config config=new XmlConfigBuilder().build();
  config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
  config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true).addMember("String_Node_Str");
  return config;
}
Program: 47984
Project: 47984
Buggy source:
public void setCountDirect(String name,int count){
  if (count <= 0) {
    latches.remove(name);
  }
 else {
    CountDownLatchInfo latch=latches.get(name);
    if (latch == null) {
      latch=new CountDownLatchInfo(name);
      latches.put(name,latch);
    }
    latch.setCountDirect(count);
  }
}

Fixed version (ground truth):
public void setCountDirect(String name,int count){
  if (count < 0) {
    latches.remove(name);
  }
 else {
    CountDownLatchInfo latch=latches.get(name);
    if (latch == null) {
      latch=new CountDownLatchInfo(name);
      latches.put(name,latch);
    }
    latch.setCountDirect(count);
  }
}
Program: 47985
Project: 47985
Buggy source:
public boolean setCount(String name,int count){
  if (count <= 0) {
    latches.remove(name);
    return false;
  }
 else {
    CountDownLatchInfo latch=latches.get(name);
    if (latch == null) {
      latch=new CountDownLatchInfo(name);
      latches.put(name,latch);
    }
    return latch.setCount(count);
  }
}

Fixed version (ground truth):
public boolean setCount(String name,int count){
  if (count < 0) {
    latches.remove(name);
    return false;
  }
 else {
    CountDownLatchInfo latch=latches.get(name);
    if (latch == null) {
      latch=new CountDownLatchInfo(name);
      latches.put(name,latch);
    }
    return latch.setCount(count);
  }
}
Program: 47986
Project: 47986
Buggy source:
@Override public int drainTo(Collection<? super E> objects,int i){
  final NodeEngine nodeEngine=getNodeEngine();
  if (this.equals(objects)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Collection<Data> dataList=drainInternal(i);
  for (  Data data : dataList) {
    E e=nodeEngine.toObject(data);
    objects.add(e);
  }
  return dataList.size();
}

Fixed version (ground truth):
@Override public int drainTo(Collection<? super E> objects,int i){
  final NodeEngine nodeEngine=getNodeEngine();
  throwExceptionIfNull(objects,"String_Node_Str");
  if (this.equals(objects)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Collection<Data> dataList=drainInternal(i);
  for (  Data data : dataList) {
    E e=nodeEngine.toObject(data);
    objects.add(e);
  }
  return dataList.size();
}
Program: 47987
Project: 47987
Buggy source:
protected void throwExceptionIfNull(Object o){
  if (o == null) {
    throw new NullPointerException("String_Node_Str");
  }
}

Fixed version (ground truth):
protected void throwExceptionIfNull(Object o,String message){
  if (o == null) {
    throw new NullPointerException(message);
  }
}
Program: 47988
Project: 47988
Buggy source:
@Test public void testDrainToWithMaxElement_whenCollectionNull(){
  IQueue<String> queue=newQueue();
  for (int i=0; i < 10; i++) {
    queue.offer("String_Node_Str" + i);
  }
  try {
    queue.drainTo(null,4);
    fail();
  }
 catch (  NullPointerException expected) {
  }
  assertEquals(6,queue.size());
}

Fixed version (ground truth):
@Test public void testDrainToWithMaxElement_whenCollectionNull(){
  IQueue<String> queue=newQueue();
  for (int i=0; i < 10; i++) {
    queue.offer("String_Node_Str" + i);
  }
  try {
    queue.drainTo(null,4);
    fail();
  }
 catch (  NullPointerException expected) {
  }
  assertEquals(10,queue.size());
}
Program: 47989
Project: 47989
Buggy source:
@Test public void testPollWithTimeout() throws Exception {
  final IQueue<String> queue=newQueue();
  PollThread pollThread=new PollThread(queue);
  pollThread.start();
  assertTrue(queue.offer("String_Node_Str"));
  assertSizeEventually(0,queue);
}

Fixed version (ground truth):
@Test public void testPollWithTimeout() throws Exception {
  final IQueue<String> queue=newQueue();
  PollThread pollThread=new PollThread(queue);
  pollThread.start();
  queue.offer("String_Node_Str");
  queue.offer("String_Node_Str");
  assertSizeEventually(1,queue);
  assertTrue(queue.contains("String_Node_Str"));
}
Program: 47990
Project: 47990
Buggy source:
@Test public void testDrainTo_whenCollectionNull(){
  IQueue<String> queue=newQueue();
  for (int i=0; i < 10; i++) {
    queue.offer("String_Node_Str" + i);
  }
  try {
    queue.drainTo(null);
    fail();
  }
 catch (  NullPointerException expected) {
  }
  assertEquals(0,queue.size());
}

Fixed version (ground truth):
@Test public void testDrainTo_whenCollectionNull(){
  IQueue<String> queue=newQueue();
  for (int i=0; i < 10; i++) {
    queue.offer("String_Node_Str" + i);
  }
  try {
    queue.drainTo(null);
    fail();
  }
 catch (  NullPointerException expected) {
  }
  assertEquals(10,queue.size());
}
Program: 47991
Project: 47991
Buggy source:
@Test @Category(ProblematicTest.class) public void dropedEntryProcessorTest_withKeyOwningNodeTermination() throws ExecutionException, InterruptedException {
  String mapName=randomString();
  Config cfg=new Config();
  cfg.getMapConfig(mapName).setInMemoryFormat(InMemoryFormat.OBJECT);
  final int maxIterations=50;
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(maxIterations + 1);
  HazelcastInstance instance1=factory.newHazelcastInstance(cfg);
  for (int iteration=0; iteration < maxIterations; iteration++) {
    System.out.println("String_Node_Str" + iteration + "String_Node_Str");
    HazelcastInstance instance2=factory.newHazelcastInstance(cfg);
    final int maxTasks=20;
    final Object key=generateKeyOwnedBy(instance2);
    final IMap<Object,List<Integer>> processorMap=instance1.getMap(mapName);
    processorMap.put(key,new ArrayList<Integer>());
    for (int i=0; i < maxTasks; i++) {
      processorMap.submitToKey(key,new SimpleEntryProcessor(i));
      if (i == maxTasks / 2) {
        instance2.getLifecycleService().terminate();
      }
    }
    assertTrueEventually(new AssertTask(){
      public void run() throws Exception {
        List<Integer> actualOrder=processorMap.get(key);
        assertTrue("String_Node_Str",actualOrder.size() >= maxTasks);
      }
    }
);
  }
}

Fixed version (ground truth):
@Test public void dropedEntryProcessorTest_withKeyOwningNodeTermination() throws ExecutionException, InterruptedException {
  String mapName=randomString();
  Config cfg=new Config();
  cfg.getMapConfig(mapName).setInMemoryFormat(InMemoryFormat.OBJECT);
  final int maxIterations=50;
  TestHazelcastInstanceFactory factory=createHazelcastInstanceFactory(maxIterations + 1);
  HazelcastInstance instance1=factory.newHazelcastInstance(cfg);
  for (int iteration=0; iteration < maxIterations; iteration++) {
    HazelcastInstance instance2=factory.newHazelcastInstance(cfg);
    final int maxTasks=20;
    final Object key=generateKeyOwnedBy(instance2);
    final IMap<Object,List<Integer>> processorMap=instance1.getMap(mapName);
    processorMap.put(key,new ArrayList<Integer>());
    for (int i=0; i < maxTasks; i++) {
      processorMap.submitToKey(key,new SimpleEntryProcessor(i));
      if (i == maxTasks / 2) {
        instance2.getLifecycleService().shutdown();
      }
    }
    assertTrueEventually(new AssertTask(){
      public void run() throws Exception {
        List<Integer> actualOrder=processorMap.get(key);
        assertTrue("String_Node_Str",actualOrder.size() >= maxTasks);
      }
    }
,30);
  }
}
Program: 47992
Project: 47992
Buggy source:
@Override public Object process(Map.Entry<Object,List<Integer>> entry){
  List l=entry.getValue();
  l.add(id);
  if (backup) {
    System.out.print("String_Node_Str");
  }
  System.out.println("String_Node_Str" + l + "String_Node_Str"+ l.size()+ "String_Node_Str"+ id);
  return id;
}

Fixed version (ground truth):
@Override public Object process(Map.Entry<Object,List<Integer>> entry){
  List<Integer> list=entry.getValue();
  list.add(id);
  LockSupport.parkNanos((long)(Math.random() * 10000));
  entry.setValue(list);
  return id;
}
Program: 47993
Project: 47993
Buggy source:
@Override public void readData(ObjectDataInput in) throws IOException {
  id=in.readObject();
}

Fixed version (ground truth):
@Override public void readData(ObjectDataInput in) throws IOException {
  id=in.readInt();
}
Program: 47994
Project: 47994
Buggy source:
@Override public void processBackup(Map.Entry entry){
  backup=true;
  process(entry);
}

Fixed version (ground truth):
@Override public void processBackup(Map.Entry<Object,List<Integer>> entry){
  process(entry);
}
Program: 47995
Project: 47995
Buggy source:
@Override public void writeData(ObjectDataOutput out) throws IOException {
  out.writeObject(id);
}

Fixed version (ground truth):
@Override public void writeData(ObjectDataOutput out) throws IOException {
  out.writeInt(id);
}
Program: 47996
Project: 47996
Buggy source:
@Override public boolean delete(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  Object oldValue=null;
  if (record == null) {
    if (mapContainer.getStore() != null) {
      removeIndex(dataKey);
      mapStoreDelete(null,dataKey);
    }
  }
 else {
    removeRecord(dataKey,record);
  }
  return oldValue != null;
}

Fixed version (ground truth):
@Override public boolean delete(Data dataKey){
  checkIfLoaded();
  Record record=records.get(dataKey);
  if (record == null) {
    if (mapContainer.getStore() != null) {
      removeIndex(dataKey);
      mapStoreDelete(null,dataKey);
    }
  }
 else {
    return removeRecord(dataKey,record) != null;
  }
  return false;
}
Program: 47997
Project: 47997
Buggy source:
@Override public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  ClassLoader cl=classLoader != null ? classLoader : Thread.currentThread().getContextClassLoader();
  t.setContextClassLoader(cl);
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}

Fixed version (ground truth):
@Override public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  t.setContextClassLoader(classLoader);
  if (t.getContextClassLoader() == null) {
    ClassLoader cl=Thread.currentThread().getContextClassLoader();
    if (cl == null) {
      cl=getClass().getClassLoader();
    }
    if (cl == null) {
      cl=ClassLoader.getSystemClassLoader();
    }
    t.setContextClassLoader(cl);
  }
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}
Program: 47998
Project: 47998
Buggy source:
@Override public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  ClassLoader cl=classLoader != null ? classLoader : Thread.currentThread().getContextClassLoader();
  t.setContextClassLoader(cl);
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}

Fixed version (ground truth):
@Override public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  t.setContextClassLoader(classLoader);
  if (t.getContextClassLoader() == null) {
    ClassLoader cl=Thread.currentThread().getContextClassLoader();
    if (cl == null) {
      cl=getClass().getClassLoader();
    }
    if (cl == null) {
      cl=ClassLoader.getSystemClassLoader();
    }
    t.setContextClassLoader(cl);
  }
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}
Program: 47999
Project: 47999
Buggy source:
public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  ClassLoader cl=classLoader != null ? classLoader : Thread.currentThread().getContextClassLoader();
  t.setContextClassLoader(cl);
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}

Fixed version (ground truth):
public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  t.setContextClassLoader(classLoader);
  if (t.getContextClassLoader() == null) {
    ClassLoader cl=Thread.currentThread().getContextClassLoader();
    if (cl == null) {
      cl=getClass().getClassLoader();
    }
    if (cl == null) {
      cl=ClassLoader.getSystemClassLoader();
    }
    t.setContextClassLoader(cl);
  }
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}
Program: 48000
Project: 48000
Buggy source:
@Override public Set<QueryableEntry> getSubRecords(ComparisonType comparisonType,Comparable searchedValue){
  MultiResultSet results=new MultiResultSet();
  indexStore.getSubRecords(results,comparisonType,convert(searchedValue));
  return results;
}

Fixed version (ground truth):
@Override public Set<QueryableEntry> getSubRecords(ComparisonType comparisonType,Comparable searchedValue){
  MultiResultSet results=new MultiResultSet();
  if (attributeType != null) {
    indexStore.getSubRecords(results,comparisonType,convert(searchedValue));
  }
  return results;
}
Program: 48001
Project: 48001
Buggy source:
@Override public void saveEntryIndex(QueryableEntry e) throws QueryException {
  Data key=e.getIndexKey();
  Comparable oldValue=recordValues.remove(key);
  Comparable newValue=e.getAttribute(attribute);
  if (newValue == null) {
    newValue=NULL;
  }
 else   if (newValue.getClass().isEnum()) {
    newValue=TypeConverters.ENUM_CONVERTER.convert(newValue);
  }
  recordValues.put(key,newValue);
  if (oldValue == null) {
    indexStore.newIndex(newValue,e);
  }
 else {
    indexStore.removeIndex(oldValue,key);
    indexStore.newIndex(newValue,e);
  }
  if (attributeType == null) {
    attributeType=e.getAttributeType(attribute);
  }
}

Fixed version (ground truth):
@Override public void saveEntryIndex(QueryableEntry e) throws QueryException {
  if (attributeType == null) {
    attributeType=e.getAttributeType(attribute);
  }
  Data key=e.getIndexKey();
  Comparable oldValue=recordValues.remove(key);
  Comparable newValue=e.getAttribute(attribute);
  if (newValue == null) {
    newValue=NULL;
  }
 else   if (newValue.getClass().isEnum()) {
    newValue=TypeConverters.ENUM_CONVERTER.convert(newValue);
  }
  recordValues.put(key,newValue);
  if (oldValue == null) {
    indexStore.newIndex(newValue,e);
  }
 else {
    indexStore.removeIndex(oldValue,key);
    indexStore.newIndex(newValue,e);
  }
}
Program: 48002
Project: 48002
Buggy source:
@Override public void clear(){
  recordValues.clear();
  indexStore.clear();
}

Fixed version (ground truth):
@Override public void clear(){
  recordValues.clear();
  indexStore.clear();
  attributeType=null;
}
Program: 48003
Project: 48003
Buggy source:
@Override public Set<QueryableEntry> getRecords(Comparable value){
  return indexStore.getRecords(convert(value));
}

Fixed version (ground truth):
@Override public Set<QueryableEntry> getRecords(Comparable value){
  if (attributeType != null) {
    return indexStore.getRecords(convert(value));
  }
 else {
    return new SingleResultSet(null);
  }
}
Program: 48004
Project: 48004
Buggy source:
@Override public Set<QueryableEntry> getSubRecordsBetween(Comparable from,Comparable to){
  MultiResultSet results=new MultiResultSet();
  indexStore.getSubRecordsBetween(results,convert(from),convert(to));
  return results;
}

Fixed version (ground truth):
@Override public Set<QueryableEntry> getSubRecordsBetween(Comparable from,Comparable to){
  MultiResultSet results=new MultiResultSet();
  if (attributeType != null) {
    indexStore.getSubRecordsBetween(results,convert(from),convert(to));
  }
  return results;
}
Program: 48005
Project: 48005
Buggy source:
public boolean containsEntry(K key,V value){
  Data keyData=toData(key);
  Data valueData=toData(value);
  ClientRequest request;
  if (keyData == null) {
    request=new ContainsRequest(name,valueData);
  }
 else {
    request=new KeyBasedContainsRequest(name,keyData,valueData);
  }
  Boolean result=invoke(request,keyData);
  return result;
}

Fixed version (ground truth):
public boolean containsEntry(K key,V value){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Data keyData=toData(key);
  Data valueData=toData(value);
  ClientRequest request=new KeyBasedContainsRequest(name,keyData,valueData);
  Boolean result=invoke(request,keyData);
  return result;
}
Program: 48006
Project: 48006
Buggy source:
@Override public Set<String> loadAllKeys(){
  sleepMillis(MS_LOAD_DELAY);
  return store.keySet();
}

Fixed version (ground truth):
@Override public Set<String> loadAllKeys(){
  if (sleepBeforeLoadAllKeys) {
    try {
      Thread.sleep(5000);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  countLoadAllKeys.incrementAndGet();
  Set<String> result=new HashSet<String>(store.keySet());
  List<String> resultList=new ArrayList<String>(result);
  Collections.sort(resultList);
  return result;
}
Program: 48007
Project: 48007
Buggy source:
@Override public String load(String key){
  sleepMillis(MS_PER_LOAD);
  saveInfoAboutCurrentLoaderThread();
  return store.get(key);
}

Fixed version (ground truth):
@Override public String load(String key){
  if (msPerLoad > 0) {
    try {
      Thread.sleep(msPerLoad);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  Thread thread=Thread.currentThread();
  ClassLoader contextClassLoader=thread.getContextClassLoader();
  contextClassLoaders.putIfAbsent(thread.getName(),contextClassLoader != null);
  return store.get(key);
}
Program: 48008
Project: 48008
Buggy source:
@Override public void deleteAll(Collection<String> keys){
  for (  String key : keys) {
    store.remove(key);
  }
}

Fixed version (ground truth):
@Override public void deleteAll(Collection<String> keys){
  List<String> keysList=new ArrayList<String>(keys);
  Collections.sort(keysList);
  for (  String key : keys) {
    store.remove(key);
  }
}
Program: 48009
Project: 48009
Buggy source:
@Override public Map<String,String> loadAll(Collection<String> keys){
  saveInfoAboutCurrentLoaderThread();
  Map<String,String> result=new HashMap<String,String>();
  for (  String key : keys) {
    sleepMillis(MS_PER_LOAD);
    String value=store.get(key);
    if (value != null) {
      result.put(key,value);
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public Map<String,String> loadAll(Collection<String> keys){
  List<String> keysList=new ArrayList<String>(keys);
  Collections.sort(keysList);
  Thread thread=Thread.currentThread();
  ClassLoader contextClassLoader=thread.getContextClassLoader();
  contextClassLoaders.putIfAbsent(thread.getName(),contextClassLoader != null);
  Map<String,String> result=new HashMap<String,String>();
  for (  String key : keys) {
    if (msPerLoad > 0) {
      try {
        Thread.sleep(msPerLoad);
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
    String value=store.get(key);
    if (value != null) {
      result.put(key,value);
    }
  }
  return result;
}
Program: 48010
Project: 48010
Buggy source:
@Override public Set<QueryableEntry> getSubRecords(ComparisonType comparisonType,Comparable searchedValue){
  MultiResultSet results=new MultiResultSet();
  indexStore.getSubRecords(results,comparisonType,convert(searchedValue));
  return results;
}

Fixed version (ground truth):
@Override public Set<QueryableEntry> getSubRecords(ComparisonType comparisonType,Comparable searchedValue){
  MultiResultSet results=new MultiResultSet();
  if (attributeType != null) {
    indexStore.getSubRecords(results,comparisonType,convert(searchedValue));
  }
  return results;
}
Program: 48011
Project: 48011
Buggy source:
@Override public void saveEntryIndex(QueryableEntry e) throws QueryException {
  Data key=e.getIndexKey();
  Comparable oldValue=recordValues.remove(key);
  Comparable newValue=e.getAttribute(attribute);
  if (newValue == null) {
    newValue=NULL;
  }
 else   if (newValue.getClass().isEnum()) {
    newValue=TypeConverters.ENUM_CONVERTER.convert(newValue);
  }
  recordValues.put(key,newValue);
  if (oldValue == null) {
    indexStore.newIndex(newValue,e);
  }
 else {
    indexStore.removeIndex(oldValue,key);
    indexStore.newIndex(newValue,e);
  }
  if (attributeType == null) {
    attributeType=e.getAttributeType(attribute);
  }
}

Fixed version (ground truth):
@Override public void saveEntryIndex(QueryableEntry e) throws QueryException {
  if (attributeType == null) {
    attributeType=e.getAttributeType(attribute);
  }
  Data key=e.getIndexKey();
  Comparable oldValue=recordValues.remove(key);
  Comparable newValue=e.getAttribute(attribute);
  if (newValue == null) {
    newValue=NULL;
  }
 else   if (newValue.getClass().isEnum()) {
    newValue=TypeConverters.ENUM_CONVERTER.convert(newValue);
  }
  recordValues.put(key,newValue);
  if (oldValue == null) {
    indexStore.newIndex(newValue,e);
  }
 else {
    indexStore.removeIndex(oldValue,key);
    indexStore.newIndex(newValue,e);
  }
}
Program: 48012
Project: 48012
Buggy source:
@Override public void clear(){
  recordValues.clear();
  indexStore.clear();
}

Fixed version (ground truth):
@Override public void clear(){
  recordValues.clear();
  indexStore.clear();
  attributeType=null;
}
Program: 48013
Project: 48013
Buggy source:
@Override public Set<QueryableEntry> getRecords(Comparable value){
  return indexStore.getRecords(convert(value));
}

Fixed version (ground truth):
@Override public Set<QueryableEntry> getRecords(Comparable value){
  if (attributeType != null) {
    return indexStore.getRecords(convert(value));
  }
 else {
    return new SingleResultSet(null);
  }
}
Program: 48014
Project: 48014
Buggy source:
@Override public Set<QueryableEntry> getSubRecordsBetween(Comparable from,Comparable to){
  MultiResultSet results=new MultiResultSet();
  indexStore.getSubRecordsBetween(results,convert(from),convert(to));
  return results;
}

Fixed version (ground truth):
@Override public Set<QueryableEntry> getSubRecordsBetween(Comparable from,Comparable to){
  MultiResultSet results=new MultiResultSet();
  if (attributeType != null) {
    indexStore.getSubRecordsBetween(results,convert(from),convert(to));
  }
  return results;
}
Program: 48015
Project: 48015
Buggy source:
protected MapEventPublishingService(MapServiceContext mapServiceContext){
  this.mapServiceContext=mapServiceContext;
  this.nodeEngine=mapServiceContext.getNodeEngine();
  this.logger=nodeEngine.getLogger(getClass());
}

Fixed version (ground truth):
protected MapEventPublishingService(MapServiceContext mapServiceContext){
  this.mapServiceContext=mapServiceContext;
  this.nodeEngine=mapServiceContext.getNodeEngine();
}