nus-yam/ex-repair huggingface dataset:
Program: 50111
Project: 50111
Buggy source:
boolean sendBackup(boolean add,Address caller,Data data,int blockId,int addIndex){
  if (zeroBackup)   return true;
  if (addIndex == -1)   throw new RuntimeException("String_Node_Str");
  if (lsMembers.size() > 1) {
    MemberImpl memberBackup=getNextMemberAfter(thisAddress,true,1);
    if (memberBackup == null) {
      return true;
    }
    ClusterOperation operation=ClusterOperation.BLOCKING_QUEUE_BACKUP_REMOVE;
    if (add) {
      operation=ClusterOperation.BLOCKING_QUEUE_BACKUP_ADD;
    }
    Packet packet=obtainPacket(name,null,data,operation,0);
    packet.blockId=blockId;
    packet.longValue=addIndex;
    boolean sent=send(packet,memberBackup.getAddress());
    if (!sent) {
      releasePacket(packet);
    }
    return sent;
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
boolean sendBackup(boolean add,Address caller,Data data,int blockId,int addIndex){
  if (zeroBackup)   return true;
  if (addIndex == -1)   throw new RuntimeException("String_Node_Str");
  if (lsMembers.size() > 1) {
    MemberImpl memberBackup=getNextMemberAfter(thisAddress,true,1);
    if (memberBackup == null) {
      return true;
    }
    ClusterOperation operation=ClusterOperation.BLOCKING_QUEUE_BACKUP_REMOVE;
    if (add) {
      operation=ClusterOperation.BLOCKING_QUEUE_BACKUP_ADD;
    }
    Packet packet=obtainPacket(name,null,data,operation,0);
    packet.blockId=blockId;
    if (addIndex >= 1000) {
      throw new RuntimeException("String_Node_Str" + addIndex);
    }
    packet.longValue=addIndex;
    boolean sent=send(packet,memberBackup.getAddress());
    if (!sent) {
      releasePacket(packet);
    }
    return sent;
  }
 else {
    return true;
  }
}
Program: 50112
Project: 50112
Buggy source:
boolean evict(Request req){
  Record record=getRecord(req.key);
  long now=System.currentTimeMillis();
  if (record != null && record.isActive() && record.valueCount() > 0) {
    fireInvalidation(record);
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_EVICTED,record.getKey(),null,record.getValue(),record.getListeners(),req.caller);
    record.incrementVersion();
    markAsRemoved(record);
    req.clearForResponse();
    req.version=record.getVersion();
    req.longValue=record.getCopyCount();
    lastEvictionTime=now;
    return true;
  }
  return false;
}

Fixed version (ground truth):
boolean evict(Request req){
  Record record=getRecord(req.key);
  long now=System.currentTimeMillis();
  if (record != null && record.isActive() && record.valueCount() > 0) {
    fireInvalidation(record);
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_EVICTED,record.getKey(),null,record.getValue(),record.getListeners(),req.caller);
    record.incrementVersion();
    markAsRemoved(record);
    record.setDirty(false);
    req.clearForResponse();
    req.version=record.getVersion();
    req.longValue=record.getCopyCount();
    lastEvictionTime=now;
    return true;
  }
  return false;
}
Program: 50113
Project: 50113
Buggy source:
@Test public void testRun() throws Exception {
  final AtomicInteger counter=new AtomicInteger(0);
  final ClientRunnable clientRunnable=new ClientRunnable(){
    @Override protected void customRun() throws InterruptedException {
      counter.incrementAndGet();
    }
  }
;
  final CountDownLatch latch=new CountDownLatch(1);
  new Thread(new Runnable(){
    public void run(){
      try {
        Thread.sleep(50);
        clientRunnable.running=false;
synchronized (clientRunnable.monitor) {
          clientRunnable.monitor.wait();
        }
        latch.countDown();
      }
 catch (      InterruptedException e) {
      }
    }
  }
).start();
  clientRunnable.run();
  assertTrue(counter.get() > 1);
  assertTrue("String_Node_Str",latch.await(25,TimeUnit.SECONDS));
}

Fixed version (ground truth):
@Test public void testRun() throws Exception {
  final AtomicInteger counter=new AtomicInteger(0);
  final ClientRunnable clientRunnable=new ClientRunnable(){
    @Override protected void customRun() throws InterruptedException {
      counter.incrementAndGet();
    }
  }
;
  final CountDownLatch latch=new CountDownLatch(1);
  final CountDownLatch waitLatch=new CountDownLatch(1);
  new Thread(new Runnable(){
    public void run(){
      try {
        waitLatch.countDown();
        Thread.sleep(100);
        clientRunnable.running=false;
synchronized (clientRunnable.monitor) {
          clientRunnable.monitor.wait();
        }
        latch.countDown();
      }
 catch (      InterruptedException e) {
      }
    }
  }
).start();
  clientRunnable.run();
  waitLatch.countDown();
  assertTrue(counter.get() > 1);
  assertTrue("String_Node_Str",latch.await(25,TimeUnit.SECONDS));
}
Program: 50115
Project: 50115
Buggy source:
public void entryRemoved(EntryEvent event){
  final ProxyKey proxyKey=(ProxyKey)event.getKey();
  if (proxies.containsKey(proxyKey)) {
    logger.log(Level.FINEST,"String_Node_Str" + proxyKey);
    node.clusterService.enqueueAndReturn(new Processable(){
      public void process(){
        destroyProxy(proxyKey);
      }
    }
);
  }
}

Fixed version (ground truth):
public void entryRemoved(EntryEvent event){
  if (node.localMember.equals(event.getMember())) {
    return;
  }
  final ProxyKey proxyKey=(ProxyKey)event.getKey();
  logger.log(Level.FINEST,"String_Node_Str" + proxyKey);
  node.clusterService.enqueueAndReturn(new Processable(){
    public void process(){
      destroyProxy(proxyKey);
    }
  }
);
}
Program: 50116
Project: 50116
Buggy source:
public void entryAdded(EntryEvent event){
  final ProxyKey proxyKey=(ProxyKey)event.getKey();
  if (!proxies.containsKey(proxyKey)) {
    logger.log(Level.FINEST,"String_Node_Str" + proxyKey);
    node.clusterService.enqueueAndReturn(new Processable(){
      public void process(){
        createProxy(proxyKey);
      }
    }
);
  }
}

