nus-yam/ex-repair huggingface dataset:
Program: 47058
Project: 47058
Buggy source:
@Override public void read(PortableReader reader) throws IOException {
  super.read(reader);
  this.startSequence=reader.readLong("String_Node_Str");
  this.minCount=reader.readInt("String_Node_Str");
  this.maxCount=reader.readInt("String_Node_Str");
}

Fixed version (ground truth):
@Override public void read(PortableReader reader) throws IOException {
  super.read(reader);
  this.startSequence=reader.readLong("String_Node_Str");
  this.minCount=reader.readInt("String_Node_Str");
  this.maxCount=reader.readInt("String_Node_Str");
  filterData=reader.getRawDataInput().readData();
}
Program: 47059
Project: 47059
Buggy source:
public ReadManyRequest(String name,long startSequence,int minCount,int maxCount,Data filter){
  this.name=name;
  this.startSequence=startSequence;
  this.minCount=minCount;
  this.maxCount=maxCount;
  this.filter=filter;
}

Fixed version (ground truth):
public ReadManyRequest(String name,long startSequence,int minCount,int maxCount,Data filter){
  this.name=name;
  this.startSequence=startSequence;
  this.minCount=minCount;
  this.maxCount=maxCount;
  this.filterData=filter;
}
Program: 47060
Project: 47060
Buggy source:
@Override protected Operation prepareOperation(){
  return new ReadManyOperation(name,startSequence,minCount,maxCount,null);
}

Fixed version (ground truth):
@Override protected Operation prepareOperation(){
  SerializationService serializationService=getClientEngine().getSerializationService();
  IFunction filter=serializationService.toObject(filterData);
  return new ReadManyOperation(name,startSequence,minCount,maxCount,filter);
}
Program: 47061
Project: 47061
Buggy source:
@Override public void write(PortableWriter writer) throws IOException {
  super.write(writer);
  writer.writeLong("String_Node_Str",startSequence);
  writer.writeInt("String_Node_Str",minCount);
  writer.writeInt("String_Node_Str",maxCount);
}

Fixed version (ground truth):
@Override public void write(PortableWriter writer) throws IOException {
  super.write(writer);
  writer.writeLong("String_Node_Str",startSequence);
  writer.writeInt("String_Node_Str",minCount);
  writer.writeInt("String_Node_Str",maxCount);
  writer.getRawDataOutput().writeData(filterData);
}
Program: 47062
Project: 47062
Buggy source:
@Override public void read(PortableReader reader) throws IOException {
  super.read(reader);
  this.startSequence=reader.readLong("String_Node_Str");
  this.minCount=reader.readInt("String_Node_Str");
  this.maxCount=reader.readInt("String_Node_Str");
}

Fixed version (ground truth):
@Override public void read(PortableReader reader) throws IOException {
  super.read(reader);
  this.startSequence=reader.readLong("String_Node_Str");
  this.minCount=reader.readInt("String_Node_Str");
  this.maxCount=reader.readInt("String_Node_Str");
  filterData=reader.getRawDataInput().readData();
}
Program: 47063
Project: 47063
Buggy source:
public ReadManyRequest(String name,long startSequence,int minCount,int maxCount,Data filter){
  this.name=name;
  this.startSequence=startSequence;
  this.minCount=minCount;
  this.maxCount=maxCount;
}

Fixed version (ground truth):
public ReadManyRequest(String name,long startSequence,int minCount,int maxCount,Data filter){
  this.name=name;
  this.startSequence=startSequence;
  this.minCount=minCount;
  this.maxCount=maxCount;
  this.filterData=filter;
}
Program: 47064
Project: 47064
Buggy source:
@Override protected Operation prepareOperation(){
  return new ReadManyOperation(name,startSequence,minCount,maxCount,null);
}

Fixed version (ground truth):
@Override protected Operation prepareOperation(){
  SerializationService serializationService=getClientEngine().getSerializationService();
  IFunction filter=serializationService.toObject(filterData);
  return new ReadManyOperation(name,startSequence,minCount,maxCount,filter);
}
Program: 47065
Project: 47065
Buggy source:
@Override public void write(PortableWriter writer) throws IOException {
  super.write(writer);
  writer.writeLong("String_Node_Str",startSequence);
  writer.writeInt("String_Node_Str",minCount);
  writer.writeInt("String_Node_Str",maxCount);
}

Fixed version (ground truth):
@Override public void write(PortableWriter writer) throws IOException {
  super.write(writer);
  writer.writeLong("String_Node_Str",startSequence);
  writer.writeInt("String_Node_Str",minCount);
  writer.writeInt("String_Node_Str",maxCount);
  writer.getRawDataOutput().writeData(filterData);
}
Program: 47066
Project: 47066
Buggy source:
@Override public long capacity(){
  if (capacity == -1) {
    CapacityRequest request=new CapacityRequest(getName());
    capacity=invokeOnPartition(request,getPartitionId());
  }
  return capacity;
}

Fixed version (ground truth):
@Override public long capacity(){
  if (capacity == -1) {
    CapacityRequest request=new CapacityRequest(getName());
    capacity=(Long)invokeOnPartition(request,getPartitionId());
  }
  return capacity;
}
Program: 47068
Project: 47068
Buggy source:
private void symmetricEncInterceptorConfigXmlGenerator(StringBuilder xml,NetworkConfig netCfg){
  final SymmetricEncryptionConfig sec=netCfg.getSymmetricEncryptionConfig();
  if (sec != null) {
    xml.append("String_Node_Str").append(sec != null && sec.isEnabled()).append("String_Node_Str");
    xml.append("String_Node_Str").append(sec.getAlgorithm()).append("String_Node_Str");
    xml.append("String_Node_Str").append(sec.getSalt()).append("String_Node_Str");
    xml.append("String_Node_Str").append(sec.getPassword()).append("String_Node_Str");
    xml.append("String_Node_Str").append(sec.getIterationCount()).append("String_Node_Str");
    xml.append("String_Node_Str");
  }
}

