nus-yam/ex-repair huggingface dataset:
Program: 46956
Project: 46956
Buggy source:
@Override protected HazelcastClientCacheManager createHazelcastCacheManager(URI uri,ClassLoader classLoader,Properties properties){
  final HazelcastInstance instance;
  if (uri == null || uri.equals(getDefaultURI())) {
    if (hazelcastInstance == null) {
      try {
        hazelcastInstance=instanceFromProperties(classLoader,properties,true);
      }
 catch (      Exception e) {
        throw ExceptionUtil.rethrow(e);
      }
    }
    instance=hazelcastInstance;
  }
 else {
    try {
      instance=instanceFromProperties(classLoader,properties,false);
      if (instance == null) {
        throw new IllegalArgumentException(INVALID_HZ_INSTANCE_SPECIFICATION_MESSAGE);
      }
    }
 catch (    Exception e) {
      throw ExceptionUtil.rethrow(e);
    }
  }
  return new HazelcastClientCacheManager(this,instance,uri,classLoader,properties);
}

Fixed version (ground truth):
@Override protected HazelcastClientCacheManager createHazelcastCacheManager(URI uri,ClassLoader classLoader,Properties properties){
  final boolean isDefaultURI=(uri == null || uri.equals(getDefaultURI()));
  final HazelcastInstance instance;
  try {
    instance=getOrCreateInstance(classLoader,properties,isDefaultURI);
    if (instance == null) {
      throw new IllegalArgumentException(INVALID_HZ_INSTANCE_SPECIFICATION_MESSAGE);
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return new HazelcastClientCacheManager(this,instance,uri,classLoader,properties);
}
Program: 46957
Project: 46957
Buggy source:
@Override protected HazelcastClientCacheManager createHazelcastCacheManager(URI uri,ClassLoader classLoader,Properties properties){
  final HazelcastInstance instance;
  if (uri == null || uri.equals(getDefaultURI())) {
    if (hazelcastInstance == null) {
      try {
        hazelcastInstance=instanceFromProperties(classLoader,properties,true);
      }
 catch (      Exception e) {
        throw ExceptionUtil.rethrow(e);
      }
    }
    instance=hazelcastInstance;
  }
 else {
    try {
      instance=instanceFromProperties(classLoader,properties,false);
      if (instance == null) {
        throw new IllegalArgumentException(INVALID_HZ_INSTANCE_SPECIFICATION_MESSAGE);
      }
    }
 catch (    Exception e) {
      throw ExceptionUtil.rethrow(e);
    }
  }
  return new HazelcastClientCacheManager(this,instance,uri,classLoader,properties);
}

Fixed version (ground truth):
@Override protected HazelcastClientCacheManager createHazelcastCacheManager(URI uri,ClassLoader classLoader,Properties properties){
  final boolean isDefaultURI=(uri == null || uri.equals(getDefaultURI()));
  final HazelcastInstance instance;
  try {
    instance=getOrCreateInstance(classLoader,properties,isDefaultURI);
    if (instance == null) {
      throw new IllegalArgumentException(INVALID_HZ_INSTANCE_SPECIFICATION_MESSAGE);
    }
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
  return new HazelcastClientCacheManager(this,instance,uri,classLoader,properties);
}
Program: 46958
Project: 46958
Buggy source:
protected void testJoin(Config config) throws Exception {
  config.setProperty(GroupProperty.WAIT_SECONDS_BEFORE_JOIN,"String_Node_Str");
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  assertEquals(1,h1.getCluster().getMembers().size());
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  assertEquals(2,h1.getCluster().getMembers().size());
  assertEquals(2,h2.getCluster().getMembers().size());
  h1.shutdown();
  h1=Hazelcast.newHazelcastInstance(config);
  assertClusterSize(2,h1);
  assertClusterSize(2,h2);
}

Fixed version (ground truth):
protected void testJoin(Config config) throws Exception {
  config.setProperty(GroupProperty.WAIT_SECONDS_BEFORE_JOIN,"String_Node_Str");
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  assertEquals(1,h1.getCluster().getMembers().size());
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  assertEquals(2,h1.getCluster().getMembers().size());
  assertEquals(2,h2.getCluster().getMembers().size());
  h1.shutdown();
  h1=Hazelcast.newHazelcastInstance(config);
  assertClusterSize(2,h1);
  assertClusterSizeEventually(2,h2);
}
Program: 46959
Project: 46959
Buggy source:
public ClientReliableTopicConfig getReliableTopicConfig(String name){
  ClientReliableTopicConfig nearCacheConfig=lookupByPattern(reliableTopicConfigMap,name);
  if (nearCacheConfig == null) {
    nearCacheConfig=new ClientReliableTopicConfig(name);
    addReliableTopicConfig(nearCacheConfig);
  }
  return nearCacheConfig;
}

Fixed version (ground truth):
/** 
 * Gets the ClientReliableTopicConfig for a given reliable topic name.
 * @param name the name of the reliable topic
 * @return the found config. If none is found, a default configured one is returned.
 */
public ClientReliableTopicConfig getReliableTopicConfig(String name){
  ClientReliableTopicConfig nearCacheConfig=lookupByPattern(reliableTopicConfigMap,name);
  if (nearCacheConfig == null) {
    nearCacheConfig=new ClientReliableTopicConfig(name);
    addReliableTopicConfig(nearCacheConfig);
  }
  return nearCacheConfig;
}
Program: 46960
Project: 46960
Buggy source:
public ClientConfig addReliableTopicConfig(ClientReliableTopicConfig reliableTopicConfig){
  reliableTopicConfigMap.put(reliableTopicConfig.getName(),reliableTopicConfig);
  return this;
}

Fixed version (ground truth):
/** 
 * Adds a ClientReliableTopicConfig.
 * @param reliableTopicConfig the ClientReliableTopicConfig to add
 * @return configured {@link com.hazelcast.client.config.ClientConfig} for chaining
 */
public ClientConfig addReliableTopicConfig(ClientReliableTopicConfig reliableTopicConfig){
  reliableTopicConfigMap.put(reliableTopicConfig.getName(),reliableTopicConfig);
  return this;
}
Program: 46961
Project: 46961
Buggy source:
public ClientConfig addQueryCacheConfig(String mapName,QueryCacheConfig queryCacheConfig){
  Map<String,Map<String,QueryCacheConfig>> queryCacheConfigsPerMap=getQueryCacheConfigs();
  String cacheName=queryCacheConfig.getName();
  Map<String,QueryCacheConfig> queryCacheConfigs=queryCacheConfigsPerMap.get(mapName);
  if (queryCacheConfigs != null) {
    checkFalse(queryCacheConfigs.containsKey(cacheName),"String_Node_Str" + cacheName + ']');
  }
 else {
    queryCacheConfigs=new HashMap<String,QueryCacheConfig>();
    queryCacheConfigsPerMap.put(mapName,queryCacheConfigs);
  }
  queryCacheConfigs.put(cacheName,queryCacheConfig);
  return this;
}

Fixed version (ground truth):
public ClientConfig addQueryCacheConfig(String mapName,QueryCacheConfig queryCacheConfig){
  Map<String,Map<String,QueryCacheConfig>> queryCacheConfigsPerMap=getQueryCacheConfigs();
  String queryCacheName=queryCacheConfig.getName();
  Map<String,QueryCacheConfig> queryCacheConfigs=queryCacheConfigsPerMap.get(mapName);
  if (queryCacheConfigs != null) {
    checkFalse(queryCacheConfigs.containsKey(queryCacheName),"String_Node_Str" + queryCacheName + ']');
  }
 else {
    queryCacheConfigs=new ConcurrentHashMap<String,QueryCacheConfig>();
    queryCacheConfigsPerMap.put(mapName,queryCacheConfigs);
  }
  queryCacheConfigs.put(queryCacheName,queryCacheConfig);
  return this;
}
Program: 46962
Project: 46962
Buggy source:
public Map<String,Map<String,QueryCacheConfig>> getQueryCacheConfigs(){
  if (queryCacheConfigsPerMap == null) {
    queryCacheConfigsPerMap=new HashMap<String,Map<String,QueryCacheConfig>>();
  }
  return queryCacheConfigsPerMap;
}

Fixed version (ground truth):
public Map<String,Map<String,QueryCacheConfig>> getQueryCacheConfigs(){
  if (queryCacheConfigs == null) {
    queryCacheConfigs=new ConcurrentHashMap<String,Map<String,QueryCacheConfig>>();
  }
  return queryCacheConfigs;
}
Program: 46963
Project: 46963
Buggy source:
protected boolean tryEvict(Data key,Record record,RecordStore recordStore,boolean backup,long now){
  String mapName=recordStore.getName();
  Object value=record.getValue();
  if (recordStore.isLocked(key)) {
    return false;
  }
  recordStore.evict(key,backup);
  if (!backup) {
    boolean expired=recordStore.isExpired(record,now,false);
    recordStore.doPostEvictionOperations(key,value,expired);
  }
  return true;
}

Fixed version (ground truth):
protected boolean tryEvict(Data key,Record record,RecordStore recordStore,boolean backup,long now){
  Object value=record.getValue();
  if (recordStore.isLocked(key)) {
    return false;
  }
  recordStore.evict(key,backup);
  if (!backup) {
    boolean expired=recordStore.isExpired(record,now,false);
    recordStore.doPostEvictionOperations(key,value,expired);
  }
  return true;
}
Program: 46964
Project: 46964
Buggy source:
MapServiceContextImpl(NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  this.partitionContainers=createPartitionContainers();
  this.mapContainers=new ConcurrentHashMap<String,MapContainer>();
  this.ownedPartitions=new AtomicReference<Collection<Integer>>();
  this.expirationManager=new ExpirationManager(this,nodeEngine);
  this.evictor=createEvictor();
  this.nearCacheProvider=createNearCacheProvider();
  this.localMapStatsProvider=createLocalMapStatsProvider();
  this.mergePolicyProvider=new MergePolicyProvider(nodeEngine);
  this.mapEventPublisher=createMapEventPublisherSupport();
  this.mapQueryEngine=createMapQueryEngine();
  this.eventService=nodeEngine.getEventService();
  this.operationProvider=new DefaultMapOperationProvider();
}

Fixed version (ground truth):
MapServiceContextImpl(NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  this.partitionContainers=createPartitionContainers();
  this.mapContainers=new ConcurrentHashMap<String,MapContainer>();
  this.ownedPartitions=new AtomicReference<Collection<Integer>>();
  this.expirationManager=new ExpirationManager(this,nodeEngine);
  this.nearCacheProvider=createNearCacheProvider();
  this.localMapStatsProvider=createLocalMapStatsProvider();
  this.mergePolicyProvider=new MergePolicyProvider(nodeEngine);
  this.mapEventPublisher=createMapEventPublisherSupport();
  this.mapQueryEngine=createMapQueryEngine();
  this.eventService=nodeEngine.getEventService();
  this.operationProvider=new DefaultMapOperationProvider();
}
Program: 46965
Project: 46965
Buggy source:
@Override public Object remove(Data key){
  R record=records.remove(key);
  updateSizeEstimator(-calculateHeapCost(record));
  updateSizeEstimator(-calculateHeapCost(key));
  Object oldValue=record.getValue();
  if (record != null) {
    record.invalidate();
  }
  return oldValue;
}

Fixed version (ground truth):
@Override public Object remove(Data key){
  R record=records.remove(key);
  if (record == null) {
    return null;
  }
  updateSizeEstimator(-calculateHeapCost(record));
  updateSizeEstimator(-calculateHeapCost(key));
  Object oldValue=record.getValue();
  record.invalidate();
  return oldValue;
}
Program: 46966
Project: 46966
Buggy source:
private void sleep(){
  try {
    Thread.sleep(DELAY_MILLIS);
  }
 catch (  InterruptedException ignore) {
    EmptyStatement.ignore(ignore);
  }
}

Fixed version (ground truth):
private void sleep(){
  try {
    Thread.sleep(SCAN_DELAY_MILLIS);
  }
 catch (  InterruptedException ignore) {
    EmptyStatement.ignore(ignore);
  }
}
Program: 46967
Project: 46967
Buggy source:
public InvocationMonitor(InvocationRegistry invocationRegistry,ILogger logger,GroupProperties props,HazelcastThreadGroup hzThreadGroup,ExecutionService executionService,MetricsRegistry metricsRegistry){
  this.invocationRegistry=invocationRegistry;
  this.logger=logger;
  this.monitorThread=new MonitorThread(hzThreadGroup);
  this.executionService=executionService;
  monitorThread.start();
  this.backupTimeoutMillis=props.getMillis(GroupProperty.OPERATION_BACKUP_TIMEOUT_MILLIS);
  this.slowInvocationThresholdMs=initSlowInvocationThresholdMs(props);
  metricsRegistry.scanAndRegister(this,"String_Node_Str");
}

Fixed version (ground truth):
public InvocationMonitor(InvocationRegistry invocationRegistry,ILogger logger,GroupProperties props,HazelcastThreadGroup hzThreadGroup,ExecutionService executionService,MetricsRegistry metricsRegistry){
  this.invocationRegistry=invocationRegistry;
  this.logger=logger;
  this.executionService=executionService;
  this.backupTimeoutMillis=props.getMillis(GroupProperty.OPERATION_BACKUP_TIMEOUT_MILLIS);
  this.slowInvocationThresholdMs=initSlowInvocationThresholdMs(props);
  this.monitorThread=new MonitorThread(hzThreadGroup);
  metricsRegistry.scanAndRegister(this,"String_Node_Str");
  monitorThread.start();
}
Program: 46968
Project: 46968
Buggy source:
@Override public void run() throws Exception {
  if (!valid) {
    return;
  }
  NodeEngine nodeEngine=getNodeEngine();
  if (backupOp == null && backupOpData != null) {
    backupOp=nodeEngine.getSerializationService().toObject(backupOpData);
  }
  if (backupOp != null) {
    backupOp.setPartitionId(getPartitionId()).setReplicaIndex(getReplicaIndex());
    backupOp.setNodeEngine(nodeEngine);
    backupOp.setCallerUuid(getCallerUuid());
    OperationAccessor.setCallerAddress(backupOp,getCallerAddress());
    OperationAccessor.setInvocationTime(backupOp,Clock.currentTimeMillis());
    backupOp.setOperationResponseHandler(createEmptyResponseHandler());
    backupOp.beforeRun();
    backupOp.run();
    backupOp.afterRun();
  }
  InternalPartitionService partitionService=nodeEngine.getPartitionService();
  partitionService.updatePartitionReplicaVersions(getPartitionId(),replicaVersions,getReplicaIndex());
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  if (!valid) {
    onExecutionFailure(new IllegalStateException("String_Node_Str" + toString() + "String_Node_Str"));
    return;
  }
  NodeEngine nodeEngine=getNodeEngine();
  if (backupOp == null && backupOpData != null) {
    backupOp=nodeEngine.getSerializationService().toObject(backupOpData);
  }
  if (backupOp != null) {
    ensureBackupOperationInitialized();
    backupOp.beforeRun();
    backupOp.run();
    backupOp.afterRun();
  }
  InternalPartitionService partitionService=nodeEngine.getPartitionService();
  partitionService.updatePartitionReplicaVersions(getPartitionId(),replicaVersions,getReplicaIndex());
}
Program: 46969
Project: 46969
Buggy source:
@Override public void logError(Throwable e){
  if (backupOp != null) {
    if (backupOp.getNodeEngine() == null) {
      backupOp.setNodeEngine(getNodeEngine());
    }
    backupOp.logError(e);
  }
 else {
    ReplicaErrorLogger.log(e,getLogger());
  }
}

Fixed version (ground truth):
@Override public void logError(Throwable e){
  if (backupOp != null) {
    ensureBackupOperationInitialized();
    backupOp.logError(e);
  }
 else {
    ReplicaErrorLogger.log(e,getLogger());
  }
}
Program: 46970
Project: 46970
Buggy source:
@Override public void onExecutionFailure(Throwable e){
  if (backupOp != null) {
    try {
      if (backupOp.getNodeEngine() == null) {
        backupOp.setNodeEngine(getNodeEngine());
      }
      backupOp.onExecutionFailure(e);
    }
 catch (    Throwable t) {
      getLogger().warning("String_Node_Str" + backupOp,t);
    }
  }
}

Fixed version (ground truth):
@Override public void onExecutionFailure(Throwable e){
  if (backupOp != null) {
    try {
      ensureBackupOperationInitialized();
      backupOp.onExecutionFailure(e);
    }
 catch (    Throwable t) {
      getLogger().warning("String_Node_Str" + backupOp,t);
    }
  }
}
Program: 46971
Project: 46971
Buggy source:
public ReplicatedMapService(NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  this.config=nodeEngine.getConfig();
  this.partitionService=(InternalPartitionServiceImpl)nodeEngine.getPartitionService();
  this.clusterService=(ClusterServiceImpl)nodeEngine.getClusterService();
  this.operationService=nodeEngine.getOperationService();
  this.partitionContainers=new PartitionContainer[nodeEngine.getPartitionService().getPartitionCount()];
  this.eventPublishingService=new ReplicatedMapEventPublishingService(this);
  this.mergePolicyProvider=new MergePolicyProvider(nodeEngine);
  this.replicatedMapSplitBrainHandlerService=new ReplicatedMapSplitBrainHandlerService(this,mergePolicyProvider,partitionContainers);
}

Fixed version (ground truth):
public ReplicatedMapService(NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  this.config=nodeEngine.getConfig();
  this.partitionService=(InternalPartitionServiceImpl)nodeEngine.getPartitionService();
  this.clusterService=(ClusterServiceImpl)nodeEngine.getClusterService();
  this.operationService=nodeEngine.getOperationService();
  this.partitionContainers=new PartitionContainer[nodeEngine.getPartitionService().getPartitionCount()];
  this.eventPublishingService=new ReplicatedMapEventPublishingService(this);
  this.mergePolicyProvider=new MergePolicyProvider(nodeEngine);
  this.replicatedMapSplitBrainHandlerService=new ReplicatedMapSplitBrainHandlerService(this,mergePolicyProvider);
}
Program: 46972
Project: 46972
Buggy source:
@Override public void run(){
  if (clusterService.getSize() == 1) {
    return;
  }
  Collection<Address> addresses=new ArrayList<Address>(getMemberAddresses(DATA_MEMBER_SELECTOR));
  addresses.remove(nodeEngine.getThisAddress());
  for (int i=0; i < partitionContainers.length; i++) {
    Address thisAddress=nodeEngine.getThisAddress();
    InternalPartition partition=partitionService.getPartition(i,false);
    Address ownerAddress=partition.getOwnerOrNull();
    if (!thisAddress.equals(ownerAddress)) {
      continue;
    }
    PartitionContainer partitionContainer=partitionContainers[i];
    for (    Address address : addresses) {
      CheckReplicaVersion checkReplicaVersion=new CheckReplicaVersion(partitionContainer);
      checkReplicaVersion.setPartitionId(i);
      checkReplicaVersion.setValidateTarget(false);
      operationService.invokeOnTarget(SERVICE_NAME,checkReplicaVersion,address);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (clusterService.getSize() == 1) {
    return;
  }
  Collection<Address> addresses=new ArrayList<Address>(getMemberAddresses(DATA_MEMBER_SELECTOR));
  addresses.remove(nodeEngine.getThisAddress());
  for (int i=0; i < partitionContainers.length; i++) {
    Address thisAddress=nodeEngine.getThisAddress();
    InternalPartition partition=partitionService.getPartition(i,false);
    Address ownerAddress=partition.getOwnerOrNull();
    if (!thisAddress.equals(ownerAddress)) {
      continue;
    }
    PartitionContainer partitionContainer=partitionContainers[i];
    if (partitionContainer.isEmpty()) {
      continue;
    }
    for (    Address address : addresses) {
      CheckReplicaVersion checkReplicaVersion=new CheckReplicaVersion(partitionContainer);
      checkReplicaVersion.setPartitionId(i);
      checkReplicaVersion.setValidateTarget(false);
      operationService.invokeOnTarget(SERVICE_NAME,checkReplicaVersion,address);
    }
  }
}
Program: 46973
Project: 46973
Buggy source:
@Override public void init(final NodeEngine nodeEngine,Properties properties){
  if (config.isLiteMember()) {
    return;
  }
  for (int i=0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
    partitionContainers[i]=new PartitionContainer(this,i);
  }
  nodeEngine.getExecutionService().getDefaultScheduledExecutor().scheduleWithFixedDelay(new Runnable(){
    @Override public void run(){
      if (clusterService.getSize() == 1) {
        return;
      }
      Collection<Address> addresses=new ArrayList<Address>(getMemberAddresses(DATA_MEMBER_SELECTOR));
      addresses.remove(nodeEngine.getThisAddress());
      for (int i=0; i < partitionContainers.length; i++) {
        Address thisAddress=nodeEngine.getThisAddress();
        InternalPartition partition=partitionService.getPartition(i,false);
        Address ownerAddress=partition.getOwnerOrNull();
        if (!thisAddress.equals(ownerAddress)) {
          continue;
        }
        PartitionContainer partitionContainer=partitionContainers[i];
        for (        Address address : addresses) {
          CheckReplicaVersion checkReplicaVersion=new CheckReplicaVersion(partitionContainer);
          checkReplicaVersion.setPartitionId(i);
          checkReplicaVersion.setValidateTarget(false);
          operationService.invokeOnTarget(SERVICE_NAME,checkReplicaVersion,address);
        }
      }
    }
  }
,0,SYNC_INTERVAL_SECONDS,TimeUnit.SECONDS);
}

Fixed version (ground truth):
@Override public void init(final NodeEngine nodeEngine,Properties properties){
  if (config.isLiteMember()) {
    return;
  }
  for (int i=0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
    partitionContainers[i]=new PartitionContainer(this,i);
  }
  nodeEngine.getExecutionService().getDefaultScheduledExecutor().scheduleWithFixedDelay(new Runnable(){
    @Override public void run(){
      if (clusterService.getSize() == 1) {
        return;
      }
      Collection<Address> addresses=new ArrayList<Address>(getMemberAddresses(DATA_MEMBER_SELECTOR));
      addresses.remove(nodeEngine.getThisAddress());
      for (int i=0; i < partitionContainers.length; i++) {
        Address thisAddress=nodeEngine.getThisAddress();
        InternalPartition partition=partitionService.getPartition(i,false);
        Address ownerAddress=partition.getOwnerOrNull();
        if (!thisAddress.equals(ownerAddress)) {
          continue;
        }
        PartitionContainer partitionContainer=partitionContainers[i];
        if (partitionContainer.isEmpty()) {
          continue;
        }
        for (        Address address : addresses) {
          CheckReplicaVersion checkReplicaVersion=new CheckReplicaVersion(partitionContainer);
          checkReplicaVersion.setPartitionId(i);
          checkReplicaVersion.setValidateTarget(false);
          operationService.invokeOnTarget(SERVICE_NAME,checkReplicaVersion,address);
        }
      }
    }
  }
,0,SYNC_INTERVAL_SECONDS,TimeUnit.SECONDS);
}
Program: 46974
Project: 46974
Buggy source:
public ReplicatedMapSplitBrainHandlerService(ReplicatedMapService replicatedMapService,MergePolicyProvider mergePolicyProvider,PartitionContainer[] partitionContainers){
  this.replicatedMapService=replicatedMapService;
  this.mergePolicyProvider=mergePolicyProvider;
  this.partitionContainers=partitionContainers;
  this.nodeEngine=replicatedMapService.getNodeEngine();
  this.serializationService=nodeEngine.getSerializationService();
}

Fixed version (ground truth):
public ReplicatedMapSplitBrainHandlerService(ReplicatedMapService service,MergePolicyProvider mergePolicyProvider){
  this.service=service;
  this.mergePolicyProvider=mergePolicyProvider;
  this.nodeEngine=service.getNodeEngine();
  this.serializationService=nodeEngine.getSerializationService();
}
Program: 46975
Project: 46975
Buggy source:
@Override public Runnable prepareMergeRunnable(){
  HashMap<String,Collection<ReplicatedRecord>> recordMap=new HashMap<String,Collection<ReplicatedRecord>>();
  Address thisAddress=replicatedMapService.getNodeEngine().getThisAddress();
  List<Integer> partitions=nodeEngine.getPartitionService().getMemberPartitions(thisAddress);
  for (  Integer partition : partitions) {
    PartitionContainer partitionContainer=partitionContainers[partition];
    ConcurrentMap<String,ReplicatedRecordStore> stores=partitionContainer.getStores();
    for (    ReplicatedRecordStore store : stores.values()) {
      String name=store.getName();
      Collection<ReplicatedRecord> records=recordMap.get(name);
      if (records == null) {
        records=new ArrayList<ReplicatedRecord>();
      }
      Iterator<ReplicatedRecord> iterator=store.recordIterator();
      while (iterator.hasNext()) {
        ReplicatedRecord record=iterator.next();
        records.add(record);
      }
      recordMap.put(name,records);
      store.reset();
    }
  }
  return new Merger(recordMap);
}

Fixed version (ground truth):
@Override public Runnable prepareMergeRunnable(){
  HashMap<String,Collection<ReplicatedRecord>> recordMap=new HashMap<String,Collection<ReplicatedRecord>>();
  Address thisAddress=service.getNodeEngine().getThisAddress();
  List<Integer> partitions=nodeEngine.getPartitionService().getMemberPartitions(thisAddress);
  for (  Integer partition : partitions) {
    PartitionContainer partitionContainer=service.getPartitionContainer(partition);
    ConcurrentMap<String,ReplicatedRecordStore> stores=partitionContainer.getStores();
    for (    ReplicatedRecordStore store : stores.values()) {
      String name=store.getName();
      Collection<ReplicatedRecord> records=recordMap.get(name);
      if (records == null) {
        records=new ArrayList<ReplicatedRecord>();
      }
      Iterator<ReplicatedRecord> iterator=store.recordIterator();
      while (iterator.hasNext()) {
        ReplicatedRecord record=iterator.next();
        records.add(record);
      }
      recordMap.put(name,records);
      store.reset();
    }
  }
  return new Merger(recordMap);
}
Program: 46977
Project: 46977
Buggy source:
@Override public void run() throws Exception {
  ReplicatedMapService service=getService();
  ReplicatedRecordStore store=service.getReplicatedRecordStore(name,true,key);
  merge=store.merge(key,entryView,policy);
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  ReplicatedMapService service=getService();
  ReplicatedRecordStore store=service.getReplicatedRecordStore(name,true,key);
  store.merge(key,entryView,policy);
}
Program: 46978
Project: 46978
Buggy source:
@Override public ReplicatedRecord<K,V> next(){
  Map.Entry<K,ReplicatedRecord<K,V>> entry=this.entry;
  Object key=entry != null ? entry.getKey() : null;
  Object value=entry != null && entry.getValue() != null ? entry.getValue().getValue() : null;
  ReplicatedRecord<K,V> record=entry.getValue();
  while (entry == null) {
    entry=findNextEntry();
    key=entry.getKey();
    record=entry.getValue();
    value=record != null ? record.getValue() : null;
    if (key != null && value != null) {
      break;
    }
  }
  this.entry=null;
  if (key == null || value == null) {
    throw new NoSuchElementException();
  }
  return record;
}

Fixed version (ground truth):
@Override public ReplicatedRecord<K,V> next(){
  Map.Entry<K,ReplicatedRecord<K,V>> entry=this.entry;
  ReplicatedRecord<K,V> record=entry != null ? entry.getValue() : null;
  while (entry == null) {
    entry=findNextEntry();
    Object key=entry.getKey();
    record=entry.getValue();
    Object value=record != null ? record.getValue() : null;
    if (key != null && value != null) {
      break;
    }
  }
  this.entry=null;
  return record;
}
Program: 46979
Project: 46979
Buggy source:
public ReplicatedMapService(NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  this.config=nodeEngine.getConfig();
  this.partitionService=(InternalPartitionServiceImpl)nodeEngine.getPartitionService();
  this.clusterService=(ClusterServiceImpl)nodeEngine.getClusterService();
  this.operationService=nodeEngine.getOperationService();
  this.partitionContainers=new PartitionContainer[nodeEngine.getPartitionService().getPartitionCount()];
  this.eventPublishingService=new ReplicatedMapEventPublishingService(this);
  this.mergePolicyProvider=new MergePolicyProvider(nodeEngine);
  this.replicatedMapSplitBrainHandlerService=new ReplicatedMapSplitBrainHandlerService(this,mergePolicyProvider,partitionContainers);
}

Fixed version (ground truth):
public ReplicatedMapService(NodeEngine nodeEngine){
  this.nodeEngine=nodeEngine;
  this.config=nodeEngine.getConfig();
  this.partitionService=(InternalPartitionServiceImpl)nodeEngine.getPartitionService();
  this.clusterService=(ClusterServiceImpl)nodeEngine.getClusterService();
  this.operationService=nodeEngine.getOperationService();
  this.partitionContainers=new PartitionContainer[nodeEngine.getPartitionService().getPartitionCount()];
  this.eventPublishingService=new ReplicatedMapEventPublishingService(this);
  this.mergePolicyProvider=new MergePolicyProvider(nodeEngine);
  this.replicatedMapSplitBrainHandlerService=new ReplicatedMapSplitBrainHandlerService(this,mergePolicyProvider);
}
Program: 46980
Project: 46980
Buggy source:
@Override public void run(){
  if (clusterService.getSize() == 1) {
    return;
  }
  Collection<Address> addresses=new ArrayList<Address>(getMemberAddresses(DATA_MEMBER_SELECTOR));
  addresses.remove(nodeEngine.getThisAddress());
  for (int i=0; i < partitionContainers.length; i++) {
    Address thisAddress=nodeEngine.getThisAddress();
    InternalPartition partition=partitionService.getPartition(i,false);
    Address ownerAddress=partition.getOwnerOrNull();
    if (!thisAddress.equals(ownerAddress)) {
      continue;
    }
    PartitionContainer partitionContainer=partitionContainers[i];
    for (    Address address : addresses) {
      CheckReplicaVersion checkReplicaVersion=new CheckReplicaVersion(partitionContainer);
      checkReplicaVersion.setPartitionId(i);
      checkReplicaVersion.setValidateTarget(false);
      operationService.invokeOnTarget(SERVICE_NAME,checkReplicaVersion,address);
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (clusterService.getSize() == 1) {
    return;
  }
  Collection<Address> addresses=new ArrayList<Address>(getMemberAddresses(DATA_MEMBER_SELECTOR));
  addresses.remove(nodeEngine.getThisAddress());
  for (int i=0; i < partitionContainers.length; i++) {
    Address thisAddress=nodeEngine.getThisAddress();
    InternalPartition partition=partitionService.getPartition(i,false);
    Address ownerAddress=partition.getOwnerOrNull();
    if (!thisAddress.equals(ownerAddress)) {
      continue;
    }
    PartitionContainer partitionContainer=partitionContainers[i];
    if (partitionContainer.isEmpty()) {
      continue;
    }
    for (    Address address : addresses) {
      CheckReplicaVersion checkReplicaVersion=new CheckReplicaVersion(partitionContainer);
      checkReplicaVersion.setPartitionId(i);
      checkReplicaVersion.setValidateTarget(false);
      operationService.invokeOnTarget(SERVICE_NAME,checkReplicaVersion,address);
    }
  }
}
Program: 46981
Project: 46981
Buggy source:
@Override public void init(final NodeEngine nodeEngine,Properties properties){
  if (config.isLiteMember()) {
    return;
  }
  for (int i=0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
    partitionContainers[i]=new PartitionContainer(this,i);
  }
  nodeEngine.getExecutionService().getDefaultScheduledExecutor().scheduleWithFixedDelay(new Runnable(){
    @Override public void run(){
      if (clusterService.getSize() == 1) {
        return;
      }
      Collection<Address> addresses=new ArrayList<Address>(getMemberAddresses(DATA_MEMBER_SELECTOR));
      addresses.remove(nodeEngine.getThisAddress());
      for (int i=0; i < partitionContainers.length; i++) {
        Address thisAddress=nodeEngine.getThisAddress();
        InternalPartition partition=partitionService.getPartition(i,false);
        Address ownerAddress=partition.getOwnerOrNull();
        if (!thisAddress.equals(ownerAddress)) {
          continue;
        }
        PartitionContainer partitionContainer=partitionContainers[i];
        for (        Address address : addresses) {
          CheckReplicaVersion checkReplicaVersion=new CheckReplicaVersion(partitionContainer);
          checkReplicaVersion.setPartitionId(i);
          checkReplicaVersion.setValidateTarget(false);
          operationService.invokeOnTarget(SERVICE_NAME,checkReplicaVersion,address);
        }
      }
    }
  }
,0,SYNC_INTERVAL_SECONDS,TimeUnit.SECONDS);
}

Fixed version (ground truth):
@Override public void init(final NodeEngine nodeEngine,Properties properties){
  if (config.isLiteMember()) {
    return;
  }
  for (int i=0; i < nodeEngine.getPartitionService().getPartitionCount(); i++) {
    partitionContainers[i]=new PartitionContainer(this,i);
  }
  nodeEngine.getExecutionService().getDefaultScheduledExecutor().scheduleWithFixedDelay(new Runnable(){
    @Override public void run(){
      if (clusterService.getSize() == 1) {
        return;
      }
      Collection<Address> addresses=new ArrayList<Address>(getMemberAddresses(DATA_MEMBER_SELECTOR));
      addresses.remove(nodeEngine.getThisAddress());
      for (int i=0; i < partitionContainers.length; i++) {
        Address thisAddress=nodeEngine.getThisAddress();
        InternalPartition partition=partitionService.getPartition(i,false);
        Address ownerAddress=partition.getOwnerOrNull();
        if (!thisAddress.equals(ownerAddress)) {
          continue;
        }
        PartitionContainer partitionContainer=partitionContainers[i];
        if (partitionContainer.isEmpty()) {
          continue;
        }
        for (        Address address : addresses) {
          CheckReplicaVersion checkReplicaVersion=new CheckReplicaVersion(partitionContainer);
          checkReplicaVersion.setPartitionId(i);
          checkReplicaVersion.setValidateTarget(false);
          operationService.invokeOnTarget(SERVICE_NAME,checkReplicaVersion,address);
        }
      }
    }
  }
,0,SYNC_INTERVAL_SECONDS,TimeUnit.SECONDS);
}
Program: 46982
Project: 46982
Buggy source:
public ReplicatedMapSplitBrainHandlerService(ReplicatedMapService replicatedMapService,MergePolicyProvider mergePolicyProvider,PartitionContainer[] partitionContainers){
  this.replicatedMapService=replicatedMapService;
  this.mergePolicyProvider=mergePolicyProvider;
  this.partitionContainers=partitionContainers;
  this.nodeEngine=replicatedMapService.getNodeEngine();
  this.serializationService=nodeEngine.getSerializationService();
}

Fixed version (ground truth):
public ReplicatedMapSplitBrainHandlerService(ReplicatedMapService service,MergePolicyProvider mergePolicyProvider){
  this.service=service;
  this.mergePolicyProvider=mergePolicyProvider;
  this.nodeEngine=service.getNodeEngine();
  this.serializationService=nodeEngine.getSerializationService();
}
Program: 46983
Project: 46983
Buggy source:
@Override public Runnable prepareMergeRunnable(){
  HashMap<String,Collection<ReplicatedRecord>> recordMap=new HashMap<String,Collection<ReplicatedRecord>>();
  Address thisAddress=replicatedMapService.getNodeEngine().getThisAddress();
  List<Integer> partitions=nodeEngine.getPartitionService().getMemberPartitions(thisAddress);
  for (  Integer partition : partitions) {
    PartitionContainer partitionContainer=partitionContainers[partition];
    ConcurrentMap<String,ReplicatedRecordStore> stores=partitionContainer.getStores();
    for (    ReplicatedRecordStore store : stores.values()) {
      String name=store.getName();
      Collection<ReplicatedRecord> records=recordMap.get(name);
      if (records == null) {
        records=new ArrayList<ReplicatedRecord>();
      }
      Iterator<ReplicatedRecord> iterator=store.recordIterator();
      while (iterator.hasNext()) {
        ReplicatedRecord record=iterator.next();
        records.add(record);
      }
      recordMap.put(name,records);
      store.reset();
    }
  }
  return new Merger(recordMap);
}

Fixed version (ground truth):
@Override public Runnable prepareMergeRunnable(){
  HashMap<String,Collection<ReplicatedRecord>> recordMap=new HashMap<String,Collection<ReplicatedRecord>>();
  Address thisAddress=service.getNodeEngine().getThisAddress();
  List<Integer> partitions=nodeEngine.getPartitionService().getMemberPartitions(thisAddress);
  for (  Integer partition : partitions) {
    PartitionContainer partitionContainer=service.getPartitionContainer(partition);
    ConcurrentMap<String,ReplicatedRecordStore> stores=partitionContainer.getStores();
    for (    ReplicatedRecordStore store : stores.values()) {
      String name=store.getName();
      Collection<ReplicatedRecord> records=recordMap.get(name);
      if (records == null) {
        records=new ArrayList<ReplicatedRecord>();
      }
      Iterator<ReplicatedRecord> iterator=store.recordIterator();
      while (iterator.hasNext()) {
        ReplicatedRecord record=iterator.next();
        records.add(record);
      }
      recordMap.put(name,records);
      store.reset();
    }
  }
  return new Merger(recordMap);
}
Program: 46985
Project: 46985
Buggy source:
@Override public void run() throws Exception {
  ReplicatedMapService service=getService();
  ReplicatedRecordStore store=service.getReplicatedRecordStore(name,true,key);
  merge=store.merge(key,entryView,policy);
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  ReplicatedMapService service=getService();
  ReplicatedRecordStore store=service.getReplicatedRecordStore(name,true,key);
  store.merge(key,entryView,policy);
}
Program: 46986
Project: 46986
Buggy source:
@Override public ReplicatedRecord<K,V> next(){
  Map.Entry<K,ReplicatedRecord<K,V>> entry=this.entry;
  Object key=entry != null ? entry.getKey() : null;
  Object value=entry != null && entry.getValue() != null ? entry.getValue().getValue() : null;
  ReplicatedRecord<K,V> record=entry.getValue();
  while (entry == null) {
    entry=findNextEntry();
    key=entry.getKey();
    record=entry.getValue();
    value=record != null ? record.getValue() : null;
    if (key != null && value != null) {
      break;
    }
  }
  this.entry=null;
  if (key == null || value == null) {
    throw new NoSuchElementException();
  }
  return record;
}

Fixed version (ground truth):
@Override public ReplicatedRecord<K,V> next(){
  Map.Entry<K,ReplicatedRecord<K,V>> entry=this.entry;
  ReplicatedRecord<K,V> record=entry != null ? entry.getValue() : null;
  while (entry == null) {
    entry=findNextEntry();
    Object key=entry.getKey();
    record=entry.getValue();
    Object value=record != null ? record.getValue() : null;
    if (key != null && value != null) {
      break;
    }
  }
  this.entry=null;
  return record;
}
Program: 46987
Project: 46987
Buggy source:
@Override public void run() throws Exception {
  MapService mapService=getService();
  MapContainer mapContainer=mapService.getMapServiceContext().getMapContainer(name);
  RecordStore recordStore=mapService.getMapServiceContext().getPartitionContainer(getPartitionId()).getRecordStore(name);
  Indexes indexes=mapContainer.getIndexes();
  Index index=indexes.addOrGetIndex(attributeName,ordered);
  MapServiceContext serviceContext=mapContainer.getMapServiceContext();
  final long now=getNow();
  final Iterator<Record> iterator=recordStore.iterator(now,false);
  SerializationService serializationService=getNodeEngine().getSerializationService();
  while (iterator.hasNext()) {
    final Record record=iterator.next();
    Data key=record.getKey();
    Object value=Records.getValueOrCachedValue(record,serializationService);
    QueryableEntry queryEntry=mapContainer.newQueryEntry(key,value);
    index.saveEntryIndex(queryEntry,null);
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  MapService mapService=getService();
  MapContainer mapContainer=mapService.getMapServiceContext().getMapContainer(name);
  RecordStore recordStore=mapService.getMapServiceContext().getPartitionContainer(getPartitionId()).getRecordStore(name);
  Indexes indexes=mapContainer.getIndexes();
  Index index=indexes.addOrGetIndex(attributeName,ordered);
  final long now=getNow();
  final Iterator<Record> iterator=recordStore.iterator(now,false);
  SerializationService serializationService=getNodeEngine().getSerializationService();
  while (iterator.hasNext()) {
    final Record record=iterator.next();
    Data key=record.getKey();
    Object value=Records.getValueOrCachedValue(record,serializationService);
    QueryableEntry queryEntry=mapContainer.newQueryEntry(key,value);
    index.saveEntryIndex(queryEntry,null);
  }
}
Program: 46988
Project: 46988
Buggy source:
@Override public boolean delete(Data key){
  checkIfLoaded();
  final long now=getNow();
  final Record record=getRecordOrNull(key,now,false);
  if (record == null) {
    removeIndex(record);
    mapDataStore.remove(key,now);
  }
 else {
    return removeRecord(key,record,now) != null;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean delete(Data key){
  checkIfLoaded();
  final long now=getNow();
  final Record record=getRecordOrNull(key,now,false);
  if (record == null) {
    mapDataStore.remove(key,now);
  }
 else {
    return removeRecord(key,record,now) != null;
  }
  return false;
}
Program: 46989
Project: 46989
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public Collection values(Predicate predicate){
  checkTransactionState();
  checkNotNull(predicate,"String_Node_Str");
  checkNotInstanceOf(PagingPredicate.class,predicate,"String_Node_Str");
  SerializationService serializationService=getNodeEngine().getSerializationService();
  QueryResultSet queryResultSet=(QueryResultSet)queryInternal(predicate,IterationType.ENTRY,false);
  List<Object> valueSet=new ArrayList<Object>();
  Set<Object> keyWontBeIncluded=new HashSet<Object>();
  MapServiceContext mapServiceContext=getService().getMapServiceContext();
  for (  Map.Entry<Data,TxnValueWrapper> entry : txMap.entrySet()) {
    boolean isRemoved=TxnValueWrapper.Type.REMOVED.equals(entry.getValue().type);
    boolean isUpdated=TxnValueWrapper.Type.UPDATED.equals(entry.getValue().type);
    Object keyObject=serializationService.toObject(entry.getKey());
    if (isRemoved) {
      keyWontBeIncluded.add(keyObject);
    }
 else {
      if (isUpdated) {
        keyWontBeIncluded.add(keyObject);
      }
      Object entryValue=entry.getValue().value;
      QueryableEntry queryEntry=new CachedQueryEntry(serializationService,entry.getKey(),entryValue);
      if (predicate.apply(queryEntry)) {
        valueSet.add(queryEntry.getValue());
      }
    }
  }
  removeFromResultSet(queryResultSet,valueSet,keyWontBeIncluded);
  return valueSet;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public Collection values(Predicate predicate){
  checkTransactionState();
  checkNotNull(predicate,"String_Node_Str");
  checkNotInstanceOf(PagingPredicate.class,predicate,"String_Node_Str");
  SerializationService serializationService=getNodeEngine().getSerializationService();
  QueryResultSet queryResultSet=(QueryResultSet)queryInternal(predicate,IterationType.ENTRY,false);
  List<Object> valueSet=new ArrayList<Object>();
  Set<Object> keyWontBeIncluded=new HashSet<Object>();
  for (  Map.Entry<Data,TxnValueWrapper> entry : txMap.entrySet()) {
    boolean isRemoved=TxnValueWrapper.Type.REMOVED.equals(entry.getValue().type);
    boolean isUpdated=TxnValueWrapper.Type.UPDATED.equals(entry.getValue().type);
    Object keyObject=serializationService.toObject(entry.getKey());
    if (isRemoved) {
      keyWontBeIncluded.add(keyObject);
    }
 else {
      if (isUpdated) {
        keyWontBeIncluded.add(keyObject);
      }
      Object entryValue=entry.getValue().value;
      QueryableEntry queryEntry=new CachedQueryEntry(serializationService,entry.getKey(),entryValue);
      if (predicate.apply(queryEntry)) {
        valueSet.add(queryEntry.getValue());
      }
    }
  }
  removeFromResultSet(queryResultSet,valueSet,keyWontBeIncluded);
  return valueSet;
}
Program: 46990
Project: 46990
Buggy source:
@Override public void run() throws Exception {
  MapService mapService=getService();
  MapContainer mapContainer=mapService.getMapServiceContext().getMapContainer(name);
  RecordStore recordStore=mapService.getMapServiceContext().getPartitionContainer(getPartitionId()).getRecordStore(name);
  Indexes indexes=mapContainer.getIndexes();
  Index index=indexes.addOrGetIndex(attributeName,ordered);
  MapServiceContext serviceContext=mapContainer.getMapServiceContext();
  final long now=getNow();
  final Iterator<Record> iterator=recordStore.iterator(now,false);
  SerializationService serializationService=getNodeEngine().getSerializationService();
  while (iterator.hasNext()) {
    final Record record=iterator.next();
    Data key=record.getKey();
    Object value=Records.getValueOrCachedValue(record,serializationService);
    QueryableEntry queryEntry=mapContainer.newQueryEntry(key,value);
    index.saveEntryIndex(queryEntry,null);
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  MapService mapService=getService();
  MapContainer mapContainer=mapService.getMapServiceContext().getMapContainer(name);
  RecordStore recordStore=mapService.getMapServiceContext().getPartitionContainer(getPartitionId()).getRecordStore(name);
  Indexes indexes=mapContainer.getIndexes();
  Index index=indexes.addOrGetIndex(attributeName,ordered);
  final long now=getNow();
  final Iterator<Record> iterator=recordStore.iterator(now,false);
  SerializationService serializationService=getNodeEngine().getSerializationService();
  while (iterator.hasNext()) {
    final Record record=iterator.next();
    Data key=record.getKey();
    Object value=Records.getValueOrCachedValue(record,serializationService);
    QueryableEntry queryEntry=mapContainer.newQueryEntry(key,value);
    index.saveEntryIndex(queryEntry,null);
  }
}
Program: 46991
Project: 46991
Buggy source:
@Override public boolean delete(Data key){
  checkIfLoaded();
  final long now=getNow();
  final Record record=getRecordOrNull(key,now,false);
  if (record == null) {
    removeIndex(record);
    mapDataStore.remove(key,now);
  }
 else {
    return removeRecord(key,record,now) != null;
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean delete(Data key){
  checkIfLoaded();
  final long now=getNow();
  final Record record=getRecordOrNull(key,now,false);
  if (record == null) {
    mapDataStore.remove(key,now);
  }
 else {
    return removeRecord(key,record,now) != null;
  }
  return false;
}
Program: 46992
Project: 46992
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public Collection values(Predicate predicate){
  checkTransactionState();
  checkNotNull(predicate,"String_Node_Str");
  checkNotInstanceOf(PagingPredicate.class,predicate,"String_Node_Str");
  SerializationService serializationService=getNodeEngine().getSerializationService();
  QueryResultSet queryResultSet=(QueryResultSet)queryInternal(predicate,IterationType.ENTRY,false);
  List<Object> valueSet=new ArrayList<Object>();
  Set<Object> keyWontBeIncluded=new HashSet<Object>();
  MapServiceContext mapServiceContext=getService().getMapServiceContext();
  for (  Map.Entry<Data,TxnValueWrapper> entry : txMap.entrySet()) {
    boolean isRemoved=TxnValueWrapper.Type.REMOVED.equals(entry.getValue().type);
    boolean isUpdated=TxnValueWrapper.Type.UPDATED.equals(entry.getValue().type);
    Object keyObject=serializationService.toObject(entry.getKey());
    if (isRemoved) {
      keyWontBeIncluded.add(keyObject);
    }
 else {
      if (isUpdated) {
        keyWontBeIncluded.add(keyObject);
      }
      Object entryValue=entry.getValue().value;
      QueryableEntry queryEntry=new CachedQueryEntry(serializationService,entry.getKey(),entryValue);
      if (predicate.apply(queryEntry)) {
        valueSet.add(queryEntry.getValue());
      }
    }
  }
  removeFromResultSet(queryResultSet,valueSet,keyWontBeIncluded);
  return valueSet;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public Collection values(Predicate predicate){
  checkTransactionState();
  checkNotNull(predicate,"String_Node_Str");
  checkNotInstanceOf(PagingPredicate.class,predicate,"String_Node_Str");
  SerializationService serializationService=getNodeEngine().getSerializationService();
  QueryResultSet queryResultSet=(QueryResultSet)queryInternal(predicate,IterationType.ENTRY,false);
  List<Object> valueSet=new ArrayList<Object>();
  Set<Object> keyWontBeIncluded=new HashSet<Object>();
  for (  Map.Entry<Data,TxnValueWrapper> entry : txMap.entrySet()) {
    boolean isRemoved=TxnValueWrapper.Type.REMOVED.equals(entry.getValue().type);
    boolean isUpdated=TxnValueWrapper.Type.UPDATED.equals(entry.getValue().type);
    Object keyObject=serializationService.toObject(entry.getKey());
    if (isRemoved) {
      keyWontBeIncluded.add(keyObject);
    }
 else {
      if (isUpdated) {
        keyWontBeIncluded.add(keyObject);
      }
      Object entryValue=entry.getValue().value;
      QueryableEntry queryEntry=new CachedQueryEntry(serializationService,entry.getKey(),entryValue);
      if (predicate.apply(queryEntry)) {
        valueSet.add(queryEntry.getValue());
      }
    }
  }
  removeFromResultSet(queryResultSet,valueSet,keyWontBeIncluded);
  return valueSet;
}
Program: 46993
Project: 46993
Buggy source:
public ListenerAdapter[] getListenerAdapters(){
  return listenerAdapters;
}

Fixed version (ground truth):
@SuppressFBWarnings(value="String_Node_Str",justification="String_Node_Str") public ListenerAdapter[] getListenerAdapters(){
  return listenerAdapters;
}