Fixed version (ground truth):
public void entryAdded(EntryEvent event){
  if (node.localMember.equals(event.getMember())) {
    return;
  }
  final ProxyKey proxyKey=(ProxyKey)event.getKey();
  if (!proxies.containsKey(proxyKey)) {
    logger.log(Level.FINEST,"String_Node_Str" + proxyKey);
    node.clusterService.enqueueAndReturn(new Processable(){
      public void process(){
        createProxy(proxyKey);
      }
    }
);
  }
}
Program: 50118
Project: 50118
Buggy source:
public int getDistanceFrom(Member member){
  if (member.localMember()) {
    return 0;
  }
  Integer distance=distances.get(member);
  if (distance != null) {
    return distance;
  }
  Set<Member> currentMembers=members.get();
  int size=currentMembers.size();
  Member localMember=getLocalMember();
  int index=0;
  int toIndex=getIndexOf(localMember,currentMembers);
  for (  Member m : currentMembers) {
    if (!m.equals(localMember)) {
      distance=((toIndex - index) + size) % size;
      distances.put(m,distance);
    }
    index++;
  }
  Integer d=distances.get(member);
  return (d == null) ? -1 : d;
}

Fixed version (ground truth):
public int getDistanceFrom(Member member){
  if (member.localMember()) {
    return 0;
  }
  Integer distance=distances.get(member);
  if (distance != null) {
    return distance;
  }
  calculateDistances();
  Integer d=distances.get(member);
  return (d == null) ? -1 : d;
}
Program: 50119
Project: 50119
Buggy source:
public void reset(){
  clusterMembers.clear();
  distances.clear();
  members.set(null);
  this.setMembers(Arrays.asList((MemberImpl)localMember.get()));
}

Fixed version (ground truth):
public void reset(){
  clusterMembers.clear();
  distancesWithoutSuper.clear();
  distances.clear();
  members.set(null);
  this.setMembers(Arrays.asList((MemberImpl)localMember.get()));
}
Program: 50121
Project: 50121
Buggy source:
protected MemberImpl getNextMemberAfter(final List<MemberImpl> lsMembers,final Address address,final boolean skipSuperClient,final int distance){
  final int size=lsMembers.size();
  if (size <= 1)   return null;
  int indexOfMember=-1;
  for (int i=0; i < size; i++) {
    final MemberImpl member=lsMembers.get(i);
    if (member.getAddress().equals(address)) {
      indexOfMember=i;
    }
  }
  if (indexOfMember == -1)   return null;
  int foundDistance=0;
  for (int i=1; i < size; i++) {
    final MemberImpl member=lsMembers.get((indexOfMember + i) % size);
    if (!(skipSuperClient && member.isSuperClient())) {
      foundDistance++;
    }
    if (foundDistance == distance)     return member;
  }
  return null;
}

Fixed version (ground truth):
protected MemberImpl getNextMemberAfter(final List<MemberImpl> lsMembers,final Address address,final boolean skipSuperClient,final int distance){
  final int size=lsMembers.size();
  if (size <= 1)   return null;
  int indexOfMember=-1;
  for (int i=0; i < size; i++) {
    final MemberImpl member=lsMembers.get(i);
    if (member.getAddress().equals(address)) {
      indexOfMember=i;
    }
  }
  if (indexOfMember == -1)   return null;
  int foundDistance=0;
  for (int i=indexOfMember; i < size + indexOfMember; i++) {
    final MemberImpl member=lsMembers.get((1 + i) % size);
    if (!(skipSuperClient && member.isSuperClient())) {
      foundDistance++;
    }
    if (foundDistance == distance) {
      return member;
    }
  }
  return null;
}
Program: 50124
Project: 50124
Buggy source:
@Before @After public void init() throws Exception {
  Hazelcast.shutdownAll();
}

Fixed version (ground truth):
@Before @After public void init() throws Exception {
  System.setProperty(GroupProperties.PROP_WAIT_SECONDS_BEFORE_JOIN,"String_Node_Str");
  Hazelcast.shutdownAll();
}
Program: 50125
Project: 50125
Buggy source:
@Test @Ignore public void issue395BackupProblemWithBCount2(){
  Config config=new Config();
  config.getMapConfig("String_Node_Str").setBackupCount(2);
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  IMap map1=h1.getMap("String_Node_Str");
  IMap map2=h2.getMap("String_Node_Str");
  for (int i=0; i < 1000; i++) {
    map1.put(i,i);
  }
  assertEquals(map1.getLocalMapStats().getOwnedEntryCount(),map2.getLocalMapStats().getBackupEntryCount());
  assertEquals(map2.getLocalMapStats().getOwnedEntryCount(),map1.getLocalMapStats().getBackupEntryCount());
  HazelcastInstance h3=Hazelcast.newHazelcastInstance(config);
  IMap map3=h3.getMap("String_Node_Str");
  assertEquals(map1.getLocalMapStats().getOwnedEntryCount() + map3.getLocalMapStats().getOwnedEntryCount(),map2.getLocalMapStats().getBackupEntryCount());
  assertEquals(map2.getLocalMapStats().getOwnedEntryCount() + map3.getLocalMapStats().getOwnedEntryCount(),map1.getLocalMapStats().getBackupEntryCount());
  assertEquals(map1.getLocalMapStats().getOwnedEntryCount() + map2.getLocalMapStats().getOwnedEntryCount(),map3.getLocalMapStats().getBackupEntryCount());
  h1.getLifecycleService().shutdown();
  h2.getLifecycleService().shutdown();
  h3.getLifecycleService().shutdown();
}