Fixed version (ground truth):
private void symmetricEncInterceptorConfigXmlGenerator(StringBuilder xml,NetworkConfig netCfg){
  final SymmetricEncryptionConfig sec=netCfg.getSymmetricEncryptionConfig();
  if (sec != null) {
    xml.append("String_Node_Str").append(sec.isEnabled()).append("String_Node_Str");
    xml.append("String_Node_Str").append(sec.getAlgorithm()).append("String_Node_Str");
    xml.append("String_Node_Str").append(sec.getSalt()).append("String_Node_Str");
    xml.append("String_Node_Str").append(sec.getPassword()).append("String_Node_Str");
    xml.append("String_Node_Str").append(sec.getIterationCount()).append("String_Node_Str");
    xml.append("String_Node_Str");
  }
}
Program: 47069
Project: 47069
Buggy source:
@Override public Object executeOnKey(K key,EntryProcessor entryProcessor){
  checkNotNull(key,NULL_KEY_IS_NOT_ALLOWED);
  final Data keyData=toData(key);
  ClientMessage request=MapExecuteOnKeyCodec.encodeRequest(name,toData(entryProcessor),keyData,ThreadUtil.getThreadId());
  return invoke(request,keyData);
}

Fixed version (ground truth):
@Override public Object executeOnKey(K key,EntryProcessor entryProcessor){
  checkNotNull(key,NULL_KEY_IS_NOT_ALLOWED);
  final Data keyData=toData(key);
  ClientMessage request=MapExecuteOnKeyCodec.encodeRequest(name,toData(entryProcessor),keyData,ThreadUtil.getThreadId());
  ClientMessage response=invoke(request,keyData);
  MapExecuteOnKeyCodec.ResponseParameters resultParameters=MapExecuteOnKeyCodec.decodeResponse(response);
  return toObject(resultParameters.response);
}
Program: 47070
Project: 47070
Buggy source:
@Override public void run() throws Exception {
  Assert.assertFalse(map.isLocked(key));
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  String payload=randomString();
  Object ret=map.executeOnKey(key,new LockEntryProcessor(payload));
  assertEquals(payload,ret);
}
Program: 47071
Project: 47071
Buggy source:
@Override public void run() throws Exception {
  Assert.assertFalse(map.isLocked(key));
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  String payload=randomString();
  Object ret=map.executeOnKey(key,new LockEntryProcessor(payload));
  assertEquals(payload,ret);
}
Program: 47072
Project: 47072
Buggy source:
public void read(PortableReader reader) throws IOException {
  name=reader.readUTF("String_Node_Str");
  submitToKey=reader.readBoolean("String_Node_Str");
  final ObjectDataInput in=reader.getRawDataInput();
  key=in.readData();
  processor=in.readObject();
}

Fixed version (ground truth):
public void read(PortableReader reader) throws IOException {
  name=reader.readUTF("String_Node_Str");
  submitToKey=reader.readBoolean("String_Node_Str");
  final ObjectDataInput in=reader.getRawDataInput();
  key=in.readData();
  processor=in.readObject();
  threadId=in.readLong();
}
Program: 47073
Project: 47073
Buggy source:
public void write(PortableWriter writer) throws IOException {
  writer.writeUTF("String_Node_Str",name);
  writer.writeBoolean("String_Node_Str",submitToKey);
  final ObjectDataOutput out=writer.getRawDataOutput();
  out.writeData(key);
  out.writeObject(processor);
}

Fixed version (ground truth):
public void write(PortableWriter writer) throws IOException {
  writer.writeUTF("String_Node_Str",name);
  writer.writeBoolean("String_Node_Str",submitToKey);
  final ObjectDataOutput out=writer.getRawDataOutput();
  out.writeData(key);
  out.writeObject(processor);
  out.writeLong(threadId);
}
Program: 47074
Project: 47074
Buggy source:
public LockBackupOperation(ObjectNamespace namespace,Data key,long threadId,String originalCallerUuid){
  super(namespace,key,threadId);
  this.originalCallerUuid=originalCallerUuid;
}

Fixed version (ground truth):
public LockBackupOperation(ObjectNamespace namespace,Data key,long threadId,long ttl,String originalCallerUuid){
  super(namespace,key,threadId);
  this.ttl=ttl;
  this.originalCallerUuid=originalCallerUuid;
}
Program: 47075
Project: 47075
Buggy source:
@Override public Operation getBackupOperation(){
  return new LockBackupOperation(namespace,key,threadId,getCallerUuid());
}

