nus-yam/ex-repair huggingface dataset:
Program: 46913
Project: 46913
Buggy source:
protected NearCacheTestContext createNearCacheTest(String cacheName,NearCacheConfig nearCacheConfig){
  ClientConfig clientConfig=createClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  HazelcastClientProxy client=(HazelcastClientProxy)hazelcastFactory.newHazelcastClient(clientConfig);
  NearCacheManager nearCacheManager=client.client.getNearCacheManager();
  CachingProvider provider=HazelcastClientCachingProvider.createCachingProvider(client);
  HazelcastClientCacheManager cacheManager=(HazelcastClientCacheManager)provider.getCacheManager();
  CacheConfig<Integer,String> cacheConfig=createCacheConfig(nearCacheConfig.getInMemoryFormat());
  ICache<Integer,String> cache=cacheManager.createCache(cacheName,cacheConfig);
  NearCache<Data,String> nearCache=nearCacheManager.getNearCache(cacheManager.getCacheNameWithPrefix(cacheName));
  return new NearCacheTestContext(client,cacheManager,nearCacheManager,cache,nearCache);
}

Fixed version (ground truth):
protected NearCacheTestContext createNearCacheTest(String cacheName,NearCacheConfig nearCacheConfig){
  ClientConfig clientConfig=createClientConfig();
  clientConfig.addNearCacheConfig(nearCacheConfig);
  HazelcastClientProxy client=(HazelcastClientProxy)hazelcastFactory.newHazelcastClient(clientConfig);
  NearCacheManager nearCacheManager=client.client.getNearCacheManager();
  CachingProvider provider=HazelcastClientCachingProvider.createCachingProvider(client);
  HazelcastClientCacheManager cacheManager=(HazelcastClientCacheManager)provider.getCacheManager();
  CacheConfig<Object,String> cacheConfig=createCacheConfig(nearCacheConfig.getInMemoryFormat());
  ICache<Object,String> cache=cacheManager.createCache(cacheName,cacheConfig);
  NearCache<Data,String> nearCache=nearCacheManager.getNearCache(cacheManager.getCacheNameWithPrefix(cacheName));
  return new NearCacheTestContext(client,cacheManager,nearCacheManager,cache,nearCache);
}
Program: 46914
Project: 46914
Buggy source:
protected void putToCacheAndClearOrDestroyThenCantGetAnyRecordFromClientNearCache(InMemoryFormat inMemoryFormat){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  nearCacheConfig.setInvalidateOnChange(true);
  NearCacheTestContext nearCacheTestContext1=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  final NearCacheTestContext nearCacheTestContext2=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext1.cache.put(i,generateValueFromKey(i));
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final Integer key=i;
    final String value=nearCacheTestContext2.cache.get(key);
    HazelcastTestSupport.assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        assertEquals(value,nearCacheTestContext2.nearCache.get(nearCacheTestContext2.serializationService.toData(key)));
      }
    }
);
  }
  nearCacheTestContext1.cache.clear();
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final int key=i;
    HazelcastTestSupport.assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        assertNull(nearCacheTestContext2.nearCache.get(nearCacheTestContext2.serializationService.toData(key)));
      }
    }
);
  }
  nearCacheTestContext1.close();
  nearCacheTestContext2.close();
}

Fixed version (ground truth):
protected void putToCacheAndClearOrDestroyThenCantGetAnyRecordFromClientNearCache(InMemoryFormat inMemoryFormat){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  nearCacheConfig.setInvalidateOnChange(true);
  NearCacheTestContext nearCacheTestContext1=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  final NearCacheTestContext nearCacheTestContext2=createNearCacheTest(DEFAULT_CACHE_NAME,nearCacheConfig);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    nearCacheTestContext1.cache.put(i,generateValueFromKey(i));
  }
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final Integer key=i;
    final String value=nearCacheTestContext2.cache.get(key);
    HazelcastTestSupport.assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        assertEquals(value,nearCacheTestContext2.nearCache.get(nearCacheTestContext2.serializationService.toData(key)));
      }
    }
);
  }
  nearCacheTestContext1.cache.clear();
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    final int key=i;
    HazelcastTestSupport.assertTrueEventually(new AssertTask(){
      @Override public void run() throws Exception {
        assertNull(nearCacheTestContext2.nearCache.get(nearCacheTestContext2.serializationService.toData(key)));
      }
    }
);
  }
}
Program: 46915
Project: 46915
Buggy source:
protected void putToCacheAndThenGetFromClientNearCacheInternal(InMemoryFormat inMemoryFormat,boolean putIfAbsent){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  nearCacheConfig.setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy.CACHE);
  final NearCacheTestContext nearCacheTestContext=createNearCacheTestAndFillWithData(DEFAULT_CACHE_NAME,nearCacheConfig,putIfAbsent);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    String expectedValue=generateValueFromKey(i);
    Data keyData=nearCacheTestContext.serializationService.toData(i);
    assertEquals(expectedValue,nearCacheTestContext.nearCache.get(keyData));
  }
  nearCacheTestContext.close();
}

Fixed version (ground truth):
protected void putToCacheAndThenGetFromClientNearCacheInternal(InMemoryFormat inMemoryFormat,boolean putIfAbsent){
  NearCacheConfig nearCacheConfig=createNearCacheConfig(inMemoryFormat);
  nearCacheConfig.setLocalUpdatePolicy(NearCacheConfig.LocalUpdatePolicy.CACHE);
  final NearCacheTestContext nearCacheTestContext=createNearCacheTestAndFillWithData(DEFAULT_CACHE_NAME,nearCacheConfig,putIfAbsent);
  for (int i=0; i < DEFAULT_RECORD_COUNT; i++) {
    String expectedValue=generateValueFromKey(i);
    Data keyData=nearCacheTestContext.serializationService.toData(i);
    assertEquals(expectedValue,nearCacheTestContext.nearCache.get(keyData));
  }
}
Program: 46916
Project: 46916
Buggy source:
@Test public void test_getCredentialFromFile_when_google_compute_engine() throws Exception {
  ComputeServiceBuilder builder=new ComputeServiceBuilder(new HashMap<String,Comparable>());
  URL resourceUrl=getClass().getResource("String_Node_Str");
  assertEquals("String_Node_Str",builder.getCredentialFromFile("String_Node_Str",resourceUrl.getPath()));
}