Fixed version (ground truth):
@Test @Ignore public void issue395BackupProblemWithBCount2(){
  Config config=new Config();
  config.getMapConfig("String_Node_Str").setBackupCount(2);
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  IMap map1=h1.getMap("String_Node_Str");
  IMap map2=h2.getMap("String_Node_Str");
  for (int i=0; i < 1000; i++) {
    map1.put(i,i);
  }
  assertEquals(map1.getLocalMapStats().getOwnedEntryCount(),map2.getLocalMapStats().getBackupEntryCount());
  assertEquals(map2.getLocalMapStats().getOwnedEntryCount(),map1.getLocalMapStats().getBackupEntryCount());
  HazelcastInstance h3=Hazelcast.newHazelcastInstance(config);
  IMap map3=h3.getMap("String_Node_Str");
  assertEquals(map1.getLocalMapStats().getOwnedEntryCount() + map3.getLocalMapStats().getOwnedEntryCount(),map2.getLocalMapStats().getBackupEntryCount());
  assertEquals(map2.getLocalMapStats().getOwnedEntryCount() + map3.getLocalMapStats().getOwnedEntryCount(),map1.getLocalMapStats().getBackupEntryCount());
  assertEquals(map1.getLocalMapStats().getOwnedEntryCount() + map2.getLocalMapStats().getOwnedEntryCount(),map3.getLocalMapStats().getBackupEntryCount());
}
Program: 50126
Project: 50126
Buggy source:
@Test(timeout=160000) public void testBackupCount() throws Exception {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(null);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(null);
  IMap map1=h1.getMap("String_Node_Str");
  IMap map2=h2.getMap("String_Node_Str");
  for (int i=0; i < 10000; i++) {
    map1.put(i,i);
  }
  assertEquals(map1.getLocalMapStats().getBackupEntryCount(),map2.getLocalMapStats().getOwnedEntryCount());
  assertEquals(map2.getLocalMapStats().getBackupEntryCount(),map1.getLocalMapStats().getOwnedEntryCount());
  HazelcastInstance h3=Hazelcast.newHazelcastInstance(null);
  IMap map3=h3.getMap("String_Node_Str");
  sleep(12000);
  assertEquals(map2.getLocalMapStats().getBackupEntryCount(),map1.getLocalMapStats().getOwnedEntryCount());
  assertEquals(map1.getLocalMapStats().getBackupEntryCount(),map3.getLocalMapStats().getOwnedEntryCount());
  assertEquals(map3.getLocalMapStats().getBackupEntryCount(),map2.getLocalMapStats().getOwnedEntryCount());
}