Fixed version (ground truth):
@Override public Operation getBackupOperation(){
  return new LockBackupOperation(namespace,key,threadId,ttl,getCallerUuid());
}
Program: 47076
Project: 47076
Buggy source:
public void run(){
  try {
    lock.lockInterruptibly();
  }
 catch (  InterruptedException e) {
    latch.countDown();
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  assertFalse("String_Node_Str",lock.isLocked());
}
Program: 47077
Project: 47077
Buggy source:
@Test public void testConnectionFactoryImpl(){
  EqualsVerifier.forClass(ConnectionFactoryImpl.class).usingGetClass().withPrefabValues(ManagedConnectionFactoryImpl.class,new ManagedConnectionFactoryImpl(),new ManagedConnectionFactoryImpl()).suppress(Warning.NONFINAL_FIELDS).suppress(Warning.TRANSIENT_FIELDS).verify();
}

Fixed version (ground truth):
@Test public void testConnectionFactoryImpl(){
  EqualsVerifier.forClass(ConnectionFactoryImpl.class).usingGetClass().withPrefabValues(ManagedConnectionFactoryImpl.class,new ManagedConnectionFactoryImpl(),new ManagedConnectionFactoryImpl()).withPrefabValues(Reference.class,mock(Reference.class),mock(Reference.class)).suppress(Warning.NONFINAL_FIELDS).suppress(Warning.TRANSIENT_FIELDS).verify();
}
Program: 47078
Project: 47078
Buggy source:
private Map<TypeElement,Map<String,CodecModel>> createAllCodecModel(Lang lang){
  Map<TypeElement,Map<String,CodecModel>> model=new HashMap<TypeElement,Map<String,CodecModel>>();
  for (  Map.Entry<TypeElement,Map<String,ExecutableElement>> entry : requestMap.entrySet()) {
    HashMap<String,CodecModel> map=new HashMap<String,CodecModel>();
    TypeElement parent=entry.getKey();
    model.put(parent,map);
    for (    Map.Entry<String,ExecutableElement> entrySub : entry.getValue().entrySet()) {
      ExecutableElement methodElement=entrySub.getValue();
      CodecModel codecModel=createCodecModel(methodElement,lang);
      codecModel.commment=elementUtils.getDocComment(methodElement);
      map.put(entrySub.getKey(),codecModel);
    }
  }
  return model;
}

Fixed version (ground truth):
private Map<TypeElement,Map<String,CodecModel>> createAllCodecModel(Lang lang){
  Map<TypeElement,Map<String,CodecModel>> model=new HashMap<TypeElement,Map<String,CodecModel>>();
  for (  Map.Entry<TypeElement,Map<String,ExecutableElement>> entry : requestMap.entrySet()) {
    HashMap<String,CodecModel> map=new HashMap<String,CodecModel>();
    TypeElement parent=entry.getKey();
    model.put(parent,map);
    for (    Map.Entry<String,ExecutableElement> entrySub : entry.getValue().entrySet()) {
      ExecutableElement methodElement=entrySub.getValue();
      CodecModel codecModel=createCodecModel(methodElement,lang);
      codecModel.comment=elementUtils.getDocComment(methodElement);
      map.put(entrySub.getKey(),codecModel);
    }
  }
  return model;
}
Program: 47079
Project: 47079
Buggy source:
@Test public void testAutoQueryRegionEviction(){
  sf.getCache().evictDefaultQueryRegion();
  int entityCount=10;
  insertDummyEntities(entityCount,0);
  executeQuery(sf);
  sleepMillis(200);
  executeUpdateQuery(sf,"String_Node_Str");
  executeQuery(sf);
  sleepMillis(200);
  executeQuery(sf);
  assertEquals(1,sf.getStatistics().getQueryCacheHitCount());
  assertEquals(2,sf.getStatistics().getQueryCacheMissCount());
}

Fixed version (ground truth):
@Test public void testAutoQueryRegionEviction(){
  int entityCount=10;
  insertDummyEntities(entityCount,0);
  sleep(1);
  executeQuery(sf);
  executeUpdateQuery(sf,"String_Node_Str");
  executeQuery(sf);
  executeQuery(sf);
  assertEquals(1,sf.getStatistics().getQueryCacheHitCount());
  assertEquals(2,sf.getStatistics().getQueryCacheMissCount());
}
Program: 47080
Project: 47080
Buggy source:
@Test public void testSpecificQueryRegionEviction(){
  sf.getCache().evictDefaultQueryRegion();
  int entityCount=10;
  insertDummyEntities(entityCount,0);
  Session session=sf.openSession();
  Transaction txn=session.beginTransaction();
  Query query=session.createQuery("String_Node_Str" + DummyEntity.class.getName());
  query.setCacheable(true).setCacheRegion("String_Node_Str");
  query.list();
  txn.commit();
  session.close();
  sf.getCache().evictQueryRegion("String_Node_Str");
  session=sf.openSession();
  txn=session.beginTransaction();
  query=session.createQuery("String_Node_Str" + DummyEntity.class.getName());
  query.setCacheable(true);
  query.list();
  txn.commit();
  session.close();
  assertEquals(0,sf.getStatistics().getQueryCacheHitCount());
  assertEquals(2,sf.getStatistics().getQueryCacheMissCount());
}

Fixed version (ground truth):
@Test public void testSpecificQueryRegionEviction(){
  int entityCount=10;
  insertDummyEntities(entityCount,0);
  sleep(1);
  Session session=sf.openSession();
  Transaction txn=session.beginTransaction();
  Query query=session.createQuery("String_Node_Str" + DummyEntity.class.getName());
  query.setCacheable(true).setCacheRegion("String_Node_Str");
  query.list();
  txn.commit();
  session.close();
  sf.getCache().evictQueryRegion("String_Node_Str");
  session=sf.openSession();
  txn=session.beginTransaction();
  query=session.createQuery("String_Node_Str" + DummyEntity.class.getName());
  query.setCacheable(true);
  query.list();
  txn.commit();
  session.close();
  assertEquals(0,sf.getStatistics().getQueryCacheHitCount());
  assertEquals(2,sf.getStatistics().getQueryCacheMissCount());
}
Program: 47081
Project: 47081
Buggy source:
@Test public void testAutoQueryRegionEviction(){
  sf.getCache().evictDefaultQueryRegion();
  int entityCount=10;
  insertDummyEntities(entityCount,0);
  executeQuery(sf);
  sleepMillis(200);
  executeUpdateQuery(sf,"String_Node_Str");
  executeQuery(sf);
  sleepMillis(200);
  executeQuery(sf);
  assertEquals(1,sf.getStatistics().getQueryCacheHitCount());
  assertEquals(2,sf.getStatistics().getQueryCacheMissCount());
}

Fixed version (ground truth):
@Test public void testAutoQueryRegionEviction(){
  int entityCount=10;
  insertDummyEntities(entityCount,0);
  sleep(1);
  executeQuery(sf);
  executeUpdateQuery(sf,"String_Node_Str");
  executeQuery(sf);
  executeQuery(sf);
  assertEquals(1,sf.getStatistics().getQueryCacheHitCount());
  assertEquals(2,sf.getStatistics().getQueryCacheMissCount());
}
Program: 47082
Project: 47082
Buggy source:
@Test public void testSpecificQueryRegionEviction(){
  sf.getCache().evictDefaultQueryRegion();
  int entityCount=10;
  insertDummyEntities(entityCount,0);
  Session session=sf.openSession();
  Transaction txn=session.beginTransaction();
  Query query=session.createQuery("String_Node_Str" + DummyEntity.class.getName());
  query.setCacheable(true).setCacheRegion("String_Node_Str");
  query.list();
  txn.commit();
  session.close();
  sf.getCache().evictQueryRegion("String_Node_Str");
  session=sf.openSession();
  txn=session.beginTransaction();
  query=session.createQuery("String_Node_Str" + DummyEntity.class.getName());
  query.setCacheable(true);
  query.list();
  txn.commit();
  session.close();
  assertEquals(0,sf.getStatistics().getQueryCacheHitCount());
  assertEquals(2,sf.getStatistics().getQueryCacheMissCount());
}

Fixed version (ground truth):
@Test public void testSpecificQueryRegionEviction(){
  int entityCount=10;
  insertDummyEntities(entityCount,0);
  sleep(1);
  Session session=sf.openSession();
  Transaction txn=session.beginTransaction();
  Query query=session.createQuery("String_Node_Str" + DummyEntity.class.getName());
  query.setCacheable(true).setCacheRegion("String_Node_Str");
  query.list();
  txn.commit();
  session.close();
  sf.getCache().evictQueryRegion("String_Node_Str");
  session=sf.openSession();
  txn=session.beginTransaction();
  query=session.createQuery("String_Node_Str" + DummyEntity.class.getName());
  query.setCacheable(true);
  query.list();
  txn.commit();
  session.close();
  assertEquals(0,sf.getStatistics().getQueryCacheHitCount());
  assertEquals(2,sf.getStatistics().getQueryCacheMissCount());
}
Program: 47083
Project: 47083
Buggy source:
@Override public long capacity(){
  if (capacity == -1) {
    CapacityRequest request=new CapacityRequest(getName());
    capacity=invoke(request);
  }
  return capacity;
}

Fixed version (ground truth):
@Override public long capacity(){
  if (capacity == -1) {
    CapacityRequest request=new CapacityRequest(getName());
    capacity=(Long)invoke(request);
  }
  return capacity;
}
Program: 47084
Project: 47084
Buggy source:
public Map<String,String> getAddresses() throws Exception {
  return new DescribeInstances(awsConfig).execute();
}

Fixed version (ground truth):
public Map<String,String> getAddresses() throws Exception {
  return new DescribeInstances(awsConfig,endpoint).execute();
}
Program: 47085
Project: 47085
Buggy source:
public Collection<String> getPrivateIpAddresses() throws Exception {
  final Map<String,String> result=new DescribeInstances(awsConfig).execute();
  return result.keySet();
}

Fixed version (ground truth):
public Collection<String> getPrivateIpAddresses() throws Exception {
  final Map<String,String> result=new DescribeInstances(awsConfig,endpoint).execute();
  return result.keySet();
}
Program: 47086
Project: 47086
Buggy source:
public AWSClient(AwsConfig awsConfig){
  if (awsConfig == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (awsConfig.getAccessKey() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (awsConfig.getSecretKey() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.awsConfig=awsConfig;
  endpoint=awsConfig.getHostHeader();
}

Fixed version (ground truth):
public AWSClient(AwsConfig awsConfig){
  if (awsConfig == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (awsConfig.getAccessKey() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (awsConfig.getSecretKey() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.awsConfig=awsConfig;
  endpoint=awsConfig.getHostHeader();
  if (awsConfig.getRegion() != null && awsConfig.getRegion().length() > 0) {
    setEndpoint("String_Node_Str" + awsConfig.getRegion() + "String_Node_Str");
  }
}
Program: 47087
Project: 47087
Buggy source:
public DescribeInstances(AwsConfig awsConfig){
  if (awsConfig == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (awsConfig.getAccessKey() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.awsConfig=awsConfig;
  rs=new EC2RequestSigner(awsConfig,timeStamp);
  attributes.put("String_Node_Str",this.getClass().getSimpleName());
  attributes.put("String_Node_Str",DOC_VERSION);
  attributes.put("String_Node_Str",SIGNATURE_METHOD_V4);
  attributes.put("String_Node_Str",rs.createFormattedCredential());
  attributes.put("String_Node_Str",timeStamp);
  attributes.put("String_Node_Str","String_Node_Str");
  attributes.put("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public DescribeInstances(AwsConfig awsConfig,String endpoint){
  if (awsConfig == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (awsConfig.getAccessKey() == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.awsConfig=awsConfig;
  this.endpoint=endpoint;
  rs=new EC2RequestSigner(awsConfig,timeStamp,endpoint);
  attributes.put("String_Node_Str",this.getClass().getSimpleName());
  attributes.put("String_Node_Str",DOC_VERSION);
  attributes.put("String_Node_Str",SIGNATURE_METHOD_V4);
  attributes.put("String_Node_Str",rs.createFormattedCredential());
  attributes.put("String_Node_Str",timeStamp);
  attributes.put("String_Node_Str","String_Node_Str");
  attributes.put("String_Node_Str","String_Node_Str");
}
Program: 47088
Project: 47088
Buggy source:
public Map<String,String> execute() throws Exception {
  final String endpoint=String.format(awsConfig.getHostHeader());
  final String signature=rs.sign("String_Node_Str",attributes);
  attributes.put("String_Node_Str",signature);
  InputStream stream=callService(endpoint,signature);
  return CloudyUtility.unmarshalTheResponse(stream,awsConfig);
}

Fixed version (ground truth):
public Map<String,String> execute() throws Exception {
  final String signature=rs.sign("String_Node_Str",attributes);
  attributes.put("String_Node_Str",signature);
  InputStream stream=callService(endpoint,signature);
  return CloudyUtility.unmarshalTheResponse(stream,awsConfig);
}
Program: 47089
Project: 47089
Buggy source:
public EC2RequestSigner(AwsConfig config,final String timeStamp){
  if (config == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (timeStamp == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.config=config;
  this.timestamp=timeStamp;
  this.service=null;
}

Fixed version (ground truth):
public EC2RequestSigner(AwsConfig config,final String timeStamp,String endpoint){
  if (config == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (timeStamp == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.config=config;
  this.timestamp=timeStamp;
  this.service=null;
  this.endpoint=endpoint;
}
Program: 47090
Project: 47090
Buggy source:
protected String getCanonicalHeaders(){
  return String.format("String_Node_Str",config.getHostHeader()) + "String_Node_Str";
}

Fixed version (ground truth):
protected String getCanonicalHeaders(){
  return String.format("String_Node_Str",endpoint) + "String_Node_Str";
}
Program: 47091
Project: 47091
Buggy source:
public TcpIpJoinerOverAWS(Node node){
  super(node);
  logger=node.getLogger(getClass());
  AwsConfig awsConfig=node.getConfig().getNetworkConfig().getJoin().getAwsConfig();
  aws=new AWSClient(awsConfig);
  if (awsConfig.getRegion() != null && awsConfig.getRegion().length() > 0) {
    aws.setEndpoint("String_Node_Str" + awsConfig.getRegion() + "String_Node_Str");
  }
}

Fixed version (ground truth):
public TcpIpJoinerOverAWS(Node node){
  super(node);
  logger=node.getLogger(getClass());
  AwsConfig awsConfig=node.getConfig().getNetworkConfig().getJoin().getAwsConfig();
  aws=new AWSClient(awsConfig);
}
Program: 47092
Project: 47092
Buggy source:
@Test public void deriveSigningKeyTest(){
  AwsConfig awsConfig=new AwsConfig();
  awsConfig.setRegion(TEST_REGION);
  awsConfig.setHostHeader(TEST_HOST);
  awsConfig.setAccessKey(TEST_ACCESS_KEY);
  awsConfig.setSecretKey(TEST_SECRET_KEY);
  DescribeInstances di=new DescribeInstances(awsConfig);
  try {
    Field field=null;
    Map<String,String> attributes=null;
    field=di.getClass().getDeclaredField("String_Node_Str");
    field.setAccessible(true);
    attributes=(Map<String,String>)field.get(di);
    attributes.put("String_Node_Str",TEST_REQUEST_DATE);
    field.set(di,attributes);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  EC2RequestSigner rs=new EC2RequestSigner(awsConfig,TEST_REQUEST_DATE);
  byte[] derivedKey=null;
  try {
    Field field=null;
    field=rs.getClass().getDeclaredField("String_Node_Str");
    field.setAccessible(true);
    field.set(rs,"String_Node_Str");
    Method method=null;
    method=rs.getClass().getDeclaredMethod("String_Node_Str",null);
    method.setAccessible(true);
    derivedKey=(byte[])method.invoke(rs);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  assertEquals(TEST_DERIVED_EXPECTED,bytesToHex(derivedKey));
}

Fixed version (ground truth):
@Test public void deriveSigningKeyTest(){
  AwsConfig awsConfig=new AwsConfig();
  awsConfig.setRegion(TEST_REGION);
  awsConfig.setHostHeader(TEST_HOST);
  awsConfig.setAccessKey(TEST_ACCESS_KEY);
  awsConfig.setSecretKey(TEST_SECRET_KEY);
  DescribeInstances di=new DescribeInstances(awsConfig,TEST_HOST);
  try {
    Field field=null;
    Map<String,String> attributes=null;
    field=di.getClass().getDeclaredField("String_Node_Str");
    field.setAccessible(true);
    attributes=(Map<String,String>)field.get(di);
    attributes.put("String_Node_Str",TEST_REQUEST_DATE);
    field.set(di,attributes);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  EC2RequestSigner rs=new EC2RequestSigner(awsConfig,TEST_REQUEST_DATE,TEST_HOST);
  byte[] derivedKey=null;
  try {
    Field field=null;
    field=rs.getClass().getDeclaredField("String_Node_Str");
    field.setAccessible(true);
    field.set(rs,"String_Node_Str");
    Method method=null;
    method=rs.getClass().getDeclaredMethod("String_Node_Str",null);
    method.setAccessible(true);
    derivedKey=(byte[])method.invoke(rs);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  assertEquals(TEST_DERIVED_EXPECTED,bytesToHex(derivedKey));
}
Program: 47093
Project: 47093
Buggy source:
@Test public void testSigning() throws NoSuchFieldException, IllegalAccessException {
  AwsConfig awsConfig=new AwsConfig();
  awsConfig.setRegion(TEST_REGION);
  awsConfig.setHostHeader(TEST_HOST);
  awsConfig.setAccessKey(TEST_ACCESS_KEY);
  awsConfig.setSecretKey(TEST_SECRET_KEY);
  DescribeInstances di=new DescribeInstances(awsConfig);
  Field timeField=di.getClass().getDeclaredField("String_Node_Str");
  timeField.setAccessible(true);
  String timeStamp=(String)timeField.get(di);
  timeStamp=TEST_REQUEST_DATE;
  timeField.set(di,timeStamp);
  Field attributesField=di.getClass().getDeclaredField("String_Node_Str");
  attributesField.setAccessible(true);
  Map<String,String> attributes=(Map<String,String>)attributesField.get(di);
  attributes.put("String_Node_Str",TEST_REQUEST_DATE);
  EC2RequestSigner rs=new EC2RequestSigner(awsConfig,TEST_REQUEST_DATE);
  attributes.put("String_Node_Str",rs.createFormattedCredential());
  String signature=rs.sign(TEST_SERVICE,attributes);
  assertEquals(TEST_SIGNATURE_EXPECTED,signature);
}

Fixed version (ground truth):
@Test public void testSigning() throws NoSuchFieldException, IllegalAccessException {
  AwsConfig awsConfig=new AwsConfig();
  awsConfig.setRegion(TEST_REGION);
  awsConfig.setHostHeader(TEST_HOST);
  awsConfig.setAccessKey(TEST_ACCESS_KEY);
  awsConfig.setSecretKey(TEST_SECRET_KEY);
  DescribeInstances di=new DescribeInstances(awsConfig,TEST_HOST);
  Field timeField=di.getClass().getDeclaredField("String_Node_Str");
  timeField.setAccessible(true);
  String timeStamp=(String)timeField.get(di);
  timeStamp=TEST_REQUEST_DATE;
  timeField.set(di,timeStamp);
  Field attributesField=di.getClass().getDeclaredField("String_Node_Str");
  attributesField.setAccessible(true);
  Map<String,String> attributes=(Map<String,String>)attributesField.get(di);
  attributes.put("String_Node_Str",TEST_REQUEST_DATE);
  EC2RequestSigner rs=new EC2RequestSigner(awsConfig,TEST_REQUEST_DATE,TEST_HOST);
  attributes.put("String_Node_Str",rs.createFormattedCredential());
  String signature=rs.sign(TEST_SERVICE,attributes);
  assertEquals(TEST_SIGNATURE_EXPECTED,signature);
}
Program: 47094
Project: 47094
Buggy source:
private String getPathName(){
  Member localMember=hazelcastInstance.getCluster().getLocalMember();
  InetSocketAddress address=localMember.getSocketAddress();
  String addressString=address.getHostString().replace("String_Node_Str","String_Node_Str") + "String_Node_Str" + address.getPort();
  return "String_Node_Str" + addressString + "String_Node_Str"+ currentTimeMillis()+ "String_Node_Str";
}

Fixed version (ground truth):
private String getPathName(){
  AbstractMember localMember=(AbstractMember)hazelcastInstance.getCluster().getLocalMember();
  Address address=localMember.getAddress();
  String addressString=address.getHost().replace("String_Node_Str","String_Node_Str") + "String_Node_Str" + address.getPort();
  return "String_Node_Str" + addressString + "String_Node_Str"+ currentTimeMillis()+ "String_Node_Str";
}
Program: 47095
Project: 47095
Buggy source:
Object getLock(Object source){
  int hash=identityHashCode(source);
  hash=max(0,abs(hash));
  return stripe[hash % stripe.length];
}

Fixed version (ground truth):
Object getLock(Object source){
  int hash=identityHashCode(source);
  return hashToIndex(hash,stripe.length);
}
Program: 47096
Project: 47096
Buggy source:
private void deleteOld(){
  File file=new File(format(pathname,index - maxRollingFileCount));
  file.delete();
}

Fixed version (ground truth):
private void deleteOld(){
  File file=new File(format(pathname,index - maxRollingFileCount));
  boolean exist=file.exists();
  if (exist) {
    if (!file.delete()) {
      logger.warning("String_Node_Str" + file.getAbsolutePath());
    }
  }
}
Program: 47097
Project: 47097
Buggy source:
private int nextSelectorIndex(){
  return Math.abs(nextSelectorIndex.getAndIncrement()) % selectorThreadCount;
}

Fixed version (ground truth):
private int nextSelectorIndex(){
  int value=nextSelectorIndex.getAndIncrement();
  return HashUtil.hashToIndex(value,selectorThreadCount);
}
Program: 47098
Project: 47098
Buggy source:
@Probe(name="String_Node_Str") private long priorityBytesPending(){
  return bytesPending(urgentWriteQueue);
}

Fixed version (ground truth):
@Probe(name="String_Node_Str") public long priorityBytesPending(){
  return bytesPending(urgentWriteQueue);
}
Program: 47099
Project: 47099
Buggy source:
protected Object getMutex(final Object key){
  return mutexes[key.hashCode() != Integer.MIN_VALUE ? Math.abs(key.hashCode()) % mutexes.length : 0];
}

Fixed version (ground truth):
protected Object getMutex(Object key){
  int hashCode=key.hashCode();
  return hashToIndex(hashCode,mutexes.length);
}
Program: 47100
Project: 47100
Buggy source:
public InvocationRegistry(NodeEngineImpl nodeEngine,ILogger logger,BackpressureRegulator backpressureRegulator,int concurrencyLevel){
  this.nodeEngine=nodeEngine;
  this.logger=logger;
  this.callIdSequence=backpressureRegulator.newCallIdSequence();
  GroupProperties props=nodeEngine.getGroupProperties();
  this.slowInvocationThresholdMs=initSlowInvocationThresholdMs(props);
  this.backupTimeoutMillis=props.OPERATION_BACKUP_TIMEOUT_MILLIS.getLong();
  this.invocations=new ConcurrentHashMap<Long,Invocation>(INITIAL_CAPACITY,LOAD_FACTOR,concurrencyLevel);
  this.inspectionThread=new InspectionThread();
  inspectionThread.start();
  nodeEngine.getMetricsRegistry().scanAndRegister(this,"String_Node_Str");
}

Fixed version (ground truth):
public InvocationRegistry(NodeEngineImpl nodeEngine,ILogger logger,BackpressureRegulator backpressureRegulator,int concurrencyLevel){
  this.nodeEngine=nodeEngine;
  this.logger=logger;
  this.callIdSequence=backpressureRegulator.newCallIdSequence();
  GroupProperties props=nodeEngine.getGroupProperties();
  this.slowInvocationThresholdMs=initSlowInvocationThresholdMs(props);
  this.backupTimeoutMillis=props.OPERATION_BACKUP_TIMEOUT_MILLIS.getLong();
  this.invocations=new ConcurrentHashMap<Long,Invocation>(INITIAL_CAPACITY,LOAD_FACTOR,concurrencyLevel);
  nodeEngine.getMetricsRegistry().scanAndRegister(this,"String_Node_Str");
  this.inspectionThread=new InspectionThread();
  inspectionThread.start();
}
Program: 47101
Project: 47101
Buggy source:
private int getOrderLockIndex(String key){
  int hash=key.hashCode();
  if (hash == Integer.MIN_VALUE) {
    return 0;
  }
 else {
    return Math.abs(hash) % orderingLocks.length;
  }
}

Fixed version (ground truth):
private int getOrderLockIndex(String key){
  int hash=key.hashCode();
  return HashUtil.hashToIndex(hash,orderingLocks.length);
}
Program: 47102
Project: 47102
Buggy source:
Object getLock(Object source){
  int hash=identityHashCode(source);
  hash=max(0,abs(hash));
  return stripe[hash % stripe.length];
}

Fixed version (ground truth):
Object getLock(Object source){
  int hash=identityHashCode(source);
  return hashToIndex(hash,stripe.length);
}
Program: 47103
Project: 47103
Buggy source:
private void deleteOld(){
  File file=new File(format(pathname,index - maxRollingFileCount));
  file.delete();
}

Fixed version (ground truth):
private void deleteOld(){
  File file=new File(format(pathname,index - maxRollingFileCount));
  boolean exist=file.exists();
  if (exist) {
    if (!file.delete()) {
      logger.warning("String_Node_Str" + file.getAbsolutePath());
    }
  }
}
Program: 47104
Project: 47104
Buggy source:
private int nextSelectorIndex(){
  return Math.abs(nextSelectorIndex.getAndIncrement()) % selectorThreadCount;
}

Fixed version (ground truth):
private int nextSelectorIndex(){
  int value=nextSelectorIndex.getAndIncrement();
  return HashUtil.hashToIndex(value,selectorThreadCount);
}
Program: 47105
Project: 47105
Buggy source:
@Probe(name="String_Node_Str") private long priorityBytesPending(){
  return bytesPending(urgentWriteQueue);
}

Fixed version (ground truth):
@Probe(name="String_Node_Str") public long priorityBytesPending(){
  return bytesPending(urgentWriteQueue);
}
Program: 47106
Project: 47106
Buggy source:
protected Object getMutex(final Object key){
  return mutexes[key.hashCode() != Integer.MIN_VALUE ? Math.abs(key.hashCode()) % mutexes.length : 0];
}

Fixed version (ground truth):
protected Object getMutex(Object key){
  int hashCode=key.hashCode();
  return hashToIndex(hashCode,mutexes.length);
}
Program: 47107
Project: 47107
Buggy source:
public InvocationRegistry(NodeEngineImpl nodeEngine,ILogger logger,BackpressureRegulator backpressureRegulator,int concurrencyLevel){
  this.nodeEngine=nodeEngine;
  this.logger=logger;
  this.callIdSequence=backpressureRegulator.newCallIdSequence();
  GroupProperties props=nodeEngine.getGroupProperties();
  this.slowInvocationThresholdMs=initSlowInvocationThresholdMs(props);
  this.backupTimeoutMillis=props.OPERATION_BACKUP_TIMEOUT_MILLIS.getLong();
  this.invocations=new ConcurrentHashMap<Long,Invocation>(INITIAL_CAPACITY,LOAD_FACTOR,concurrencyLevel);
  this.inspectionThread=new InspectionThread();
  inspectionThread.start();
  nodeEngine.getMetricsRegistry().scanAndRegister(this,"String_Node_Str");
}

Fixed version (ground truth):
public InvocationRegistry(NodeEngineImpl nodeEngine,ILogger logger,BackpressureRegulator backpressureRegulator,int concurrencyLevel){
  this.nodeEngine=nodeEngine;
  this.logger=logger;
  this.callIdSequence=backpressureRegulator.newCallIdSequence();
  GroupProperties props=nodeEngine.getGroupProperties();
  this.slowInvocationThresholdMs=initSlowInvocationThresholdMs(props);
  this.backupTimeoutMillis=props.OPERATION_BACKUP_TIMEOUT_MILLIS.getLong();
  this.invocations=new ConcurrentHashMap<Long,Invocation>(INITIAL_CAPACITY,LOAD_FACTOR,concurrencyLevel);
  nodeEngine.getMetricsRegistry().scanAndRegister(this,"String_Node_Str");
  this.inspectionThread=new InspectionThread();
  inspectionThread.start();
}
Program: 47108
Project: 47108
Buggy source:
private int getOrderLockIndex(String key){
  int hash=key.hashCode();
  if (hash == Integer.MIN_VALUE) {
    return 0;
  }
 else {
    return Math.abs(hash) % orderingLocks.length;
  }
}

Fixed version (ground truth):
private int getOrderLockIndex(String key){
  int hash=key.hashCode();
  return HashUtil.hashToIndex(hash,orderingLocks.length);
}
Program: 47109
Project: 47109
Buggy source:
/** 
 * A selector is balanced if: - it has 1 active handler (so a high event count) - potentially 1 dead handler (duplicate connection). So event count should be low.
 * @param selector
 * @param handlers
 */
public void assertBalanced(IOSelector selector,Set<MigratableHandler> handlers){
  assertTrue("String_Node_Str" + selector,handlers.size() > 0);
  assertTrue("String_Node_Str" + selector,handlers.size() <= 2);
  Iterator<MigratableHandler> iterator=handlers.iterator();
  MigratableHandler activeHandler=iterator.next();
  if (handlers.size() == 2) {
    MigratableHandler deadHandler=iterator.next();
    if (activeHandler.getEventCount() < deadHandler.getEventCount()) {
      MigratableHandler tmp=deadHandler;
      deadHandler=activeHandler;
      activeHandler=tmp;
    }
    assertTrue("String_Node_Str",deadHandler.getEventCount() < 3);
  }
  assertTrue(activeHandler.getEventCount() > 10000);
}

Fixed version (ground truth):
/** 
 * A selector is balanced if: - it has 1 active handler (so a high event count) - potentially 1 dead handler (duplicate connection). So event count should be low.
 * @param selector
 * @param handlers
 */
public void assertBalanced(IOSelector selector,Set<MigratableHandler> handlers){
  assertTrue("String_Node_Str" + selector,handlers.size() > 0);
  assertTrue("String_Node_Str" + selector,handlers.size() <= 2);
  Iterator<MigratableHandler> iterator=handlers.iterator();
  MigratableHandler activeHandler=iterator.next();
  if (handlers.size() == 2) {
    MigratableHandler deadHandler=iterator.next();
    if (activeHandler.getEventCount() < deadHandler.getEventCount()) {
      MigratableHandler tmp=deadHandler;
      deadHandler=activeHandler;
      activeHandler=tmp;
    }
    assertTrue("String_Node_Str" + deadHandler.getEventCount(),deadHandler.getEventCount() < 10);
  }
  assertTrue(activeHandler.getEventCount() > 10000);
}
Program: 47110
Project: 47110
Buggy source:
public InSelectorImpl[] getInSelectors(){
  return inSelectors;
}

Fixed version (ground truth):
@edu.umd.cs.findbugs.annotations.SuppressWarnings({"String_Node_Str"}) public InSelectorImpl[] getInSelectors(){
  return inSelectors;
}
Program: 47111
Project: 47111
Buggy source:
public OutSelectorImpl[] getOutSelectors(){
  return outSelectors;
}

Fixed version (ground truth):
@edu.umd.cs.findbugs.annotations.SuppressWarnings({"String_Node_Str"}) public OutSelectorImpl[] getOutSelectors(){
  return outSelectors;
}
Program: 47112
Project: 47112
Buggy source:
public AddAllRequest(String name,Data[] items,OverflowPolicy overflowPolicy){
  super(name);
  this.items=items;
  this.overflowPolicy=overflowPolicy;
}

Fixed version (ground truth):
@edu.umd.cs.findbugs.annotations.SuppressWarnings({"String_Node_Str"}) public AddAllRequest(String name,Data[] items,OverflowPolicy overflowPolicy){
  super(name);
  this.items=items;
  this.overflowPolicy=overflowPolicy;
}
Program: 47113
Project: 47113
Buggy source:
public boolean registerConnection(final Address remoteEndPoint,final Connection connection){
  if (remoteEndPoint.equals(ioService.getThisAddress())) {
    return false;
  }
  if (connection instanceof TcpIpConnection) {
    TcpIpConnection tcpConnection=(TcpIpConnection)connection;
    Address currentEndPoint=tcpConnection.getEndPoint();
    if (currentEndPoint != null && !currentEndPoint.equals(remoteEndPoint)) {
      throw new IllegalArgumentException(connection + "String_Node_Str" + remoteEndPoint);
    }
    tcpConnection.setEndPoint(remoteEndPoint);
    if (!connection.isClient()) {
      TcpIpConnectionMonitor connectionMonitor=getConnectionMonitor(remoteEndPoint,true);
      tcpConnection.setMonitor(connectionMonitor);
    }
  }
  ioBalancer.connectionAdded(connection);
  connectionsMap.put(remoteEndPoint,connection);
  connectionsInProgress.remove(remoteEndPoint);
  ioService.getEventService().executeEventCallback(new StripedRunnable(){
    @Override public void run(){
      for (      ConnectionListener listener : connectionListeners) {
        listener.connectionAdded(connection);
      }
    }
    @Override public int getKey(){
      return remoteEndPoint.hashCode();
    }
  }
);
  return true;
}

Fixed version (ground truth):
public boolean registerConnection(final Address remoteEndPoint,final Connection connection){
  if (remoteEndPoint.equals(ioService.getThisAddress())) {
    return false;
  }
  if (connection instanceof TcpIpConnection) {
    TcpIpConnection tcpConnection=(TcpIpConnection)connection;
    Address currentEndPoint=tcpConnection.getEndPoint();
    if (currentEndPoint != null && !currentEndPoint.equals(remoteEndPoint)) {
      throw new IllegalArgumentException(connection + "String_Node_Str" + remoteEndPoint);
    }
    tcpConnection.setEndPoint(remoteEndPoint);
    if (!connection.isClient()) {
      TcpIpConnectionMonitor connectionMonitor=getConnectionMonitor(remoteEndPoint,true);
      tcpConnection.setMonitor(connectionMonitor);
    }
  }
  connectionsMap.put(remoteEndPoint,connection);
  connectionsInProgress.remove(remoteEndPoint);
  ioService.getEventService().executeEventCallback(new StripedRunnable(){
    @Override public void run(){
      for (      ConnectionListener listener : connectionListeners) {
        listener.connectionAdded(connection);
      }
    }
    @Override public int getKey(){
      return remoteEndPoint.hashCode();
    }
  }
);
  return true;
}
Program: 47114
Project: 47114
Buggy source:
TcpIpConnection assignSocketChannel(SocketChannelWrapper channel,Address endpoint){
  int index=nextSelectorIndex();
  final TcpIpConnection connection=new TcpIpConnection(this,inSelectors[index],outSelectors[index],connectionIdGen.incrementAndGet(),channel);
  connection.setEndPoint(endpoint);
  activeConnections.add(connection);
  acceptedSockets.remove(channel);
  connection.start();
  log(Level.INFO,"String_Node_Str" + channel.socket().getLocalSocketAddress());
  return connection;
}

Fixed version (ground truth):
TcpIpConnection assignSocketChannel(SocketChannelWrapper channel,Address endpoint){
  int index=nextSelectorIndex();
  final TcpIpConnection connection=new TcpIpConnection(this,inSelectors[index],outSelectors[index],connectionIdGen.incrementAndGet(),channel);
  connection.setEndPoint(endpoint);
  activeConnections.add(connection);
  acceptedSockets.remove(channel);
  connection.start();
  ioBalancer.connectionAdded(connection);
  log(Level.INFO,"String_Node_Str" + channel.socket().getLocalSocketAddress());
  return connection;
}
Program: 47115
Project: 47115
Buggy source:
private void updateNewFinalImbalance(){
  imbalance.minimumEvents=Long.MAX_VALUE;
  imbalance.maximumEvents=Long.MIN_VALUE;
  imbalance.sourceSelector=null;
  imbalance.destinationSelector=null;
  for (  AbstractIOSelector selector : selectors) {
    long eventCount=selectorEvents.get(selector);
    if (eventCount > imbalance.maximumEvents) {
      imbalance.maximumEvents=eventCount;
      imbalance.sourceSelector=selector;
    }
    if (eventCount < imbalance.minimumEvents) {
      imbalance.minimumEvents=eventCount;
      imbalance.destinationSelector=selector;
    }
  }
}

Fixed version (ground truth):
private void updateNewFinalImbalance(){
  imbalance.minimumEvents=Long.MAX_VALUE;
  imbalance.maximumEvents=Long.MIN_VALUE;
  imbalance.sourceSelector=null;
  imbalance.destinationSelector=null;
  for (  AbstractIOSelector selector : selectors) {
    long eventCount=selectorEvents.get(selector);
    int handlerCount=selectorToHandlers.get(selector).size();
    if (eventCount > imbalance.maximumEvents && handlerCount > 1) {
      imbalance.maximumEvents=eventCount;
      imbalance.sourceSelector=selector;
    }
    if (eventCount < imbalance.minimumEvents) {
      imbalance.minimumEvents=eventCount;
      imbalance.destinationSelector=selector;
    }
  }
}
Program: 47116
Project: 47116
Buggy source:
@Test public void testEachConnectionUseDifferentSelectorEventually(){
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_IO_BALANCER_INTERVAL_SECONDS,"String_Node_Str");
  config.setProperty(GroupProperties.PROP_IO_THREAD_COUNT,"String_Node_Str");
  HazelcastInstance instance1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance instance2=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance instance3=Hazelcast.newHazelcastInstance(config);
  instance2.shutdown();
  instance2=Hazelcast.newHazelcastInstance(config);
  IMap<Integer,Integer> map=instance1.getMap(randomMapName());
  long deadLine=System.currentTimeMillis() + TEST_DURATION_SECONDS * 1000;
  for (int i=0; System.currentTimeMillis() < deadLine; i++) {
    map.put(i % 1000,i);
  }
  TcpIpConnectionManager manager1=(TcpIpConnectionManager)getConnectionManager(instance1);
  Address address1=getAddress(instance1);
  TcpIpConnectionManager manager2=(TcpIpConnectionManager)getConnectionManager(instance2);
  Address address2=getAddress(instance2);
  TcpIpConnectionManager manager3=(TcpIpConnectionManager)getConnectionManager(instance3);
  Address address3=getAddress(instance3);
  assertUseDifferentSelectors(manager1,address2,address3);
  assertUseDifferentSelectors(manager2,address1,address3);
  assertUseDifferentSelectors(manager3,address1,address2);
}

Fixed version (ground truth):
@Repeat(25) @Test public void testEachConnectionUseDifferentSelectorEventually(){
  Config config=new Config();
  config.setProperty(GroupProperties.PROP_IO_BALANCER_INTERVAL_SECONDS,"String_Node_Str");
  config.setProperty(GroupProperties.PROP_IO_THREAD_COUNT,"String_Node_Str");
  HazelcastInstance instance1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance instance2=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance instance3=Hazelcast.newHazelcastInstance(config);
  instance2.shutdown();
  instance2=Hazelcast.newHazelcastInstance(config);
  IMap<Integer,Integer> map=instance1.getMap(randomMapName());
  long deadLine=System.currentTimeMillis() + TEST_DURATION_SECONDS * 1000;
  for (int i=0; System.currentTimeMillis() < deadLine; i++) {
    map.put(i % 1000,i);
  }
  assertBalanced(instance1);
  assertBalanced(instance2);
  assertBalanced(instance3);
}