Fixed version (ground truth):
@Test public void test_getCredentialFromFile_when_google_compute_engine() throws Exception {
  ComputeServiceBuilder builder=new ComputeServiceBuilder(new HashMap<String,Comparable>());
  URL resourceUrl=getClass().getResource("String_Node_Str");
  String decodedURL=URLDecoder.decode(resourceUrl.getFile(),"String_Node_Str");
  assertEquals("String_Node_Str",builder.getCredentialFromFile("String_Node_Str",decodedURL));
}
Program: 46917
Project: 46917
Buggy source:
@Test public void test_getCredentialFromFile_when_cloud_provider_other_than_google() throws Exception {
  ComputeServiceBuilder builder=new ComputeServiceBuilder(new HashMap<String,Comparable>());
  URL resourceUrl=getClass().getResource("String_Node_Str");
  assertEquals("String_Node_Str",builder.getCredentialFromFile("String_Node_Str",resourceUrl.getPath()));
}

Fixed version (ground truth):
@Test public void test_getCredentialFromFile_when_cloud_provider_other_than_google() throws Exception {
  ComputeServiceBuilder builder=new ComputeServiceBuilder(new HashMap<String,Comparable>());
  URL resourceUrl=getClass().getResource("String_Node_Str");
  String decodedURL=URLDecoder.decode(resourceUrl.getFile(),"String_Node_Str");
  assertEquals("String_Node_Str",builder.getCredentialFromFile("String_Node_Str",decodedURL));
}
Program: 46918
Project: 46918
Buggy source:
@Override public void run(){
  final long now=getNow();
  oldValue=recordStore.get(dataKey,true);
  Map.Entry entry=createMapEntry(dataKey,oldValue);
  processBackup(entry);
  if (noOpBackup(entry)) {
    return;
  }
  if (entryRemovedBackup(entry)) {
    return;
  }
  entryAddedOrUpdatedBackup(entry);
}