Fixed version (ground truth):
@Test(timeout=160000) public void testBackupCount() throws Exception {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(null);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(null);
  IMap map1=h1.getMap("String_Node_Str");
  IMap map2=h2.getMap("String_Node_Str");
  for (int i=0; i < 10000; i++) {
    map1.put(i,i);
  }
  assertEquals(map1.getLocalMapStats().getBackupEntryCount(),map2.getLocalMapStats().getOwnedEntryCount());
  assertEquals(map2.getLocalMapStats().getBackupEntryCount(),map1.getLocalMapStats().getOwnedEntryCount());
  HazelcastInstance h3=Hazelcast.newHazelcastInstance(null);
  IMap map3=h3.getMap("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(1);
  h2.getPartitionService().addMigrationListener(new MigrationListener(){
    public void migrationStarted(    MigrationEvent migrationEvent){
    }
    public void migrationCompleted(    MigrationEvent migrationEvent){
      latch.countDown();
    }
  }
);
  latch.await();
  assertEquals(map2.getLocalMapStats().getBackupEntryCount(),map1.getLocalMapStats().getOwnedEntryCount());
  assertEquals(map1.getLocalMapStats().getBackupEntryCount(),map3.getLocalMapStats().getOwnedEntryCount());
  assertEquals(map3.getLocalMapStats().getBackupEntryCount(),map2.getLocalMapStats().getOwnedEntryCount());
}
Program: 50129
Project: 50129
Buggy source:
void backupIfNextOrPreviousChanged(boolean add){
  boolean shouldBackup=false;
  if (add) {
    shouldBackup=node.clusterManager.isNextChanged();
  }
 else {
    shouldBackup=node.clusterManager.isNextChanged() || node.clusterManager.isPreviousChanged();
  }
  if (shouldBackup) {
    List<Record> lsOwnedRecords=new ArrayList<Record>(1000);
    Collection<CMap> cmaps=concurrentMapManager.maps.values();
    for (    final CMap cmap : cmaps) {
      for (      Record rec : cmap.mapRecords.values()) {
        if (rec.isActive()) {
          if (rec.getKey() == null || rec.getKey().size() == 0) {
            throw new RuntimeException("String_Node_Str" + rec.getKey());
          }
          lsOwnedRecords.add(rec);
        }
      }
    }
    if (!add)     logger.log(Level.FINEST,thisAddress + "String_Node_Str" + lsOwnedRecords.size());
    for (    final Record rec : lsOwnedRecords) {
      parallelExecutorBackups.execute(new FallThroughRunnable(){
        public void doRun(){
          concurrentMapManager.backupRecord(rec);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
void backupIfNextOrPreviousChanged(boolean add){
  List<Record> lsOwnedRecords=new ArrayList<Record>(1000);
  Collection<CMap> cmaps=concurrentMapManager.maps.values();
  for (  final CMap cmap : cmaps) {
    boolean shouldBackup=false;
    if (cmap.backupCount > 0) {
      if (add) {
        shouldBackup=node.clusterManager.isNextChanged(cmap.backupCount);
      }
 else {
        shouldBackup=node.clusterManager.isNextChanged(cmap.backupCount) || node.clusterManager.isPreviousChanged(cmap.backupCount);
      }
    }
    if (shouldBackup) {
      for (      Record rec : cmap.mapRecords.values()) {
        if (rec.isActive()) {
          if (rec.getKey() == null || rec.getKey().size() == 0) {
            throw new RuntimeException("String_Node_Str" + rec.getKey());
          }
          lsOwnedRecords.add(rec);
        }
      }
    }
  }
  if (!add)   logger.log(Level.FINEST,thisAddress + "String_Node_Str" + lsOwnedRecords.size());
  for (  final Record rec : lsOwnedRecords) {
    parallelExecutorBackups.execute(new FallThroughRunnable(){
      public void doRun(){
        concurrentMapManager.backupRecord(rec);
      }
    }
);
  }
}
Program: 50130
Project: 50130
Buggy source:
public void setLastUpdated(){
  setLastUpdateTime(System.currentTimeMillis());
}

Fixed version (ground truth):
public void setLastUpdated(){
  setLastUpdateTime(System.currentTimeMillis());
  if (expirationTime != Long.MAX_VALUE && expirationTime > 0) {
    long ttl=expirationTime - getCreationTime();
    updateExpirationTime(ttl);
  }
}
Program: 50131
Project: 50131
Buggy source:
@Ignore @Test public void issue386(){
  IMap<Object,Object> map=Hazelcast.getMap("String_Node_Str");
  int maxLoopCount=10000000;
  for (int count=0; count < maxLoopCount; count++) {
    if (count % 10000 == 0) {
      System.out.println("String_Node_Str" + count);
    }
    String o=Integer.toString(count);
    map.lock(o);
    try {
    }
  finally {
      map.unlock(o);
    }
  }
}

Fixed version (ground truth):
@Ignore @Test public void issue386(){
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(null);
  IMap map=h1.getMap("String_Node_Str");
  int maxLoopCount=10000000;
  for (int count=0; count < maxLoopCount; count++) {
    if (count % 10000 == 0) {
      System.out.println("String_Node_Str" + count);
    }
    String o=Integer.toString(count);
    map.lock(o);
    try {
    }
  finally {
      map.unlock(o);
    }
  }
}
Program: 50133
Project: 50133
Buggy source:
@Test public void issue390NoBackupWhenSuperClient() throws InterruptedException {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(null);
  IMap map1=h1.getMap("String_Node_Str");
  for (int i=0; i < 200; i++) {
    map1.put(i,new byte[1000]);
  }
  Config scconfig=new Config();
  scconfig.setSuperClient(true);
  HazelcastInstance sc=Hazelcast.newHazelcastInstance(scconfig);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(null);
  IMap map2=h2.getMap("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(2);
  h2.getPartitionService().addMigrationListener(new MigrationListener(){
    public void migrationStarted(    MigrationEvent migrationEvent){
    }
    public void migrationCompleted(    MigrationEvent migrationEvent){
      latch.countDown();
    }
  }
);
  latch.await();
  assertEquals(map2.getLocalMapStats().getOwnedEntryCount(),map1.getLocalMapStats().getBackupEntryCount());
  assertEquals(map1.getLocalMapStats().getOwnedEntryCount(),map2.getLocalMapStats().getBackupEntryCount());
}

Fixed version (ground truth):
@Test public void issue390NoBackupWhenSuperClient() throws InterruptedException {
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(null);
  IMap map1=h1.getMap("String_Node_Str");
  for (int i=0; i < 200; i++) {
    map1.put(i,new byte[1000]);
  }
  Config scconfig=new Config();
  scconfig.setSuperClient(true);
  HazelcastInstance sc=Hazelcast.newHazelcastInstance(scconfig);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(null);
  IMap map2=h2.getMap("String_Node_Str");
  final CountDownLatch latch=new CountDownLatch(2);
  h2.getPartitionService().addMigrationListener(new MigrationListener(){
    public void migrationStarted(    MigrationEvent migrationEvent){
    }
    public void migrationCompleted(    MigrationEvent migrationEvent){
      latch.countDown();
    }
  }
);
  latch.await();
  System.out.println(map1.getLocalMapStats());
  System.out.println(map2.getLocalMapStats());
  assertEquals(map2.getLocalMapStats().getOwnedEntryCount(),map1.getLocalMapStats().getBackupEntryCount());
  assertEquals(map1.getLocalMapStats().getOwnedEntryCount(),map2.getLocalMapStats().getBackupEntryCount());
}
Program: 50135
Project: 50135
Buggy source:
void reset(){
  if (locallyOwnedMap != null) {
    locallyOwnedMap.reset();
  }
  if (mapNearCache != null) {
    mapNearCache.reset();
  }
  mapRecords.clear();
  mapIndexService.clear();
}

Fixed version (ground truth):
void reset(){
  if (locallyOwnedMap != null) {
    locallyOwnedMap.reset();
  }
  if (mapNearCache != null) {
    mapNearCache.reset();
  }
  mapRecords.clear();
  mapIndexService.clear();
  if (store != null && store instanceof MapStoreWrapper) {
    try {
      ((MapStoreWrapper)store).destroy();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 50136
Project: 50136
Buggy source:
public void own(Request req){
  if (req.key == null || req.key.size() == 0) {
    throw new RuntimeException("String_Node_Str" + req.key);
  }
  if (req.value == null) {
    req.value=new Data();
  }
  Record record=toRecord(req);
  if (req.ttl <= 0 || req.timeout <= 0) {
    record.setInvalid();
  }
 else {
    record.setExpirationTime(req.ttl);
    record.setMaxIdle(req.timeout);
  }
  markAsActive(record);
  if (store != null && writeDelayMillis > 0) {
    markAsDirty(record);
  }
  updateIndexes(record);
  record.setVersion(req.version);
}

Fixed version (ground truth):
public void own(Request req){
  if (req.key == null || req.key.size() == 0) {
    throw new RuntimeException("String_Node_Str" + req.key);
  }
  Record record=toRecord(req);
  if (req.ttl <= 0 || req.timeout <= 0) {
    record.setInvalid();
  }
 else {
    record.setExpirationTime(req.ttl);
    record.setMaxIdle(req.timeout);
  }
  markAsActive(record);
  if (store != null && writeDelayMillis > 0) {
    markAsDirty(record);
  }
  if (req.value != null) {
    updateIndexes(record);
  }
  record.setVersion(req.version);
}
Program: 50139
Project: 50139
Buggy source:
public void restart(){
synchronized (lifecycleLock) {
    fireLifecycleEvent(RESTARTING);
    paused.set(true);
    List<Record> lsOwnedRecords=new ArrayList<Record>();
    for (    CMap cmap : node.concurrentMapManager.getCMaps().values()) {
      if (cmap.isUserMap()) {
        lsOwnedRecords.addAll(cmap.getMapIndexService().getOwnedRecords());
      }
    }
    node.connectionManager.onRestart();
    node.clusterManager.onRestart();
    node.concurrentMapManager.onRestart();
    node.rejoin();
    final CountDownLatch latch=new CountDownLatch(lsOwnedRecords.size());
    final ParallelExecutor executor=node.executorManager.newParallelExecutor(16);
    for (    final Record ownedRecord : lsOwnedRecords) {
      executor.execute(new Runnable(){
        public void run(){
          try {
            ConcurrentMapManager.MPut mput=node.concurrentMapManager.new MPut();
            mput.merge(ownedRecord);
            latch.countDown();
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
      }
);
    }
    try {
      latch.await(60,TimeUnit.SECONDS);
    }
 catch (    InterruptedException ignored) {
    }
    logger.log(Level.INFO,node.getThisAddress() + "String_Node_Str");
    paused.set(false);
    fireLifecycleEvent(RESTARTED);
  }
}

Fixed version (ground truth):
public void restart(){
synchronized (lifecycleLock) {
    fireLifecycleEvent(RESTARTING);
    paused.set(true);
    List<Record> lsOwnedRecords=new ArrayList<Record>();
    for (    CMap cmap : node.concurrentMapManager.getCMaps().values()) {
      if (cmap.isUserMap()) {
        lsOwnedRecords.addAll(cmap.getMapIndexService().getOwnedRecords());
      }
    }
    node.connectionManager.onRestart();
    node.clusterManager.onRestart();
    node.concurrentMapManager.onRestart();
    node.rejoin();
    final CountDownLatch latch=new CountDownLatch(lsOwnedRecords.size());
    final ParallelExecutor executor=node.executorManager.newParallelExecutor(16);
    for (    final Record ownedRecord : lsOwnedRecords) {
      executor.execute(new Runnable(){
        public void run(){
          try {
            ConcurrentMapManager.MPut mput=node.concurrentMapManager.new MPut();
            mput.merge(ownedRecord);
            latch.countDown();
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
      }
);
    }
    try {
      latch.await(60,TimeUnit.SECONDS);
    }
 catch (    InterruptedException ignored) {
    }
    paused.set(false);
    fireLifecycleEvent(RESTARTED);
  }
}
Program: 50140
Project: 50140
Buggy source:
public Object attachPutOp(String name,Object key,Object value,long timeout,boolean newRecord){
  Instance.InstanceType instanceType=ConcurrentMapManager.getInstanceType(name);
  Object matchValue=(instanceType.isMultiMap()) ? value : null;
  TransactionRecord rec=findTransactionRecord(name,key,matchValue);
  if (rec == null) {
    rec=new TransactionRecord(name,key,value,newRecord);
    rec.timeout=timeout;
    transactionRecords.add(rec);
    return null;
  }
 else {
    Object old=rec.value;
    rec.value=value;
    rec.removed=false;
    return old;
  }
}

Fixed version (ground truth):
public Object attachPutOp(String name,Object key,Object value,long timeout,long ttl,boolean newRecord){
  Instance.InstanceType instanceType=ConcurrentMapManager.getInstanceType(name);
  Object matchValue=(instanceType.isMultiMap()) ? value : null;
  TransactionRecord rec=findTransactionRecord(name,key,matchValue);
  if (rec == null) {
    rec=new TransactionRecord(name,key,value,newRecord);
    rec.timeout=timeout;
    rec.ttl=ttl;
    transactionRecords.add(rec);
    return null;
  }
 else {
    Object old=rec.value;
    rec.value=value;
    rec.removed=false;
    return old;
  }
}
Program: 50141
Project: 50141
Buggy source:
public void commitMap(){
  if (removed) {
    if (instanceType.isSet()) {
      ConcurrentMapManager.MRemoveItem mRemoveItem=factory.node.concurrentMapManager.new MRemoveItem();
      mRemoveItem.removeItem(name,key);
    }
 else     if (!newRecord) {
      if (instanceType.isMap()) {
        factory.node.concurrentMapManager.new MRemove().remove(name,key,-1);
      }
 else       if (instanceType.isMultiMap()) {
        factory.node.concurrentMapManager.new MRemoveMulti().remove(name,key,value);
      }
    }
 else {
      factory.node.concurrentMapManager.new MLock().unlock(name,key,-1);
    }
  }
 else {
    if (instanceType.isList()) {
      int count=(Integer)value;
      for (int i=0; i < count; i++) {
        factory.node.concurrentMapManager.new MAdd().addToList(name,key);
      }
    }
 else     if (instanceType.isMultiMap()) {
      factory.node.concurrentMapManager.new MPutMulti().put(name,key,value);
    }
 else {
      factory.node.concurrentMapManager.new MPut().put(name,key,value,-1,-1);
    }
  }
}

Fixed version (ground truth):
public void commitMap(){
  if (removed) {
    if (instanceType.isSet()) {
      ConcurrentMapManager.MRemoveItem mRemoveItem=factory.node.concurrentMapManager.new MRemoveItem();
      mRemoveItem.removeItem(name,key);
    }
 else     if (!newRecord) {
      if (instanceType.isMap()) {
        factory.node.concurrentMapManager.new MRemove().remove(name,key,-1);
      }
 else       if (instanceType.isMultiMap()) {
        factory.node.concurrentMapManager.new MRemoveMulti().remove(name,key,value);
      }
    }
 else {
      factory.node.concurrentMapManager.new MLock().unlock(name,key,-1);
    }
  }
 else {
    if (instanceType.isList()) {
      int count=(Integer)value;
      for (int i=0; i < count; i++) {
        factory.node.concurrentMapManager.new MAdd().addToList(name,key);
      }
    }
 else     if (instanceType.isMultiMap()) {
      factory.node.concurrentMapManager.new MPutMulti().put(name,key,value);
    }
 else {
      factory.node.concurrentMapManager.new MPut().put(name,key,value,-1,ttl);
    }
  }
}
Program: 50142
Project: 50142
Buggy source:
public void mergeOne(Record record,Data valueData){
  DataRecordEntry dataRecordEntry=new DataRecordEntry(record,valueData);
  request.setFromRecord(record);
  request.operation=CONCURRENT_MAP_MERGE;
  request.value=toData(dataRecordEntry);
  request.setBooleanRequest();
  doOp();
  Boolean returnObject=getResultAsBoolean();
  if (returnObject) {
    request.value=valueData;
    backup(CONCURRENT_MAP_BACKUP_PUT);
  }
}

Fixed version (ground truth):
public void mergeOne(Record record,Data valueData){
  DataRecordEntry dataRecordEntry=new DataRecordEntry(record,valueData);
  request.setFromRecord(record);
  request.operation=CONCURRENT_MAP_MERGE;
  request.value=toData(dataRecordEntry.getValue());
  request.setBooleanRequest();
  doOp();
  Boolean returnObject=getResultAsBoolean();
  if (returnObject) {
    request.value=valueData;
    backup(CONCURRENT_MAP_BACKUP_PUT);
  }
}
Program: 50143
Project: 50143
Buggy source:
@Override public void entryAdded(EntryEvent event){
  events2.add(event);
}

Fixed version (ground truth):
@Override public void entryAdded(EntryEvent event){
  events.add(event);
}
Program: 50144
Project: 50144
Buggy source:
public void addListener(String name,Object listener,Object key,boolean includeValue,Instance.InstanceType instanceType){
  boolean remotelyRegister=true;
  for (  ListenerItem listenerItem : listeners) {
    if (remotelyRegister) {
      if (listenerItem.listener == listener) {
        if (listenerItem.name.equals(name)) {
          if (key == null) {
            if (listenerItem.key == null) {
              if (!includeValue || listenerItem.includeValue == includeValue) {
                remotelyRegister=false;
              }
            }
          }
 else {
            if (listenerItem.key != null) {
              if (listenerItem.key.equals(key)) {
                if (!includeValue || listenerItem.includeValue == includeValue) {
                  remotelyRegister=false;
                }
              }
            }
          }
        }
      }
    }
  }
  if (remotelyRegister) {
    registerListener(name,key,true,includeValue);
  }
  ListenerItem listenerItem=new ListenerItem(name,key,listener,includeValue,instanceType);
  listeners.add(listenerItem);
}

Fixed version (ground truth):
public void addListener(String name,Object listener,Object key,boolean includeValue,Instance.InstanceType instanceType){
  boolean remotelyRegister=true;
  for (  ListenerItem listenerItem : listeners) {
    if (!remotelyRegister) {
      break;
    }
    if (listenerItem.name.equals(name)) {
      if (key == null) {
        if (listenerItem.key == null && (!includeValue || listenerItem.includeValue == includeValue)) {
          remotelyRegister=false;
        }
      }
 else       if (listenerItem.key != null) {
        if (listenerItem.key.equals(key) && (!includeValue || listenerItem.includeValue == includeValue)) {
          remotelyRegister=false;
        }
      }
    }
  }
  if (remotelyRegister) {
    registerListener(name,key,true,includeValue);
  }
  ListenerItem listenerItem=new ListenerItem(name,key,listener,includeValue,instanceType);
  listeners.add(listenerItem);
}
Program: 50146
Project: 50146
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + id + "String_Node_Str"+ (request != null ? request.getOperation() + "String_Node_Str" + request.getName()+ "String_Node_Str"+ (hasResponse() ? "String_Node_Str" : "String_Node_Str")+ Serializer.toObject(request.getKey())+ "String_Node_Str"+ Serializer.toObject(request.getValue()) : null);
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + id + "String_Node_Str"+ (request != null ? request.getOperation() : null);
}
Program: 50148
Project: 50148
Buggy source:
public Collection<Instance> getInstances(){
  final int totalSize=proxies.size();
  List<Instance> lsProxies=new ArrayList<Instance>(totalSize);
  lsProxies.addAll(proxies.values());
  return lsProxies;
}

Fixed version (ground truth):
public Collection<Instance> getInstances(){
  return new ArrayList<Instance>(proxies.values());
}
Program: 50149
Project: 50149
Buggy source:
public ClusterMBean(ManagementService service){
  super(service.instance,service);
  this.config=service.instance.getConfig();
  this.cluster=service.instance.getCluster();
  clusterObjectNames=new ObjectNameSpec(getManagedObject().getName());
}

Fixed version (ground truth):
public ClusterMBean(ManagementService service,String name){
  super(service.instance,service);
  this.name=name;
  this.config=service.instance.getConfig();
  this.cluster=service.instance.getCluster();
  clusterObjectNames=new ObjectNameSpec(name);
}
Program: 50150
Project: 50150
Buggy source:
@Override public ObjectNameSpec getNameSpec(){
  return new ObjectNameSpec("String_Node_Str",getManagedObject().getName());
}

Fixed version (ground truth):
@Override public ObjectNameSpec getNameSpec(){
  return new ObjectNameSpec("String_Node_Str",name);
}
Program: 50151
Project: 50151
Buggy source:
/** 
 * Unregister a cluster instance.
 */
public synchronized void unregister(){
  if (!started) {
    return;
  }
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(ObjectNameSpec.getClusterNameFilter(instance.getName()),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.FINE,"String_Node_Str",e);
  }
  counter.decrementAndGet();
}

Fixed version (ground truth):
/** 
 * Unregister a cluster instance.
 */
public synchronized void unregister(){
  if (!started) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(ObjectNameSpec.getClusterNameFilter(this.name),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.FINE,"String_Node_Str",e);
  }
  counter.decrementAndGet();
}
Program: 50152
Project: 50152
Buggy source:
/** 
 * Stop the management service
 */
public synchronized static void shutdown(){
  if (counter.get() > 0) {
    return;
  }
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(new ObjectName(ObjectNameSpec.NAME_DOMAIN + "String_Node_Str"),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.FINE,"String_Node_Str",e);
  }
  if (statCollectors != null) {
    statCollectors.shutdownNow();
    statCollectors=null;
  }
}

Fixed version (ground truth):
/** 
 * Stop the management service
 */
public synchronized static void shutdown(){
  if (counter.get() > 0) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(new ObjectName(ObjectNameSpec.NAME_DOMAIN + "String_Node_Str"),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    logger.log(Level.FINE,"String_Node_Str",e);
  }
  if (statCollectors != null) {
    statCollectors.shutdownNow();
    statCollectors=null;
  }
}
Program: 50153
Project: 50153
Buggy source:
/** 
 * Register all the MBeans.
 */
public synchronized void register(){
  if (!started) {
    start();
  }
  if (!started) {
    return;
  }
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  try {
    ClusterMBean clusterMBean=new ClusterMBean(this);
    mbs.registerMBean(clusterMBean,clusterMBean.getObjectName());
    DataMBean dataMBean=new DataMBean(this);
    dataMBean.setParentName(clusterMBean.getRootName());
    mbs.registerMBean(dataMBean,dataMBean.getObjectName());
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    return;
  }
  counter.incrementAndGet();
}

Fixed version (ground truth):
/** 
 * Register all the MBeans.
 */
public synchronized void register(){
  if (!started) {
    start();
  }
  if (!started) {
    return;
  }
  MBeanServer mbs=mBeanServer();
  try {
    nameLookup();
    ClusterMBean clusterMBean=new ClusterMBean(this,this.name);
    mbs.registerMBean(clusterMBean,clusterMBean.getObjectName());
    DataMBean dataMBean=new DataMBean(this);
    dataMBean.setParentName(clusterMBean.getRootName());
    mbs.registerMBean(dataMBean,dataMBean.getObjectName());
  }
 catch (  Exception e) {
    logger.log(Level.WARNING,"String_Node_Str",e);
    return;
  }
  counter.incrementAndGet();
}
Program: 50154
Project: 50154
Buggy source:
/** 
 * Test multiple Future.get() invokation
 */
@Test public void isTwoGetFromFuture() throws Exception {
  Callable<String> task=new ExecutorServiceTest.BasicTestTask();
  ExecutorService executor=getExecutorService();
  Future<String> future=executor.submit(task);
  String s1=future.get();
  assertEquals(ExecutorServiceTest.BasicTestTask.RESULT,s1);
  assertTrue(future.isDone());
  String s2=future.get();
  assertEquals(ExecutorServiceTest.BasicTestTask.RESULT,s2);
  assertTrue(future.isDone());
  String s3=future.get();
  assertEquals(ExecutorServiceTest.BasicTestTask.RESULT,s3);
  assertTrue(future.isDone());
  String s4=future.get();
  assertEquals(ExecutorServiceTest.BasicTestTask.RESULT,s4);
  assertTrue(future.isDone());
}

Fixed version (ground truth):
/** 
 * Test multiple Future.get() invocation
 */
@Test public void isTwoGetFromFuture() throws Exception {
  Callable<String> task=new ExecutorServiceTest.BasicTestTask();
  ExecutorService executor=getExecutorService();
  Future<String> future=executor.submit(task);
  String s1=future.get();
  assertEquals(ExecutorServiceTest.BasicTestTask.RESULT,s1);
  assertTrue(future.isDone());
  String s2=future.get();
  assertEquals(ExecutorServiceTest.BasicTestTask.RESULT,s2);
  assertTrue(future.isDone());
  String s3=future.get();
  assertEquals(ExecutorServiceTest.BasicTestTask.RESULT,s3);
  assertTrue(future.isDone());
  String s4=future.get();
  assertEquals(ExecutorServiceTest.BasicTestTask.RESULT,s4);
  assertTrue(future.isDone());
}
Program: 50155
Project: 50155
Buggy source:
/** 
 * Test for the issue 129. Repeadetly runs tasks and checkTime for isDone() status after get().
 */
@Test public void isDoneMethod_issue129() throws Exception {
  ExecutorService executor=getExecutorService();
  for (int i=0; i < COUNT; i++) {
    Callable<String> task1=new BasicTestTask();
    Callable<String> task2=new BasicTestTask();
    Future<?> future1=executor.submit(task1);
    Future<?> future2=executor.submit(task2);
    assertEquals(future2.get(),BasicTestTask.RESULT);
    assertTrue(future2.isDone());
    assertEquals(future1.get(),BasicTestTask.RESULT);
    assertTrue(future1.isDone());
  }
}

Fixed version (ground truth):
/** 
 * Test for the issue 129. Repeatedly runs tasks and checkTime for isDone() status after get().
 */
@Test public void isDoneMethod_issue129() throws Exception {
  ExecutorService executor=getExecutorService();
  for (int i=0; i < COUNT; i++) {
    Callable<String> task1=new BasicTestTask();
    Callable<String> task2=new BasicTestTask();
    Future<?> future1=executor.submit(task1);
    Future<?> future2=executor.submit(task2);
    assertEquals(future2.get(),BasicTestTask.RESULT);
    assertTrue(future2.isDone());
    assertEquals(future1.get(),BasicTestTask.RESULT);
    assertTrue(future1.isDone());
  }
}
Program: 50158
Project: 50158
Buggy source:
int offer(Request req){
  if (req.value == null) {
    throw new RuntimeException("String_Node_Str" + req.local);
  }
  if (req.value.size() == 0) {
    throw new RuntimeException("String_Node_Str" + req.local);
  }
  try {
    int addIndex=blCurrentPut.add(req.value);
    doFireEntryEvent(true,req.value,req.caller);
    sendBackup(true,req.caller,req.value,blCurrentPut.blockId,addIndex);
    req.longValue=addIndex;
    if (blCurrentPut.isFull()) {
      fireBlockFullEvent(blCurrentPut);
      blCurrentPut=null;
      setCurrentPut();
    }
    return addIndex;
  }
  finally {
    boolean consumed=false;
    while (!consumed && lsScheduledPollActions.size() > 0) {
      ScheduledAction pollAction=lsScheduledPollActions.remove(0);
      if (!pollAction.expired()) {
        consumed=pollAction.consume();
        node.clusterManager.deregisterScheduledAction(pollAction);
      }
    }
  }
}

Fixed version (ground truth):
int offer(Request req,boolean first){
  if (req.value == null) {
    throw new RuntimeException("String_Node_Str" + req.local);
  }
  if (req.value.size() == 0) {
    throw new RuntimeException("String_Node_Str" + req.local);
  }
  try {
    int addIndex=(first) ? blCurrentTake.addFirst(req.value) : blCurrentPut.add(req.value);
    doFireEntryEvent(true,req.value,req.caller);
    sendBackup(true,req.caller,req.value,blCurrentPut.blockId,addIndex);
    req.longValue=addIndex;
    if (blCurrentPut.isFull()) {
      fireBlockFullEvent(blCurrentPut);
      blCurrentPut=null;
      setCurrentPut();
    }
    return addIndex;
  }
  finally {
    boolean consumed=false;
    while (!consumed && lsScheduledPollActions.size() > 0) {
      ScheduledAction pollAction=lsScheduledPollActions.remove(0);
      if (!pollAction.expired()) {
        consumed=pollAction.consume();
        node.clusterManager.deregisterScheduledAction(pollAction);
      }
    }
  }
}
Program: 50159
Project: 50159
Buggy source:
@Override public boolean consume(){
  valid=rightPutTarget(request.blockId);
  if (valid) {
    offer(request);
    request.response=Boolean.TRUE;
    returnScheduledAsBoolean(request);
    return true;
  }
 else {
    request.response=OBJECT_REDO;
    returnResponse(request);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean consume(){
  valid=rightPutTarget(request.blockId);
  if (valid) {
    offer(request,false);
    request.response=Boolean.TRUE;
    returnScheduledAsBoolean(request);
    return true;
  }
 else {
    request.response=OBJECT_REDO;
    returnResponse(request);
    return false;
  }
}
Program: 50160
Project: 50160
Buggy source:
void doOffer(Request req){
  if (req.value == null) {
    throw new RuntimeException("String_Node_Str" + req.local);
  }
  if (req.value.size() == 0) {
    throw new RuntimeException("String_Node_Str" + req.local);
  }
  Q q=getQ(req.name);
  if (q.blCurrentPut == null) {
    q.setCurrentPut();
  }
  if (q.quickSize() >= q.maxSizePerJVM) {
    if (req.hasEnoughTimeToSchedule()) {
      req.scheduled=true;
      final Request reqScheduled=(req.local) ? req : req.hardCopy();
      if (reqScheduled.local) {
        if (reqScheduled.attachment == null) {
          throw new RuntimeException("String_Node_Str");
        }
      }
      q.scheduleOffer(reqScheduled);
    }
 else {
      req.response=Boolean.FALSE;
    }
    return;
  }
  q.offer(req);
  req.response=Boolean.TRUE;
}

Fixed version (ground truth):
void doOffer(Request req){
  if (req.value == null) {
    throw new RuntimeException("String_Node_Str" + req.local);
  }
  if (req.value.size() == 0) {
    throw new RuntimeException("String_Node_Str" + req.local);
  }
  Q q=getQ(req.name);
  if (q.blCurrentPut == null) {
    q.setCurrentPut();
  }
  if (q.quickSize() >= q.maxSizePerJVM) {
    if (req.hasEnoughTimeToSchedule()) {
      req.scheduled=true;
      final Request reqScheduled=(req.local) ? req : req.hardCopy();
      if (reqScheduled.local) {
        if (reqScheduled.attachment == null) {
          throw new RuntimeException("String_Node_Str");
        }
      }
      q.scheduleOffer(reqScheduled);
    }
 else {
      req.response=Boolean.FALSE;
    }
    return;
  }
  q.offer(req,false);
  req.response=Boolean.TRUE;
}
Program: 50161
Project: 50161
Buggy source:
public void commitQueue(){
  if (removed) {
    commitPoll();
  }
 else {
    offerAgain();
  }
}

Fixed version (ground truth):
public void commitQueue(){
  if (removed) {
    commitPoll();
  }
 else {
    offerAgain(false);
  }
}
Program: 50162
Project: 50162
Buggy source:
private void offerAgain(){
  Offer offer=factory.node.blockingQueueManager.new Offer();
  try {
    boolean offered=offer.offer(name,value,timeout,false);
    if (!offered) {
      throw new RuntimeException("String_Node_Str" + timeout + "String_Node_Str");
    }
  }
 catch (  InterruptedException ignored) {
  }
}

Fixed version (ground truth):
private void offerAgain(boolean first){
  Offer offer=null;
  if (first) {
    offer=factory.node.blockingQueueManager.new OfferFirst();
  }
 else {
    offer=factory.node.blockingQueueManager.new Offer();
  }
  try {
    boolean offered=offer.offer(name,value,timeout,false);
    if (!offered) {
      throw new RuntimeException("String_Node_Str" + timeout + "String_Node_Str");
    }
  }
 catch (  InterruptedException ignored) {
  }
}
Program: 50163
Project: 50163
Buggy source:
public void rollbackQueue(){
  if (removed) {
    offerAgain();
  }
}

Fixed version (ground truth):
public void rollbackQueue(){
  if (removed) {
    offerAgain(true);
  }
}
Program: 50164
Project: 50164
Buggy source:
public void onClick(ClickEvent clickEvent){
  hazelcastMonitor.onValueChangeHandler.handle(token);
}

Fixed version (ground truth):
public void onClick(ClickEvent clickEvent){
  hazelcastMonitor.onValueChangeHandler.handle(config);
}
Program: 50165
Project: 50165
Buggy source:
private Anchor createLink(String name,final String token){
  Anchor anchor=new Anchor(name);
  anchor.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent clickEvent){
      hazelcastMonitor.onValueChangeHandler.handle(token);
    }
  }
);
  return anchor;
}

Fixed version (ground truth):
private Anchor createLink(String name,final ConfigLink config){
  Anchor anchor=new Anchor(name);
  anchor.addClickHandler(new ClickHandler(){
    public void onClick(    ClickEvent clickEvent){
      hazelcastMonitor.onValueChangeHandler.handle(config);
    }
  }
);
  return anchor;
}
Program: 50166
Project: 50166
Buggy source:
public Anchor getInstanceLink(InstanceType type,String name){
  final String token="String_Node_Str" + clusterId + "String_Node_Str"+ ((type == null) ? "String_Node_Str" : type)+ "String_Node_Str"+ name;
  Anchor anchor=createLink(name,token);
  return anchor;
}

Fixed version (ground truth):
public Anchor getInstanceLink(InstanceType type,String name){
  ConfigLink config=new ConfigLink();
  config.setClusterId(clusterId);
  config.setType(type == null ? "String_Node_Str" : type.toString());
  config.setName(name);
  Anchor anchor=createLink(name,config);
  return anchor;
}