Fixed version (ground truth):
@Override public void run(){
  oldValue=recordStore.get(dataKey,true);
  Map.Entry entry=createMapEntry(dataKey,oldValue);
  processBackup(entry);
  if (noOpBackup(entry)) {
    return;
  }
  if (entryRemovedBackup(entry)) {
    return;
  }
  entryAddedOrUpdatedBackup(entry);
}
Program: 46919
Project: 46919
Buggy source:
@Override public void run() throws Exception {
  final long now=getNow();
  final Set<Data> keys=this.keys;
  for (  Data dataKey : keys) {
    if (keyNotOwnedByThisPartition(dataKey)) {
      continue;
    }
    final Object oldValue=recordStore.get(dataKey,true);
    final Map.Entry entry=createMapEntry(dataKey,oldValue);
    processBackup(entry);
    if (noOp(entry,oldValue)) {
      continue;
    }
    if (entryRemovedBackup(entry,dataKey)) {
      continue;
    }
    entryAddedOrUpdatedBackup(entry,dataKey);
    evict();
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  final Set<Data> keys=this.keys;
  for (  Data dataKey : keys) {
    if (keyNotOwnedByThisPartition(dataKey)) {
      continue;
    }
    final Object oldValue=recordStore.get(dataKey,true);
    final Map.Entry entry=createMapEntry(dataKey,oldValue);
    processBackup(entry);
    if (noOp(entry,oldValue)) {
      continue;
    }
    if (entryRemovedBackup(entry,dataKey)) {
      continue;
    }
    entryAddedOrUpdatedBackup(entry,dataKey);
    evict();
  }
}
Program: 46920
Project: 46920
Buggy source:
@Test public void testConfigurationWithFile() throws Exception {
  URL url=getClass().getClassLoader().getResource("String_Node_Str");
  assertNotNull(url);
  System.setProperty("String_Node_Str",url.getFile());
  Config config=new XmlConfigBuilder().build();
  assertEquals(url,config.getConfigurationUrl());
}

Fixed version (ground truth):
@Test public void testConfigurationWithFile() throws Exception {
  URL url=getClass().getClassLoader().getResource("String_Node_Str");
  assertNotNull(url);
  System.setProperty("String_Node_Str",URLDecoder.decode(url.getPath(),"String_Node_Str"));
  Config config=new XmlConfigBuilder().build();
  assertEquals(url,config.getConfigurationUrl());
}
Program: 46921
Project: 46921
Buggy source:
private void collectResult(MultiResult collector,Object parentObject) throws IllegalAccessException, InvocationTargetException {
  if (parentObject == null) {
    collector.add(parentObject);
  }
 else {
    Object currentObject=extractFrom(parentObject);
    if (shouldReduce()) {
      reduceInto(collector,currentObject);
    }
 else {
      collector.add(currentObject);
    }
  }
}

Fixed version (ground truth):
private void collectResult(MultiResult collector,Object parentObject) throws IllegalAccessException, InvocationTargetException {
  if (parentObject == null) {
    collector.add(null);
  }
 else {
    Object currentObject=extractFrom(parentObject);
    if (shouldReduce()) {
      reduceInto(collector,currentObject);
    }
 else {
      collector.add(currentObject);
    }
  }
}
Program: 46922
Project: 46922
Buggy source:
private ContextBuilder newContextBuilder(final String cloudProvider,final String identity,final String credential,final String roleName){
  try {
    if (roleName != null && (identity != null || credential != null)) {
      throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str");
    }
    if (roleName != null && !cloudProvider.equals(AWS_EC2)) {
      throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str" + cloudProvider);
    }
    if (cloudProvider.equals(AWS_EC2) && roleName != null) {
      Supplier<Credentials> credentialsSupplier=new Supplier<Credentials>(){
        @Override public Credentials get(){
          return new IAMRoleCredentialSupplierBuilder().withRoleName(roleName).build();
        }
      }
;
      return ContextBuilder.newBuilder(cloudProvider).credentialsSupplier(credentialsSupplier);
    }
 else {
      checkNotNull(identity,"String_Node_Str");
      checkNotNull(credential,"String_Node_Str");
      return ContextBuilder.newBuilder(cloudProvider).credentials(identity,credential);
    }
  }
 catch (  NoSuchElementException e) {
    throw new InvalidConfigurationException("String_Node_Str" + cloudProvider + "String_Node_Str");
  }
}

Fixed version (ground truth):
public ContextBuilder newContextBuilder(final String cloudProvider,final String identity,final String credential,final String roleName){
  try {
    if (roleName != null && (identity != null || credential != null)) {
      throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str");
    }
    if (roleName != null && !cloudProvider.equals(AWS_EC2)) {
      throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str" + cloudProvider);
    }
    if (cloudProvider.equals(AWS_EC2) && roleName != null) {
      Supplier<Credentials> credentialsSupplier=new Supplier<Credentials>(){
        @Override public Credentials get(){
          return new IAMRoleCredentialSupplierBuilder().withRoleName(roleName).build();
        }
      }
;
      return ContextBuilder.newBuilder(cloudProvider).credentialsSupplier(credentialsSupplier);
    }
 else {
      checkNotNull(identity,"String_Node_Str");
      checkNotNull(credential,"String_Node_Str");
      return ContextBuilder.newBuilder(cloudProvider).credentials(identity,credential);
    }
  }
 catch (  NoSuchElementException e) {
    throw new InvalidConfigurationException("String_Node_Str" + cloudProvider + "String_Node_Str");
  }
}
Program: 46923
Project: 46923
Buggy source:
@Override public boolean apply(ComputeMetadata nodeMetadata){
  if (nodeMetadata == null) {
    return false;
  }
  for (  AbstractMap.SimpleImmutableEntry entry : tagPairs) {
    if (!nodeMetadata.getUserMetadata().get(entry.getKey()).equals(entry.getValue())) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(ComputeMetadata nodeMetadata){
  if (nodeMetadata == null) {
    return false;
  }
  if (tagPairs.size() > nodeMetadata.getUserMetadata().size()) {
    return false;
  }
  for (  AbstractMap.SimpleImmutableEntry entry : tagPairs) {
    String value=nodeMetadata.getUserMetadata().get(entry.getKey());
    if (value == null || !value.equals(entry.getValue())) {
      return false;
    }
  }
  return true;
}
Program: 46924
Project: 46924
Buggy source:
private Properties buildRegionZonesConfig(){
  final String regions=getOrNull(JCloudsProperties.REGIONS);
  final String zones=getOrNull(JCloudsProperties.ZONES);
  Properties jcloudsProperties=newOverrideProperties();
  if (regions != null) {
    jcloudsProperties.setProperty(LocationConstants.PROPERTY_REGIONS,regions);
  }
  if (zones != null) {
    jcloudsProperties.setProperty(LocationConstants.PROPERTY_ZONES,zones);
  }
  return jcloudsProperties;
}

Fixed version (ground truth):
public Properties buildRegionZonesConfig(){
  final String regions=getOrNull(JCloudsProperties.REGIONS);
  final String zones=getOrNull(JCloudsProperties.ZONES);
  Properties jcloudsProperties=newOverrideProperties();
  if (regions != null) {
    List<String> regionList=Arrays.asList(regions.split("String_Node_Str"));
    for (    String region : regionList) {
      regionsSet.add(region);
    }
    jcloudsProperties.setProperty(LocationConstants.PROPERTY_REGIONS,regions);
  }
  if (zones != null) {
    List<String> zoneList=Arrays.asList(zones.split("String_Node_Str"));
    for (    String zone : zoneList) {
      zonesSet.add(zone);
    }
    jcloudsProperties.setProperty(LocationConstants.PROPERTY_ZONES,zones);
  }
  return jcloudsProperties;
}
Program: 46925
Project: 46925
Buggy source:
private String getCredentialFromFile(String provider,String credentialPath) throws IllegalArgumentException {
  try {
    String fileContents=Files.toString(new File(credentialPath),Charsets.UTF_8);
    if (provider.equals(GOOGLE_COMPUTE_ENGINE)) {
      Supplier<Credentials> credentialSupplier=new GoogleCredentialsFromJson(fileContents);
      return credentialSupplier.get().credential;
    }
    return fileContents;
  }
 catch (  IOException e) {
    throw new InvalidConfigurationException("String_Node_Str" + credentialPath,e);
  }
}

Fixed version (ground truth):
public String getCredentialFromFile(String provider,String credentialPath) throws IllegalArgumentException {
  try {
    String fileContents=Files.toString(new File(credentialPath),Charsets.UTF_8);
    if (provider.equals(GOOGLE_COMPUTE_ENGINE)) {
      Supplier<Credentials> credentialSupplier=new GoogleCredentialsFromJson(fileContents);
      return credentialSupplier.get().credential;
    }
    return fileContents;
  }
 catch (  IOException e) {
    throw new InvalidConfigurationException("String_Node_Str" + credentialPath,e);
  }
}
Program: 46926
Project: 46926
Buggy source:
private void buildNodeFilter(){
  nodesFilter=new Predicate<ComputeMetadata>(){
    @Override public boolean apply(    ComputeMetadata nodeMetadata){
      if (nodeMetadata == null) {
        return false;
      }
      for (      AbstractMap.SimpleImmutableEntry entry : tagPairs) {
        if (!nodeMetadata.getUserMetadata().get(entry.getKey()).equals(entry.getValue())) {
          return false;
        }
      }
      return true;
    }
  }
;
}

Fixed version (ground truth):
public Predicate<ComputeMetadata> buildNodeFilter(){
  nodesFilter=new Predicate<ComputeMetadata>(){
    @Override public boolean apply(    ComputeMetadata nodeMetadata){
      if (nodeMetadata == null) {
        return false;
      }
      if (tagPairs.size() > nodeMetadata.getUserMetadata().size()) {
        return false;
      }
      for (      AbstractMap.SimpleImmutableEntry entry : tagPairs) {
        String value=nodeMetadata.getUserMetadata().get(entry.getKey());
        if (value == null || !value.equals(entry.getValue())) {
          return false;
        }
      }
      return true;
    }
  }
;
  return nodesFilter;
}
Program: 46927
Project: 46927
Buggy source:
private void buildTagConfig(){
  final String tagKeys=getOrNull(JCloudsProperties.TAG_KEYS);
  final String tagValues=getOrNull(JCloudsProperties.TAG_VALUES);
  if (tagKeys != null && tagValues != null) {
    List<String> keysList=Arrays.asList(tagKeys.split("String_Node_Str"));
    List<String> valueList=Arrays.asList(tagValues.split("String_Node_Str"));
    if (keysList.size() != valueList.size()) {
      throw new InvalidConfigurationException("String_Node_Str");
    }
    for (int i=0; i < keysList.size(); i++) {
      tagPairs.add(new AbstractMap.SimpleImmutableEntry(keysList.get(i),valueList.get(i)));
    }
  }
}

Fixed version (ground truth):
public void buildTagConfig(){
  final String tagKeys=getOrNull(JCloudsProperties.TAG_KEYS);
  final String tagValues=getOrNull(JCloudsProperties.TAG_VALUES);
  if (tagKeys != null && tagValues != null) {
    List<String> keysList=Arrays.asList(tagKeys.split("String_Node_Str"));
    List<String> valueList=Arrays.asList(tagValues.split("String_Node_Str"));
    if (keysList.size() != valueList.size()) {
      throw new InvalidConfigurationException("String_Node_Str");
    }
    for (int i=0; i < keysList.size(); i++) {
      tagPairs.add(new AbstractMap.SimpleImmutableEntry(keysList.get(i),valueList.get(i)));
    }
  }
}
Program: 46928
Project: 46928
Buggy source:
/** 
 * Gets filtered nodes.
 * @return the filtered nodes
 */
public Iterable<? extends NodeMetadata> getFilteredNodes(){
  final String group=getOrNull(JCloudsProperties.GROUP);
  Set<? extends NodeMetadata> result=computeService.listNodesDetailsMatching(nodesFilter);
  Iterable<? extends NodeMetadata> filteredResult=new HashSet<NodeMetadata>();
  for (  NodeMetadata metadata : result) {
    if (group != null && !group.equals(metadata.getGroup())) {
      continue;
    }
    if (checkRegionZoneConfig(metadata)) {
      continue;
    }
    ((HashSet<NodeMetadata>)filteredResult).add(metadata);
  }
  return filteredResult;
}

Fixed version (ground truth):
/** 
 * Gets filtered nodes.
 * @return the filtered nodes
 */
public Iterable<? extends NodeMetadata> getFilteredNodes(){
  final String group=getOrNull(JCloudsProperties.GROUP);
  Set<? extends NodeMetadata> result=computeService.listNodesDetailsMatching(nodesFilter);
  Iterable<? extends NodeMetadata> filteredResult=new HashSet<NodeMetadata>();
  for (  NodeMetadata metadata : result) {
    if (group != null && !group.equals(metadata.getGroup())) {
      continue;
    }
    if (!isNodeInsideZones(metadata) || !isNodeInsideRegions(metadata)) {
      continue;
    }
    ((HashSet<NodeMetadata>)filteredResult).add(metadata);
  }
  return filteredResult;
}
Program: 46929
Project: 46929
Buggy source:
protected Map<String,String> getKeysFromIamRole(){
  try {
    String query="String_Node_Str" + roleName;
    URL url=new URL("String_Node_Str",IAM_ROLE_ENDPOINT,query);
    InputStreamReader is=new InputStreamReader(url.openStream(),"String_Node_Str");
    BufferedReader reader=new BufferedReader(is);
    Map<String,String> map=parseIamRole(reader);
    return map;
  }
 catch (  IOException io) {
    throw new InvalidConfigurationException("String_Node_Str");
  }
}

Fixed version (ground truth):
protected Map<String,String> getKeysFromIamRole(){
  try {
    URL url=new URL("String_Node_Str",IAM_ROLE_ENDPOINT,query);
    BufferedReader reader=new BufferedReader(new InputStreamReader(url.openStream(),"String_Node_Str"));
    return parseIamRole(reader);
  }
 catch (  IOException io) {
    throw new InvalidConfigurationException("String_Node_Str");
  }
}
Program: 46930
Project: 46930
Buggy source:
public IAMRoleCredentialSupplierBuilder withRoleName(String roleName){
  isNotNull(roleName,"String_Node_Str");
  this.roleName=roleName;
  return this;
}

Fixed version (ground truth):
public IAMRoleCredentialSupplierBuilder withRoleName(String roleName){
  isNotNull(roleName,"String_Node_Str");
  this.roleName=roleName;
  query=query + roleName;
  return this;
}
Program: 46931
Project: 46931
Buggy source:
@Override public Iterable<DiscoveryNode> discoverNodes(){
  List<DiscoveryNode> discoveryNodes=new ArrayList<DiscoveryNode>();
  try {
    Iterable<? extends NodeMetadata> nodes=computeServiceBuilder.getFilteredNodes();
    for (    NodeMetadata metadata : nodes) {
      if (metadata.getStatus() != NodeMetadata.Status.RUNNING) {
        continue;
      }
      discoveryNodes.add(buildDiscoveredNode(metadata));
    }
  }
 catch (  Exception e) {
    throw new HazelcastException("String_Node_Str",e);
  }
  return discoveryNodes;
}

Fixed version (ground truth):
@Override public Iterable<DiscoveryNode> discoverNodes(){
  List<DiscoveryNode> discoveryNodes=new ArrayList<DiscoveryNode>();
  try {
    Iterable<? extends NodeMetadata> nodes=computeServiceBuilder.getFilteredNodes();
    for (    NodeMetadata metadata : nodes) {
      if (metadata.getStatus() != NodeMetadata.Status.RUNNING) {
        continue;
      }
      discoveryNodes.add(buildDiscoveredNode(metadata));
    }
    if (discoveryNodes.isEmpty()) {
      LOGGER.warning("String_Node_Str");
    }
 else {
      StringBuilder sb=new StringBuilder("String_Node_Str");
      for (      DiscoveryNode node : discoveryNodes) {
        sb.append("String_Node_Str").append(node.getPublicAddress().toString()).append("String_Node_Str");
      }
      LOGGER.finest(sb.toString());
    }
  }
 catch (  Exception e) {
    throw new HazelcastException("String_Node_Str",e);
  }
  return discoveryNodes;
}
Program: 46932
Project: 46932
Buggy source:
protected AbstractClientCacheProxyBase(CacheConfig cacheConfig,ClientContext clientContext){
  this.name=cacheConfig.getName();
  this.nameWithPrefix=cacheConfig.getNameWithPrefix();
  this.cacheConfig=cacheConfig;
  this.clientContext=clientContext;
  init();
}

Fixed version (ground truth):
protected AbstractClientCacheProxyBase(CacheConfig cacheConfig,ClientContext clientContext){
  this.name=cacheConfig.getName();
  this.nameWithPrefix=cacheConfig.getNameWithPrefix();
  this.cacheConfig=cacheConfig;
  this.clientContext=clientContext;
}
Program: 46933
Project: 46933
Buggy source:
public void close(){
  if (!isClosed.compareAndSet(false,true)) {
    return;
  }
  for (  Future f : loadAllTasks) {
    try {
      f.get(TIMEOUT,TimeUnit.SECONDS);
    }
 catch (    Exception e) {
      throw new CacheException(e);
    }
  }
  loadAllTasks.clear();
  closeCacheLoader();
  closeListeners();
}

Fixed version (ground truth):
public void close(){
  if (!isClosed.compareAndSet(false,true)) {
    return;
  }
  for (  Future f : loadAllTasks) {
    try {
      f.get(TIMEOUT,TimeUnit.SECONDS);
    }
 catch (    Exception e) {
      throw new CacheException(e);
    }
  }
  loadAllTasks.clear();
  closeListeners();
}
Program: 46934
Project: 46934
Buggy source:
public void open(){
  if (isDestroyed.get()) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!isClosed.compareAndSet(true,false)) {
    return;
  }
  init();
}

Fixed version (ground truth):
public void open(){
  if (isDestroyed.get()) {
    throw new IllegalStateException("String_Node_Str");
  }
  if (!isClosed.compareAndSet(true,false)) {
    return;
  }
}
Program: 46935
Project: 46935
Buggy source:
@Override public void loadAll(Set<? extends K> keys,boolean replaceExistingValues,CompletionListener completionListener){
  ensureOpen();
  validateNotNull(keys);
  for (  K key : keys) {
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key);
  }
  validateCacheLoader(completionListener);
  HashSet<Data> keysData=new HashSet<Data>();
  for (  K key : keys) {
    keysData.add(toData(key));
  }
  CacheLoadAllRequest request=new CacheLoadAllRequest(nameWithPrefix,keysData,replaceExistingValues);
  try {
    submitLoadAllTask(request,completionListener);
  }
 catch (  Exception e) {
    if (completionListener != null) {
      completionListener.onException(e);
    }
    throw new CacheException(e);
  }
}

Fixed version (ground truth):
@Override public void loadAll(Set<? extends K> keys,boolean replaceExistingValues,CompletionListener completionListener){
  ensureOpen();
  validateNotNull(keys);
  for (  K key : keys) {
    CacheProxyUtil.validateConfiguredTypes(cacheConfig,key);
  }
  HashSet<Data> keysData=new HashSet<Data>();
  for (  K key : keys) {
    keysData.add(toData(key));
  }
  CacheLoadAllRequest request=new CacheLoadAllRequest(nameWithPrefix,keysData,replaceExistingValues);
  try {
    submitLoadAllTask(request,completionListener);
  }
 catch (  Exception e) {
    if (completionListener != null) {
      completionListener.onException(e);
    }
    throw new CacheException(e);
  }
}
Program: 46936
Project: 46936
Buggy source:
@Override public Integer load(Integer key){
  return key != null && key < 100 ? key : null;
}

Fixed version (ground truth):
@Override public String load(Integer key){
  return valueOf(key);
}
Program: 46937
Project: 46937
Buggy source:
@Override public void run() throws Exception {
  CacheManager cm1=cachingProvider1.getCacheManager();
  assertNotNull(cm1.getCache(cacheName,Integer.class,Integer.class));
  CacheManager cm2=cachingProvider2.getCacheManager();
  assertNotNull(cm2.getCache(cacheName,Integer.class,Integer.class));
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  CacheManager cm1=serverProvider1.getCacheManager();
  assertNotNull(cm1.getCache(cacheName,Integer.class,Integer.class));
  CacheManager cm2=serverProvider2.getCacheManager();
  assertNotNull(cm2.getCache(cacheName,Integer.class,Integer.class));
}
Program: 46938
Project: 46938
Buggy source:
@Override public Map<Integer,Integer> loadAll(Iterable<? extends Integer> keys) throws CacheLoaderException {
  Map<Integer,Integer> result=new HashMap<Integer,Integer>();
  for (  Integer key : keys) {
    Integer value=load(key);
    if (value != null) {
      result.put(key,value);
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public Map<Integer,String> loadAll(Iterable<? extends Integer> keys) throws CacheLoaderException {
  Map<Integer,String> result=new HashMap<Integer,String>();
  for (  Integer key : keys) {
    String value=load(key);
    result.put(key,value);
  }
  return result;
}
Program: 46939
Project: 46939
Buggy source:
private ContextBuilder newContextBuilder(final String cloudProvider,final String identity,final String credential,final String roleName){
  try {
    if (roleName != null && (identity != null || credential != null)) {
      throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str");
    }
    if (roleName != null && !cloudProvider.equals(AWS_EC2)) {
      throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str" + cloudProvider);
    }
    if (cloudProvider.equals(AWS_EC2) && roleName != null) {
      Supplier<Credentials> credentialsSupplier=new Supplier<Credentials>(){
        @Override public Credentials get(){
          return new IAMRoleCredentialSupplierBuilder().withRoleName(roleName).build();
        }
      }
;
      return ContextBuilder.newBuilder(cloudProvider).credentialsSupplier(credentialsSupplier);
    }
 else {
      checkNotNull(identity,"String_Node_Str");
      checkNotNull(credential,"String_Node_Str");
      return ContextBuilder.newBuilder(cloudProvider).credentials(identity,credential);
    }
  }
 catch (  NoSuchElementException e) {
    throw new InvalidConfigurationException("String_Node_Str" + cloudProvider + "String_Node_Str");
  }
}

Fixed version (ground truth):
public ContextBuilder newContextBuilder(final String cloudProvider,final String identity,final String credential,final String roleName){
  try {
    if (roleName != null && (identity != null || credential != null)) {
      throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str");
    }
    if (roleName != null && !cloudProvider.equals(AWS_EC2)) {
      throw new InvalidConfigurationException("String_Node_Str" + "String_Node_Str" + cloudProvider);
    }
    if (cloudProvider.equals(AWS_EC2) && roleName != null) {
      Supplier<Credentials> credentialsSupplier=new Supplier<Credentials>(){
        @Override public Credentials get(){
          return new IAMRoleCredentialSupplierBuilder().withRoleName(roleName).build();
        }
      }
;
      return ContextBuilder.newBuilder(cloudProvider).credentialsSupplier(credentialsSupplier);
    }
 else {
      checkNotNull(identity,"String_Node_Str");
      checkNotNull(credential,"String_Node_Str");
      return ContextBuilder.newBuilder(cloudProvider).credentials(identity,credential);
    }
  }
 catch (  NoSuchElementException e) {
    throw new InvalidConfigurationException("String_Node_Str" + cloudProvider + "String_Node_Str");
  }
}
Program: 46940
Project: 46940
Buggy source:
@Override public boolean apply(ComputeMetadata nodeMetadata){
  if (nodeMetadata == null) {
    return false;
  }
  for (  AbstractMap.SimpleImmutableEntry entry : tagPairs) {
    if (!nodeMetadata.getUserMetadata().get(entry.getKey()).equals(entry.getValue())) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean apply(ComputeMetadata nodeMetadata){
  if (nodeMetadata == null) {
    return false;
  }
  if (tagPairs.size() > nodeMetadata.getUserMetadata().size()) {
    return false;
  }
  for (  AbstractMap.SimpleImmutableEntry entry : tagPairs) {
    String value=nodeMetadata.getUserMetadata().get(entry.getKey());
    if (value == null || !value.equals(entry.getValue())) {
      return false;
    }
  }
  return true;
}
Program: 46941
Project: 46941
Buggy source:
private Properties buildRegionZonesConfig(){
  final String regions=getOrNull(JCloudsProperties.REGIONS);
  final String zones=getOrNull(JCloudsProperties.ZONES);
  Properties jcloudsProperties=newOverrideProperties();
  if (regions != null) {
    jcloudsProperties.setProperty(LocationConstants.PROPERTY_REGIONS,regions);
  }
  if (zones != null) {
    jcloudsProperties.setProperty(LocationConstants.PROPERTY_ZONES,zones);
  }
  return jcloudsProperties;
}

Fixed version (ground truth):
public Properties buildRegionZonesConfig(){
  final String regions=getOrNull(JCloudsProperties.REGIONS);
  final String zones=getOrNull(JCloudsProperties.ZONES);
  Properties jcloudsProperties=newOverrideProperties();
  if (regions != null) {
    List<String> regionList=Arrays.asList(regions.split("String_Node_Str"));
    for (    String region : regionList) {
      regionsSet.add(region);
    }
    jcloudsProperties.setProperty(LocationConstants.PROPERTY_REGIONS,regions);
  }
  if (zones != null) {
    List<String> zoneList=Arrays.asList(zones.split("String_Node_Str"));
    for (    String zone : zoneList) {
      zonesSet.add(zone);
    }
    jcloudsProperties.setProperty(LocationConstants.PROPERTY_ZONES,zones);
  }
  return jcloudsProperties;
}
Program: 46942
Project: 46942
Buggy source:
private String getCredentialFromFile(String provider,String credentialPath) throws IllegalArgumentException {
  try {
    String fileContents=Files.toString(new File(credentialPath),Charsets.UTF_8);
    if (provider.equals(GOOGLE_COMPUTE_ENGINE)) {
      Supplier<Credentials> credentialSupplier=new GoogleCredentialsFromJson(fileContents);
      return credentialSupplier.get().credential;
    }
    return fileContents;
  }
 catch (  IOException e) {
    throw new InvalidConfigurationException("String_Node_Str" + credentialPath,e);
  }
}

Fixed version (ground truth):
public String getCredentialFromFile(String provider,String credentialPath) throws IllegalArgumentException {
  try {
    String fileContents=Files.toString(new File(credentialPath),Charsets.UTF_8);
    if (provider.equals(GOOGLE_COMPUTE_ENGINE)) {
      Supplier<Credentials> credentialSupplier=new GoogleCredentialsFromJson(fileContents);
      return credentialSupplier.get().credential;
    }
    return fileContents;
  }
 catch (  IOException e) {
    throw new InvalidConfigurationException("String_Node_Str" + credentialPath,e);
  }
}
Program: 46943
Project: 46943
Buggy source:
private void buildNodeFilter(){
  nodesFilter=new Predicate<ComputeMetadata>(){
    @Override public boolean apply(    ComputeMetadata nodeMetadata){
      if (nodeMetadata == null) {
        return false;
      }
      for (      AbstractMap.SimpleImmutableEntry entry : tagPairs) {
        if (!nodeMetadata.getUserMetadata().get(entry.getKey()).equals(entry.getValue())) {
          return false;
        }
      }
      return true;
    }
  }
;
}

Fixed version (ground truth):
public Predicate<ComputeMetadata> buildNodeFilter(){
  nodesFilter=new Predicate<ComputeMetadata>(){
    @Override public boolean apply(    ComputeMetadata nodeMetadata){
      if (nodeMetadata == null) {
        return false;
      }
      if (tagPairs.size() > nodeMetadata.getUserMetadata().size()) {
        return false;
      }
      for (      AbstractMap.SimpleImmutableEntry entry : tagPairs) {
        String value=nodeMetadata.getUserMetadata().get(entry.getKey());
        if (value == null || !value.equals(entry.getValue())) {
          return false;
        }
      }
      return true;
    }
  }
;
  return nodesFilter;
}
Program: 46944
Project: 46944
Buggy source:
private void buildTagConfig(){
  final String tagKeys=getOrNull(JCloudsProperties.TAG_KEYS);
  final String tagValues=getOrNull(JCloudsProperties.TAG_VALUES);
  if (tagKeys != null && tagValues != null) {
    List<String> keysList=Arrays.asList(tagKeys.split("String_Node_Str"));
    List<String> valueList=Arrays.asList(tagValues.split("String_Node_Str"));
    if (keysList.size() != valueList.size()) {
      throw new InvalidConfigurationException("String_Node_Str");
    }
    for (int i=0; i < keysList.size(); i++) {
      tagPairs.add(new AbstractMap.SimpleImmutableEntry(keysList.get(i),valueList.get(i)));
    }
  }
}

Fixed version (ground truth):
public void buildTagConfig(){
  final String tagKeys=getOrNull(JCloudsProperties.TAG_KEYS);
  final String tagValues=getOrNull(JCloudsProperties.TAG_VALUES);
  if (tagKeys != null && tagValues != null) {
    List<String> keysList=Arrays.asList(tagKeys.split("String_Node_Str"));
    List<String> valueList=Arrays.asList(tagValues.split("String_Node_Str"));
    if (keysList.size() != valueList.size()) {
      throw new InvalidConfigurationException("String_Node_Str");
    }
    for (int i=0; i < keysList.size(); i++) {
      tagPairs.add(new AbstractMap.SimpleImmutableEntry(keysList.get(i),valueList.get(i)));
    }
  }
}
Program: 46945
Project: 46945
Buggy source:
/** 
 * Gets filtered nodes.
 * @return the filtered nodes
 */
public Iterable<? extends NodeMetadata> getFilteredNodes(){
  final String group=getOrNull(JCloudsProperties.GROUP);
  Set<? extends NodeMetadata> result=computeService.listNodesDetailsMatching(nodesFilter);
  Iterable<? extends NodeMetadata> filteredResult=new HashSet<NodeMetadata>();
  for (  NodeMetadata metadata : result) {
    if (group != null && !group.equals(metadata.getGroup())) {
      continue;
    }
    if (checkRegionZoneConfig(metadata)) {
      continue;
    }
    ((HashSet<NodeMetadata>)filteredResult).add(metadata);
  }
  return filteredResult;
}

Fixed version (ground truth):
/** 
 * Gets filtered nodes.
 * @return the filtered nodes
 */
public Iterable<? extends NodeMetadata> getFilteredNodes(){
  final String group=getOrNull(JCloudsProperties.GROUP);
  Set<? extends NodeMetadata> result=computeService.listNodesDetailsMatching(nodesFilter);
  Iterable<? extends NodeMetadata> filteredResult=new HashSet<NodeMetadata>();
  for (  NodeMetadata metadata : result) {
    if (group != null && !group.equals(metadata.getGroup())) {
      continue;
    }
    if (!isNodeInsideZones(metadata) || !isNodeInsideRegions(metadata)) {
      continue;
    }
    ((HashSet<NodeMetadata>)filteredResult).add(metadata);
  }
  return filteredResult;
}
Program: 46946
Project: 46946
Buggy source:
protected Map<String,String> getKeysFromIamRole(){
  try {
    String query="String_Node_Str" + roleName;
    URL url=new URL("String_Node_Str",IAM_ROLE_ENDPOINT,query);
    InputStreamReader is=new InputStreamReader(url.openStream(),"String_Node_Str");
    BufferedReader reader=new BufferedReader(is);
    Map<String,String> map=parseIamRole(reader);
    return map;
  }
 catch (  IOException io) {
    throw new InvalidConfigurationException("String_Node_Str");
  }
}

Fixed version (ground truth):
protected Map<String,String> getKeysFromIamRole(){
  try {
    URL url=new URL("String_Node_Str",IAM_ROLE_ENDPOINT,query);
    BufferedReader reader=new BufferedReader(new InputStreamReader(url.openStream(),"String_Node_Str"));
    return parseIamRole(reader);
  }
 catch (  IOException io) {
    throw new InvalidConfigurationException("String_Node_Str");
  }
}
Program: 46947
Project: 46947
Buggy source:
public IAMRoleCredentialSupplierBuilder withRoleName(String roleName){
  isNotNull(roleName,"String_Node_Str");
  this.roleName=roleName;
  return this;
}

Fixed version (ground truth):
public IAMRoleCredentialSupplierBuilder withRoleName(String roleName){
  isNotNull(roleName,"String_Node_Str");
  this.roleName=roleName;
  query=query + roleName;
  return this;
}
Program: 46948
Project: 46948
Buggy source:
@Override public Iterable<DiscoveryNode> discoverNodes(){
  List<DiscoveryNode> discoveryNodes=new ArrayList<DiscoveryNode>();
  try {
    Iterable<? extends NodeMetadata> nodes=computeServiceBuilder.getFilteredNodes();
    for (    NodeMetadata metadata : nodes) {
      if (metadata.getStatus() != NodeMetadata.Status.RUNNING) {
        continue;
      }
      discoveryNodes.add(buildDiscoveredNode(metadata));
    }
  }
 catch (  Exception e) {
    throw new HazelcastException("String_Node_Str",e);
  }
  return discoveryNodes;
}

Fixed version (ground truth):
@Override public Iterable<DiscoveryNode> discoverNodes(){
  List<DiscoveryNode> discoveryNodes=new ArrayList<DiscoveryNode>();
  try {
    Iterable<? extends NodeMetadata> nodes=computeServiceBuilder.getFilteredNodes();
    for (    NodeMetadata metadata : nodes) {
      if (metadata.getStatus() != NodeMetadata.Status.RUNNING) {
        continue;
      }
      discoveryNodes.add(buildDiscoveredNode(metadata));
    }
    if (discoveryNodes.isEmpty()) {
      LOGGER.warning("String_Node_Str");
    }
 else {
      StringBuilder sb=new StringBuilder("String_Node_Str");
      for (      DiscoveryNode node : discoveryNodes) {
        sb.append("String_Node_Str").append(node.getPublicAddress().toString()).append("String_Node_Str");
      }
      LOGGER.finest(sb.toString());
    }
  }
 catch (  Exception e) {
    throw new HazelcastException("String_Node_Str",e);
  }
  return discoveryNodes;
}
Program: 46949
Project: 46949
Buggy source:
@Override public void writeResponse(ManagementCenterService mcs,JsonObject out) throws Exception {
  String resultString="String_Node_Str";
  try {
    Cluster cluster=mcs.getHazelcastInstance().getCluster();
    cluster.changeClusterState(getClusterState(state));
  }
 catch (  Exception e) {
    ILogger logger=mcs.getHazelcastInstance().node.nodeEngine.getLogger(getClass());
    logger.warning("String_Node_Str",e);
    resultString=failure + e.getMessage();
  }
  JsonObject result=new JsonObject().add("String_Node_Str",resultString);
  out.add("String_Node_Str",result);
}

Fixed version (ground truth):
@Override public void writeResponse(ManagementCenterService mcs,JsonObject out) throws Exception {
  String resultString="String_Node_Str";
  try {
    Cluster cluster=mcs.getHazelcastInstance().getCluster();
    cluster.changeClusterState(getClusterState(state));
  }
 catch (  Exception e) {
    ILogger logger=mcs.getHazelcastInstance().node.nodeEngine.getLogger(getClass());
    logger.warning("String_Node_Str",e);
    resultString=FAILURE + e.getMessage();
  }
  JsonObject result=new JsonObject().add("String_Node_Str",resultString);
  out.add("String_Node_Str",result);
}
Program: 46950
Project: 46950
Buggy source:
protected EvictionPolicyEvaluator<Data,R> createEvictionPolicyEvaluator(EvictionConfig cacheEvictionConfig){
  final EvictionPolicy evictionPolicy=cacheEvictionConfig.getEvictionPolicy();
  if (evictionPolicy == null || evictionPolicy == EvictionPolicy.NONE) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return EvictionPolicyEvaluatorProvider.getEvictionPolicyEvaluator(cacheEvictionConfig);
}

Fixed version (ground truth):
protected EvictionPolicyEvaluator<Data,R> createEvictionPolicyEvaluator(EvictionConfig cacheEvictionConfig){
  final EvictionPolicy evictionPolicy=cacheEvictionConfig.getEvictionPolicy();
  if (evictionPolicy == null || evictionPolicy == EvictionPolicy.NONE || evictionPolicy == EvictionPolicy.RANDOM) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return EvictionPolicyEvaluatorProvider.getEvictionPolicyEvaluator(cacheEvictionConfig);
}
Program: 46951
Project: 46951
Buggy source:
@Override public Cache.Entry<K,V> next(){
  if (!hasNext()) {
    throw new NoSuchElementException();
  }
  currentIndex=index;
  index++;
  final Data keyData=result.getKey(currentIndex);
  final K key=toObject(keyData);
  final V value=cache.get(key);
  return new CacheEntry<K,V>(key,value);
}

Fixed version (ground truth):
@Override public Cache.Entry<K,V> next(){
  while (hasNext()) {
    currentIndex=index;
    index++;
    final Data keyData=result.getKey(currentIndex);
    final K key=toObject(keyData);
    final V value=cache.get(key);
    if (value != null) {
      return new CacheEntry<K,V>(key,value);
    }
  }
  throw new NoSuchElementException();
}
Program: 46952
Project: 46952
Buggy source:
@Test @SuppressWarnings("String_Node_Str") public void testIteratorDuringInsertion_withoutEviction(){
  CacheConfig<Integer,Integer> config=getCacheConfigWithMaxSize(1000000);
  final ICache<Integer,Integer> cache=createCache(config);
  final int maxSize=getMaxCacheSizeWithoutEviction(config);
  int prefillSize=maxSize / 2;
  for (int i=0; i < prefillSize; i++) {
    cache.put(i,i);
  }
  AbstractCacheWorker worker=new AbstractCacheWorker(){
    @Override void doRun(    Random random){
      int i=random.nextInt(maxSize);
      cache.put(i,i);
    }
  }
;
  worker.awaitFirstIteration();
  try {
    int i=0;
    Iterator<Cache.Entry<Integer,Integer>> iterator=cache.iterator();
    while (iterator.hasNext()) {
      Cache.Entry<Integer,Integer> e=iterator.next();
      Integer key=e.getKey();
      Integer value=e.getValue();
      assertEquals(key,value);
      i++;
    }
    assertTrue("String_Node_Str" + prefillSize + "String_Node_Str"+ i,i >= prefillSize);
    assertThatNoCacheEvictionHappened(cache);
  }
  finally {
    worker.shutdown();
  }
}

Fixed version (ground truth):
@Test public void testIteratorDuringInsertion_withoutEviction(){
  testIteratorDuringInsertion(true);
}
Program: 46953
Project: 46953
Buggy source:
@Test @SuppressWarnings("String_Node_Str") public void testIteratorDuringRemoval_withoutEviction(){
  CacheConfig<Integer,Integer> config=getCacheConfigWithMaxSize(1000000);
  final ICache<Integer,Integer> cache=createCache(config);
  final int maxSize=getMaxCacheSizeWithoutEviction(config);
  for (int i=0; i < maxSize; i++) {
    cache.put(i,i);
  }
  AbstractCacheWorker worker=new AbstractCacheWorker(){
    @Override void doRun(    Random random){
      int i=random.nextInt(maxSize);
      cache.remove(i);
    }
  }
;
  worker.awaitFirstIteration();
  try {
    int i=0;
    Iterator<Cache.Entry<Integer,Integer>> iterator=cache.iterator();
    while (iterator.hasNext()) {
      Cache.Entry<Integer,Integer> e=iterator.next();
      Integer key=e.getKey();
      Integer value=e.getValue();
      if (value != null) {
        assertEquals(key,value);
      }
      i++;
    }
    assertTrue("String_Node_Str" + maxSize + "String_Node_Str"+ i,i <= maxSize);
    assertThatNoCacheEvictionHappened(cache);
  }
  finally {
    worker.shutdown();
  }
}

Fixed version (ground truth):
@Test public void testIteratorDuringRemoval_withoutEviction(){
  testIteratorDuringRemoval(true);
}
Program: 46954
Project: 46954
Buggy source:
@Test @SuppressWarnings("String_Node_Str") public void testIteratorDuringUpdate_withoutEviction(){
  CacheConfig<Integer,Integer> config=getCacheConfigWithMaxSize(1000000);
  final ICache<Integer,Integer> cache=createCache(config);
  final int maxSize=getMaxCacheSizeWithoutEviction(config);
  for (int i=0; i < maxSize; i++) {
    cache.put(i,i);
  }
  AbstractCacheWorker worker=new AbstractCacheWorker(){
    @Override void doRun(    Random random){
      int i=random.nextInt(maxSize);
      cache.put(i,-i);
    }
  }
;
  worker.awaitFirstIteration();
  try {
    int i=0;
    Iterator<Cache.Entry<Integer,Integer>> iterator=cache.iterator();
    while (iterator.hasNext()) {
      Cache.Entry<Integer,Integer> e=iterator.next();
      Integer key=e.getKey();
      Integer value=e.getValue();
      assertTrue("String_Node_Str" + key + "String_Node_Str"+ value,key == Math.abs(value));
      i++;
    }
    assertEquals("String_Node_Str" + maxSize + "String_Node_Str",maxSize,i);
    assertThatNoCacheEvictionHappened(cache);
  }
  finally {
    worker.shutdown();
  }
}

Fixed version (ground truth):
@Test public void testIteratorDuringUpdate_withoutEviction(){
  testIteratorDuringUpdate(true);
}
Program: 46955
Project: 46955
Buggy source:
protected <K,V>CacheConfig<K,V> getCacheConfigWithMaxSize(int maxCacheSize){
  CacheConfig<K,V> config=createCacheConfig();
  config.getEvictionConfig().setEvictionPolicy(EvictionPolicy.RANDOM);
  config.getEvictionConfig().setMaximumSizePolicy(EvictionConfig.MaxSizePolicy.ENTRY_COUNT);
  config.getEvictionConfig().setSize(maxCacheSize);
  return config;
}

Fixed version (ground truth):
protected <K,V>CacheConfig<K,V> getCacheConfigWithMaxSize(int maxCacheSize){
  CacheConfig<K,V> config=createCacheConfig();
  config.getEvictionConfig().setMaximumSizePolicy(EvictionConfig.MaxSizePolicy.ENTRY_COUNT);
  config.getEvictionConfig().setSize(maxCacheSize);
  return config;
}