nus-yam/ex-repair huggingface dataset:
Program: 50326
Project: 50326
Buggy source:
public void connectionRemoved(Connection connection){
  if (connection.equals(this.conn)) {
    for (    Integer threadId : locks.keySet()) {
      ThreadContext.get().setCallContext(getCallContext(threadId));
      Map<IMap,List<Data>> mapOfLocks=locks.get(threadId);
      for (      IMap map : mapOfLocks.keySet()) {
        List<Data> list=mapOfLocks.get(map);
        for (        Data key : list) {
          map.unlock(key);
        }
      }
    }
    for (    IMap map : listeningMaps) {
      map.removeEntryListener(this);
    }
    for (    Map.Entry e : listeningKeysOfMaps) {
      IMap m=(IMap)e.getValue();
      m.removeEntryListener(this,e.getKey());
    }
    for (    ITopic topic : messageListeners.keySet()) {
      topic.removeMessageListener(messageListeners.get(topic));
    }
  }
}

Fixed version (ground truth):
public void connectionRemoved(Connection connection){
  if (connection.equals(this.conn)) {
    for (    Integer threadId : locks.keySet()) {
      ThreadContext.get().setCallContext(getCallContext(threadId));
      Map<IMap,List<Data>> mapOfLocks=locks.get(threadId);
      for (      IMap map : mapOfLocks.keySet()) {
        List<Data> list=mapOfLocks.get(map);
        for (        Data key : list) {
          map.unlock(key);
        }
      }
    }
    for (    IMap map : listeningMaps) {
      map.removeEntryListener(this);
    }
    for (    Map.Entry e : listeningKeysOfMaps) {
      IMap m=(IMap)e.getKey();
      m.removeEntryListener(this,e.getValue());
    }
    for (    ITopic topic : messageListeners.keySet()) {
      topic.removeMessageListener(messageListeners.get(topic));
    }
  }
}
Program: 50327
Project: 50327
Buggy source:
/** 
 * if a client is listening for both key and the entire map, then we should make sure that we don't send two separate events. One is enough. so check if we already sent one. <p/> called by executor service threads
 * @param event
 */
private void processEvent(EntryEvent event){
  final Object key=event.getKey();
  Map<Object,EntryEvent> eventProcessedLog=getEventProcessedLog(event.getName());
  if (eventProcessedLog.get(key) != null && eventProcessedLog.get(key) == event) {
    return;
  }
  eventProcessedLog.put(key,event);
  Packet packet=createEntryEventPacket(event);
  sendPacket(packet);
}

Fixed version (ground truth):
/** 
 * if a client is listening for both key and the entire map, then we should make sure that we don't send two separate events. One is enough. so check if we already sent one. <p/> called by executor service threads
 * @param event
 */
private void processEvent(EntryEvent event){
  Packet packet=createEntryEventPacket(event);
  sendPacket(packet);
}
Program: 50328
Project: 50328
Buggy source:
public void addThisAsListener(IMap map,Data key,boolean includeValue){
  if (key == null) {
    map.addEntryListener(this,includeValue);
    listeningMaps.add(map);
  }
 else {
    Object keyAsObject=toObject(key);
    map.addEntryListener(this,keyAsObject,includeValue);
    listeningKeysOfMaps.add(new Entry(keyAsObject,map));
  }
}

Fixed version (ground truth):
public synchronized void addThisAsListener(IMap map,Data key,boolean includeValue){
  if (!listeningMaps.contains(map) && !(listeningKeyExist(map,key))) {
    map.addEntryListener(this,includeValue);
  }
  if (key == null) {
    listeningMaps.add(map);
  }
 else {
    listeningKeysOfMaps.add(new Entry(map,key));
  }
}
Program: 50329
Project: 50329
Buggy source:
public void addIndex(String attribute,boolean ordered){
  proxyHelper.doOp(ClusterOperation.ADD_INDEX,attribute,ordered);
}

Fixed version (ground truth):
public void addIndex(Expression<?> expression,boolean ordered){
  proxyHelper.doOp(ClusterOperation.ADD_INDEX,expression,ordered);
}
Program: 50330
Project: 50330
Buggy source:
/** 
 * Adds an index to this map for the specified entries so that queries can run faster. <p/> Let's say your map values are Employee objects. <pre> public class Employee implements Serializable { private boolean active = false; private int age; private String name = null; // other fields. <p/> // getters setter <p/> } </pre> <p/> If you are querying your values mostly based on age and active then you should consider indexing these fields. <pre> IMap imap = Hazelcast.getMap("employees"); imap.addIndex("age", true);        // ordered, since we have ranged queries for this field imap.addIndex("active", false);    // not ordered, because boolean field cannot have range </pre> <p/> Index attribute should either have a getter method or be public. You should also make sure to add the indexes before adding entries to this map.
 * @param attribute attribute of value
 * @param ordered   <tt>true</tt> if index should be ordered,<tt>false</tt> otherwise.
 */
void addIndex(String attribute,boolean ordered);

Fixed version (ground truth):
/** 
 * Adds an index to this map based on the provided expression.
 * @param expression The expression for the index.
 * @param ordered   <tt>true</tt> if index should be ordered,<tt>false</tt> otherwise.
 */
void addIndex(Expression<?> expression,boolean ordered);
Program: 50331
Project: 50331
Buggy source:
public void addIndex(final String attribute,final boolean ordered){
  final CountDownLatch latch=new CountDownLatch(1);
  concurrentMapManager.enqueueAndReturn(new Processable(){
    public void process(){
      AddMapIndex addMapIndexProcess=new AddMapIndex(name,Predicates.get(attribute),ordered);
      concurrentMapManager.sendProcessableToAll(addMapIndexProcess,true);
      latch.countDown();
    }
  }
);
  try {
    latch.await();
  }
 catch (  InterruptedException ignored) {
  }
}

Fixed version (ground truth):
public void addIndex(final Expression expression,final boolean ordered){
  final CountDownLatch latch=new CountDownLatch(1);
  concurrentMapManager.enqueueAndReturn(new Processable(){
    public void process(){
      AddMapIndex addMapIndexProcess=new AddMapIndex(name,expression,ordered);
      concurrentMapManager.sendProcessableToAll(addMapIndexProcess,true);
      latch.countDown();
    }
  }
);
  try {
    latch.await();
  }
 catch (  InterruptedException ignored) {
  }
}
Program: 50332
Project: 50332
Buggy source:
public void process(){
  AddMapIndex addMapIndexProcess=new AddMapIndex(name,Predicates.get(attribute),ordered);
  concurrentMapManager.sendProcessableToAll(addMapIndexProcess,true);
  latch.countDown();
}

Fixed version (ground truth):
public void process(){
  AddMapIndex addMapIndexProcess=new AddMapIndex(name,expression,ordered);
  concurrentMapManager.sendProcessableToAll(addMapIndexProcess,true);
  latch.countDown();
}
Program: 50333
Project: 50333
Buggy source:
public void addIndex(String attribute,boolean ordered){
  distributedMap.addIndex(attribute,ordered);
}

Fixed version (ground truth):
public void addIndex(Expression<?> expression,boolean ordered){
  distributedMap.addIndex(expression,ordered);
}
Program: 50335
Project: 50335
Buggy source:
void doPublish(String name,Object msg){
  Data dataMsg=null;
  try {
    dataMsg=ThreadContext.get().toData(msg);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  enqueueAndReturn(new TopicPublishProcess(name,dataMsg));
}

Fixed version (ground truth):
void doPublish(String name,Object msg){
  Data dataMsg=null;
  try {
    dataMsg=toData(msg);
  }
 catch (  Exception e) {
    throw new IllegalArgumentException(e);
  }
  enqueueAndReturn(new TopicPublishProcess(name,dataMsg));
}
Program: 50336
Project: 50336
Buggy source:
protected boolean shouldExecuteAsync(Request request){
  CMap cmap=getOrCreateMap(request.name);
  return (cmap.writeDelayMillis == 0);
}

Fixed version (ground truth):
protected boolean shouldExecuteAsync(Request request){
  CMap cmap=getOrCreateMap(request.name);
  if (request.operation == CONCURRENT_MAP_GET) {
    return cmap.loader != null;
  }
 else   return cmap.writeDelayMillis == 0 && cmap.store != null;
}
Program: 50337
Project: 50337
Buggy source:
protected void schedule(Request request){
  final CMap cmap=getOrCreateMap(request.name);
  final Record record=ensureRecord(request);
  request.scheduled=true;
  ScheduledAction scheduledAction=new ScheduledAction(request){
    @Override public boolean consume(){
      handle(request);
      return true;
    }
    @Override public void onExpire(){
      onNoTimeToSchedule(request);
    }
    @Override public void onMigrate(){
      request.response=OBJECT_REDO;
      returnResponse(request);
    }
  }
;
  record.addScheduledAction(scheduledAction);
  node.clusterManager.registerScheduledAction(scheduledAction);
}

Fixed version (ground truth):
protected void schedule(Request request){
  final Record record=ensureRecord(request);
  request.scheduled=true;
  ScheduledAction scheduledAction=new ScheduledAction(request){
    @Override public boolean consume(){
      handle(request);
      return true;
    }
    @Override public void onExpire(){
      onNoTimeToSchedule(request);
    }
    @Override public void onMigrate(){
      request.response=OBJECT_REDO;
      returnResponse(request);
    }
  }
;
  record.addScheduledAction(scheduledAction);
  node.clusterManager.registerScheduledAction(scheduledAction);
}
Program: 50341
Project: 50341
Buggy source:
public void entryAdded(EntryEvent<Integer,DataSerializableUser> entryEvent){
  DataSerializableUser u=entryEvent.getValue();
  assertEquals(user.getName(),u.getName());
  assertEquals(user.getFamilyName(),u.getFamilyName());
  assertEquals(user.getAge(),u.getAge());
  assertEquals(user.getAddress().getAddress(),u.getAddress().getAddress());
  cdl.countDown();
}

Fixed version (ground truth):
public void entryAdded(EntryEvent entryEvent){
}
Program: 50342
Project: 50342
Buggy source:
public void connectionRemoved(Connection connection){
  if (connection.equals(this.conn)) {
    for (    Integer threadId : locks.keySet()) {
      ThreadContext.get().setCallContext(getCallContext(threadId));
      Map<IMap,List<Data>> mapOfLocks=locks.get(threadId);
      for (      IMap map : mapOfLocks.keySet()) {
        List<Data> list=mapOfLocks.get(map);
        for (        Data key : list) {
          map.unlock(key);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void connectionRemoved(Connection connection){
  if (connection.equals(this.conn)) {
    for (    Integer threadId : locks.keySet()) {
      ThreadContext.get().setCallContext(getCallContext(threadId));
      Map<IMap,List<Data>> mapOfLocks=locks.get(threadId);
      for (      IMap map : mapOfLocks.keySet()) {
        List<Data> list=mapOfLocks.get(map);
        for (        Data key : list) {
          map.unlock(key);
        }
      }
    }
    for (    IMap map : listeningMaps) {
      map.removeEntryListener(this);
    }
    for (    Map.Entry e : listeningKeysOfMaps) {
      IMap m=(IMap)e.getValue();
      m.removeEntryListener(this,e.getKey());
    }
    for (    ITopic topic : messageListeners.keySet()) {
      topic.removeMessageListener(messageListeners.get(topic));
    }
  }
}
Program: 50343
Project: 50343
Buggy source:
public void addThisAsListener(IMap map,Data key,boolean includeValue){
  if (key == null) {
    map.addEntryListener(this,includeValue);
  }
 else {
    map.addEntryListener(this,toObject(key),includeValue);
  }
}

Fixed version (ground truth):
public void addThisAsListener(IMap map,Data key,boolean includeValue){
  if (key == null) {
    map.addEntryListener(this,includeValue);
    listeningMaps.add(map);
  }
 else {
    Object keyAsObject=toObject(key);
    map.addEntryListener(this,keyAsObject,includeValue);
    listeningKeysOfMaps.add(new Entry(keyAsObject,map));
  }
}
Program: 50344
Project: 50344
Buggy source:
public void innerSetException(Throwable throwable){
  innerDone();
  exception=throwable;
  setException(throwable);
}

Fixed version (ground truth):
public void innerSetException(Throwable throwable,boolean done){
  if (done) {
    innerDone();
  }
  exception=throwable;
  setException(throwable);
}
Program: 50345
Project: 50345
Buggy source:
public Object doGetResult(long timeoutMillis) throws InterruptedException {
  Object result=(timeoutMillis == -1) ? getResult() : getResult(timeoutMillis,TimeUnit.MILLISECONDS);
  if (result == null) {
    result=new TimeoutException();
  }
  if (result == OBJECT_NULL) {
    result=null;
  }
 else {
    if (result instanceof Data) {
      final Data data=(Data)result;
      if (data.size() == 0) {
        result=null;
      }
 else {
        result=toObjectWithConfigClassLoader(data);
      }
    }
  }
  afterGettingResult(request);
  return result;
}

Fixed version (ground truth):
public Object doGetResult(long timeoutMillis) throws InterruptedException {
  Object result=(timeoutMillis == -1) ? getResult() : getResult(timeoutMillis,TimeUnit.MILLISECONDS);
  if (result == null) {
    result=OBJECT_NO_RESPONSE;
  }
  if (result == OBJECT_NULL) {
    result=null;
  }
 else {
    if (result instanceof Data) {
      final Data data=(Data)result;
      if (data.size() == 0) {
        result=null;
      }
 else {
        result=toObjectWithConfigClassLoader(data);
      }
    }
  }
  afterGettingResult(request);
  return result;
}
Program: 50346
Project: 50346
Buggy source:
public void get(long time,TimeUnit unit) throws InterruptedException {
  try {
    Object result=doGetResult((time == -1) ? -1 : unit.toMillis(time));
    if (result instanceof CancellationException) {
      innerFutureTask.innerSetCancelled();
    }
 else     if (result == OBJECT_MEMBER_LEFT) {
      innerFutureTask.innerSetMemberLeft(member);
    }
 else     if (result instanceof Throwable) {
      innerFutureTask.innerSetException((Throwable)result);
    }
 else {
      innerFutureTask.innerSet(result);
    }
  }
 catch (  Exception e) {
    innerFutureTask.innerSetException(e);
  }
 finally {
    if (singleTask) {
      innerFutureTask.innerDone();
    }
  }
}

Fixed version (ground truth):
public void get(long time,TimeUnit unit) throws InterruptedException {
  Object result=null;
  boolean done=true;
  try {
    result=doGetResult((time == -1) ? -1 : unit.toMillis(time));
    if (result == OBJECT_NO_RESPONSE) {
      done=false;
      innerFutureTask.innerSetException(new TimeoutException(),false);
    }
 else     if (result instanceof CancellationException) {
      innerFutureTask.innerSetCancelled();
    }
 else     if (result == OBJECT_MEMBER_LEFT) {
      innerFutureTask.innerSetMemberLeft(member);
    }
 else     if (result instanceof Throwable) {
      innerFutureTask.innerSetException((Throwable)result,true);
    }
 else {
      innerFutureTask.innerSet(result);
    }
  }
 catch (  Exception e) {
    innerFutureTask.innerSetException(e,done);
  }
 finally {
    if (singleTask && done) {
      innerFutureTask.innerDone();
    }
  }
}
Program: 50347
Project: 50347
Buggy source:
void doGet(long timeoutMillis){
  long remainingMillis=timeoutMillis;
  try {
    for (    MemberCall memberCall : lsMemberCalls) {
      long now=System.currentTimeMillis();
      if (timeoutMillis == -1) {
        memberCall.get();
      }
 else {
        if (remainingMillis < 0) {
          innerFutureTask.innerSetException(new TimeoutException());
          return;
        }
        memberCall.get(remainingMillis,TimeUnit.MILLISECONDS);
      }
      remainingMillis-=(System.currentTimeMillis() - now);
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    innerFutureTask.innerSetException(e);
  }
 finally {
    innerFutureTask.innerDone();
  }
}

Fixed version (ground truth):
void doGet(long timeoutMillis){
  boolean done=true;
  long remainingMillis=timeoutMillis;
  try {
    for (    MemberCall memberCall : lsMemberCalls) {
      long now=System.currentTimeMillis();
      if (timeoutMillis == -1) {
        memberCall.get();
      }
 else {
        if (remainingMillis < 0) {
          done=false;
          innerFutureTask.innerSetException(new TimeoutException(),done);
          return;
        }
        memberCall.get(remainingMillis,TimeUnit.MILLISECONDS);
      }
      remainingMillis-=(System.currentTimeMillis() - now);
    }
  }
 catch (  Exception e) {
    innerFutureTask.innerSetException(e,done);
  }
 finally {
    if (done) {
      innerFutureTask.innerDone();
    }
  }
}
Program: 50348
Project: 50348
Buggy source:
void innerSetException(Throwable throwable);

Fixed version (ground truth):
void innerSetException(Throwable throwable,boolean done);
Program: 50349
Project: 50349
Buggy source:
@Test public void testCancellationAwareTask(){
  CancellationAwareTask task=new CancellationAwareTask();
  ExecutorService executor=Hazelcast.getExecutorService();
  Future future=executor.submit(task);
  assertTrue(future.cancel(true));
  assertTrue(future.isCancelled());
  try {
    future.get();
    fail("String_Node_Str");
  }
 catch (  CancellationException e) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testCancellationAwareTask(){
  CancellationAwareTask task=new CancellationAwareTask(10000);
  ExecutorService executor=Hazelcast.getExecutorService();
  Future future=executor.submit(task);
  try {
    future.get(2,TimeUnit.SECONDS);
  }
 catch (  TimeoutException expected) {
  }
catch (  Exception e) {
    fail("String_Node_Str");
  }
  assertFalse(future.isDone());
  assertTrue(future.cancel(true));
  assertTrue(future.isCancelled());
  try {
    future.get();
    fail("String_Node_Str");
  }
 catch (  CancellationException e) {
  }
catch (  Exception e) {
    fail("String_Node_Str" + e.getMessage());
  }
}
Program: 50350
Project: 50350
Buggy source:
boolean evict(Request req){
  Record record=getRecord(req.key);
  if (record != null && record.isEvictable()) {
    fireInvalidation(record);
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_EVICTED,record.getKey(),record.getValue(),record.getMapListeners(),req.caller);
    record.incrementVersion();
    markAsRemoved(record);
    req.clearForResponse();
    req.version=record.getVersion();
    req.longValue=record.getCopyCount();
    lastEvictionTime=System.currentTimeMillis();
    return true;
  }
  return false;
}

Fixed version (ground truth):
boolean evict(Request req){
  Record record=getRecord(req.key);
  if (record != null) {
    fireInvalidation(record);
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_EVICTED,record.getKey(),record.getValue(),record.getMapListeners(),req.caller);
    record.incrementVersion();
    markAsRemoved(record);
    req.clearForResponse();
    req.version=record.getVersion();
    req.longValue=record.getCopyCount();
    lastEvictionTime=System.currentTimeMillis();
    return true;
  }
  return false;
}
Program: 50351
Project: 50351
Buggy source:
public void run(){
  if (keysToDeleteSize > 0) {
    if (keysToDeleteSize == 1) {
      Data key=keysToDelete.iterator().next();
      store.delete(toObject(key));
    }
 else {
      Collection realKeys=new HashSet();
      for (      Data key : keysToDelete) {
        realKeys.add(toObject(key));
      }
      store.deleteAll(realKeys);
    }
  }
  if (entriesToStoreSize > 0) {
    Object keyFirst=null;
    Object valueFirst=null;
    Set<Map.Entry<Data,Data>> entries=entriesToStore.entrySet();
    Map realEntries=new HashMap();
    for (    Map.Entry<Data,Data> entry : entries) {
      Object key=toObject(entry.getKey());
      Object value=toObject(entry.getValue());
      realEntries.put(key,value);
      if (keyFirst == null) {
        keyFirst=key;
        valueFirst=value;
      }
    }
    if (entriesToStoreSize == 1) {
      store.store(keyFirst,valueFirst);
    }
 else {
      store.storeAll(realEntries);
    }
  }
}

Fixed version (ground truth):
public void run(){
  try {
    Set<Object> keysToDelete=new HashSet<Object>();
    Map<Object,Object> updates=new HashMap<Object,Object>();
    for (    Record dirtyRecord : dirtyRecords) {
      dirtyRecord.setDirty(false);
      if (!dirtyRecord.isActive()) {
        keysToDelete.add(dirtyRecord.getRecordEntry().getKey());
      }
 else {
        Map.Entry entry=dirtyRecord.getRecordEntry();
        updates.put(entry.getKey(),entry.getValue());
      }
    }
    if (keysToDelete.size() == 1) {
      store.delete(keysToDelete.iterator().next());
    }
 else     if (keysToDelete.size() > 1) {
      store.deleteAll(keysToDelete);
    }
    if (updates.size() == 1) {
      Map.Entry entry=updates.entrySet().iterator().next();
      store.store(entry.getKey(),entry.getValue());
    }
 else     if (updates.size() > 1) {
      store.storeAll(updates);
    }
  }
 catch (  Exception e) {
    for (    Record dirtyRecord : dirtyRecords) {
      dirtyRecord.setDirty(true);
    }
  }
}
Program: 50353
Project: 50353
Buggy source:
private void executeStoreUpdate(final Map<Data,Data> entriesToStore,final Collection<Data> keysToDelete){
  final int entriesToStoreSize=entriesToStore.size();
  final int keysToDeleteSize=keysToDelete.size();
  if (entriesToStoreSize > 0 || keysToDeleteSize > 0) {
    concurrentMapManager.node.executorManager.executeStoreTask(new Runnable(){
      public void run(){
        if (keysToDeleteSize > 0) {
          if (keysToDeleteSize == 1) {
            Data key=keysToDelete.iterator().next();
            store.delete(toObject(key));
          }
 else {
            Collection realKeys=new HashSet();
            for (            Data key : keysToDelete) {
              realKeys.add(toObject(key));
            }
            store.deleteAll(realKeys);
          }
        }
        if (entriesToStoreSize > 0) {
          Object keyFirst=null;
          Object valueFirst=null;
          Set<Map.Entry<Data,Data>> entries=entriesToStore.entrySet();
          Map realEntries=new HashMap();
          for (          Map.Entry<Data,Data> entry : entries) {
            Object key=toObject(entry.getKey());
            Object value=toObject(entry.getValue());
            realEntries.put(key,value);
            if (keyFirst == null) {
              keyFirst=key;
              valueFirst=value;
            }
          }
          if (entriesToStoreSize == 1) {
            store.store(keyFirst,valueFirst);
          }
 else {
            store.storeAll(realEntries);
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
private void executeStoreUpdate(final Set<Record> dirtyRecords){
  if (dirtyRecords.size() > 0) {
    concurrentMapManager.node.executorManager.executeStoreTask(new Runnable(){
      public void run(){
        try {
          Set<Object> keysToDelete=new HashSet<Object>();
          Map<Object,Object> updates=new HashMap<Object,Object>();
          for (          Record dirtyRecord : dirtyRecords) {
            dirtyRecord.setDirty(false);
            if (!dirtyRecord.isActive()) {
              keysToDelete.add(dirtyRecord.getRecordEntry().getKey());
            }
 else {
              Map.Entry entry=dirtyRecord.getRecordEntry();
              updates.put(entry.getKey(),entry.getValue());
            }
          }
          if (keysToDelete.size() == 1) {
            store.delete(keysToDelete.iterator().next());
          }
 else           if (keysToDelete.size() > 1) {
            store.deleteAll(keysToDelete);
          }
          if (updates.size() == 1) {
            Map.Entry entry=updates.entrySet().iterator().next();
            store.store(entry.getKey(),entry.getValue());
          }
 else           if (updates.size() > 1) {
            store.storeAll(updates);
          }
        }
 catch (        Exception e) {
          for (          Record dirtyRecord : dirtyRecords) {
            dirtyRecord.setDirty(true);
          }
        }
      }
    }
);
  }
}
Program: 50355
Project: 50355
Buggy source:
public Map loadAll(Collection keys){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      Map results=new HashMap();
      for (      Object key : keys) {
        Object value=db.get(key);
        if (value != null) {
          results.put(key,value);
        }
      }
      return results;
    }
  }
  finally {
    loadAlls.incrementAndGet();
  }
}

Fixed version (ground truth):
public Map loadAll(Collection keys){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      Map results=new HashMap();
      for (      Object key : keys) {
        Object value=db.get(key);
        if (value != null) {
          results.put(key,value);
        }
      }
      return results;
    }
  }
  finally {
    loadAlls.incrementAndGet();
    notifyListeners();
  }
}
Program: 50356
Project: 50356
Buggy source:
public void delete(Object key){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      db.remove(key);
    }
  }
  finally {
    deletes.incrementAndGet();
  }
}

Fixed version (ground truth):
public void delete(Object key){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      db.remove(key);
    }
  }
  finally {
    deletes.incrementAndGet();
    notifyListeners();
  }
}
Program: 50357
Project: 50357
Buggy source:
public void storeAll(Map map){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      db.putAll(map);
    }
  }
  finally {
    storeAlls.incrementAndGet();
  }
}

Fixed version (ground truth):
public void storeAll(Map map){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      db.putAll(map);
    }
  }
  finally {
    storeAlls.incrementAndGet();
    notifyListeners();
  }
}
Program: 50358
Project: 50358
Buggy source:
public void deleteAll(Collection keys){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      for (      Object key : keys) {
        db.remove(key);
      }
    }
  }
  finally {
    deleteAlls.incrementAndGet();
  }
}

Fixed version (ground truth):
public void deleteAll(Collection keys){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      for (      Object key : keys) {
        db.remove(key);
      }
    }
  }
  finally {
    deleteAlls.incrementAndGet();
    notifyListeners();
  }
}
Program: 50359
Project: 50359
Buggy source:
public void store(Object key,Object value){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      db.put(key,value);
    }
  }
  finally {
    stores.incrementAndGet();
  }
}

Fixed version (ground truth):
public void store(Object key,Object value){
  try {
    if (shouldFail.get()) {
      throw new RuntimeException();
    }
 else {
      db.put(key,value);
    }
  }
  finally {
    stores.incrementAndGet();
    notifyListeners();
  }
}
Program: 50360
Project: 50360
Buggy source:
public void evict(long now){
  if (now - lastEvictionTime > 10000) {
    lastEvictionTime=now;
    Set<Map.Entry<Object,Record>> entries=mapCache.entrySet();
    List<Object> lsKeysToRemove=new ArrayList<Object>();
    for (    Map.Entry<Object,Record> entry : entries) {
      Object key=entry.getKey();
      Record record=entry.getValue();
      if (!record.isActive() || !record.isValid(now)) {
        lsKeysToRemove.add(key);
      }
    }
    for (    Object key : lsKeysToRemove) {
      mapCache.remove(key);
    }
  }
}

Fixed version (ground truth):
public void evict(long now){
  if (now - lastEvictionTime > 10000) {
    lastEvictionTime=now;
    Set<Map.Entry<Object,Record>> entries=mapCache.entrySet();
    List<Object> lsKeysToRemove=new ArrayList<Object>();
    for (    Map.Entry<Object,Record> entry : entries) {
      Object key=entry.getKey();
      Record record=entry.getValue();
      if (record == null || !record.isActive() || !record.isValid(now)) {
        lsKeysToRemove.add(key);
      }
    }
    for (    Object key : lsKeysToRemove) {
      mapCache.remove(key);
    }
  }
}
Program: 50361
Project: 50361
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);
  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);
  }
  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);
}
Program: 50362
Project: 50362
Buggy source:
public void instanceCreated(InstanceEvent event){
  assertEquals(InstanceEventType.CREATED,event.getEventType());
  IMap<Integer,Integer> map=(IMap<Integer,Integer>)event.getInstance();
  assertEquals(instance.getName(),map.getName());
  assertEquals(1,map.size());
  createdLatch.countDown();
}

Fixed version (ground truth):
public void instanceCreated(InstanceEvent event){
  assertEquals(InstanceEventType.CREATED,event.getEventType());
  IMap<Integer,Integer> map=(IMap<Integer,Integer>)event.getInstance();
  assertEquals(instance.getName(),map.getName());
  createdLatch.countDown();
}
Program: 50363
Project: 50363
Buggy source:
@Test public void addInstanceListener() throws InterruptedException {
  final CountDownLatch destroyedLatch=new CountDownLatch(1);
  final CountDownLatch createdLatch=new CountDownLatch(1);
  final IMap<Integer,Integer> instance=getHazelcastClient().getMap("String_Node_Str");
  InstanceListener listener=new InstanceListener(){
    public void instanceDestroyed(    InstanceEvent event){
      assertEquals(InstanceEventType.DESTROYED,event.getEventType());
      assertEquals(instance,event.getInstance());
      destroyedLatch.countDown();
    }
    public void instanceCreated(    InstanceEvent event){
      assertEquals(InstanceEventType.CREATED,event.getEventType());
      IMap<Integer,Integer> map=(IMap<Integer,Integer>)event.getInstance();
      assertEquals(instance.getName(),map.getName());
      assertEquals(1,map.size());
      createdLatch.countDown();
    }
  }
;
  getHazelcastClient().addInstanceListener(listener);
  instance.put(1,1);
  assertEquals(1,instance.size());
  assertTrue(createdLatch.await(2,TimeUnit.SECONDS));
  instance.destroy();
  assertTrue(destroyedLatch.await(2,TimeUnit.SECONDS));
  getHazelcastClient().removeInstanceListener(listener);
}

Fixed version (ground truth):
@Test public void addInstanceListener() throws InterruptedException {
  final CountDownLatch destroyedLatch=new CountDownLatch(1);
  final CountDownLatch createdLatch=new CountDownLatch(1);
  final IMap<Integer,Integer> instance=getHazelcastClient().getMap("String_Node_Str");
  InstanceListener listener=new InstanceListener(){
    public void instanceDestroyed(    InstanceEvent event){
      assertEquals(InstanceEventType.DESTROYED,event.getEventType());
      assertEquals(instance,event.getInstance());
      destroyedLatch.countDown();
    }
    public void instanceCreated(    InstanceEvent event){
      assertEquals(InstanceEventType.CREATED,event.getEventType());
      IMap<Integer,Integer> map=(IMap<Integer,Integer>)event.getInstance();
      assertEquals(instance.getName(),map.getName());
      createdLatch.countDown();
    }
  }
;
  getHazelcastClient().addInstanceListener(listener);
  instance.put(1,1);
  assertEquals(1,instance.size());
  assertTrue(createdLatch.await(10,TimeUnit.SECONDS));
  instance.destroy();
  assertTrue(destroyedLatch.await(10,TimeUnit.SECONDS));
  getHazelcastClient().removeInstanceListener(listener);
}
Program: 50365
Project: 50365
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) {
    if (getNextMemberAfter(thisAddress,true,1).getAddress().equals(caller)) {
      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,getNextMemberAfter(thisAddress,true,1).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 || memberBackup.getAddress().equals(caller)) {
      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;
  }
}
Program: 50367
Project: 50367
Buggy source:
abstract void doRun();

Fixed version (ground truth):
public abstract void doRun();
Program: 50368
Project: 50368
Buggy source:
@Test public void testTTLAndMemoryLeak2() throws Exception {
  Runtime.getRuntime().gc();
  long initialUsedMemory=getUsedMemoryAsMB();
  Config config=new XmlConfigBuilder().build();
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h3=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h4=Hazelcast.newHazelcastInstance(config);
  IMap map1=h1.getMap("String_Node_Str");
  final int size=20000;
  for (int i=0; i < size; i++) {
    map1.put(i,new byte[10000],10,TimeUnit.SECONDS);
  }
  long usedMemoryStart=getUsedMemoryAsMB();
  assertTrue(usedMemoryStart > 300);
  sleep(50000);
  Runtime.getRuntime().gc();
  sleep(5000);
  long usedMemoryEnd=getUsedMemoryAsMB();
  assertTrue(initialUsedMemory + "String_Node_Str" + usedMemoryEnd,(usedMemoryEnd - initialUsedMemory) < 50);
}

Fixed version (ground truth):
@Test public void testTTLAndMemoryLeak2() throws Exception {
  Runtime.getRuntime().gc();
  long initialUsedMemory=getUsedMemoryAsMB();
  Config config=new XmlConfigBuilder().build();
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h3=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h4=Hazelcast.newHazelcastInstance(config);
  IMap map1=h1.getMap("String_Node_Str");
  final int size=20000;
  for (int i=0; i < size; i++) {
    map1.put(i,new byte[10000],10,TimeUnit.SECONDS);
  }
  long usedMemoryStart=getUsedMemoryAsMB();
  assertTrue("String_Node_Str" + usedMemoryStart,usedMemoryStart > 300);
  sleep(50000);
  Runtime.getRuntime().gc();
  sleep(5000);
  long usedMemoryEnd=getUsedMemoryAsMB();
  assertTrue(initialUsedMemory + "String_Node_Str" + usedMemoryEnd,(usedMemoryEnd - initialUsedMemory) < 50);
}
Program: 50369
Project: 50369
Buggy source:
@Test public void testMaxIdleAndMemoryLeak() throws Exception {
  Runtime.getRuntime().gc();
  long initialUsedMemory=getUsedMemoryAsMB();
  Config config=new XmlConfigBuilder().build();
  MapConfig mapConfig=config.getMapConfig("String_Node_Str");
  mapConfig.setMaxIdleSeconds(5);
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h3=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h4=Hazelcast.newHazelcastInstance(config);
  IMap map1=h1.getMap("String_Node_Str");
  final int size=20000;
  for (int i=0; i < size; i++) {
    map1.put(i,new byte[10000]);
  }
  long usedMemoryStart=getUsedMemoryAsMB();
  assertTrue(usedMemoryStart > 300);
  sleep(50000);
  Runtime.getRuntime().gc();
  sleep(5000);
  long usedMemoryEnd=getUsedMemoryAsMB();
  assertTrue(initialUsedMemory + "String_Node_Str" + usedMemoryEnd,(usedMemoryEnd - initialUsedMemory) < 50);
}

Fixed version (ground truth):
@Test public void testMaxIdleAndMemoryLeak() throws Exception {
  Runtime.getRuntime().gc();
  long initialUsedMemory=getUsedMemoryAsMB();
  Config config=new XmlConfigBuilder().build();
  MapConfig mapConfig=config.getMapConfig("String_Node_Str");
  mapConfig.setMaxIdleSeconds(5);
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h2=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h3=Hazelcast.newHazelcastInstance(config);
  HazelcastInstance h4=Hazelcast.newHazelcastInstance(config);
  IMap map1=h1.getMap("String_Node_Str");
  final int size=20000;
  for (int i=0; i < size; i++) {
    map1.put(i,new byte[10000]);
  }
  long usedMemoryStart=getUsedMemoryAsMB();
  assertTrue("String_Node_Str" + usedMemoryStart,usedMemoryStart > 300);
  sleep(50000);
  Runtime.getRuntime().gc();
  sleep(5000);
  long usedMemoryEnd=getUsedMemoryAsMB();
  assertTrue(initialUsedMemory + "String_Node_Str" + usedMemoryEnd,(usedMemoryEnd - initialUsedMemory) < 50);
}
Program: 50370
Project: 50370
Buggy source:
public void addThisAsListener(IMap map,Data key,boolean includeValue){
  if (key == null) {
    map.addEntryListener(this,includeValue);
  }
 else {
    map.addEntryListener(this,key,includeValue);
  }
}

Fixed version (ground truth):
public void addThisAsListener(IMap map,Data key,boolean includeValue){
  if (key == null) {
    map.addEntryListener(this,includeValue);
  }
 else {
    map.addEntryListener(this,toObject(key),includeValue);
  }
}
Program: 50371
Project: 50371
Buggy source:
public boolean hasNext(){
  next=null;
  if (txnOffers != null) {
    boolean hasInTxn=txnOffers.hasNext();
    hasNextCalled=true;
    if (hasInTxn) {
      next=txnOffers.next();
      return true;
    }
 else {
      txnOffers=null;
    }
  }
  while (next == null) {
    boolean canRead=setNextBlock();
    if (!canRead)     return false;
    Read read=new Read();
    next=read.read(name,currentBlockId,currentIndex);
    if (next == null) {
      currentIndex=-1;
    }
 else {
      currentIndex=read.readIndex;
      currentIndex++;
    }
  }
  hasNextCalled=true;
  return true;
}

Fixed version (ground truth):
public boolean hasNext(){
  next=null;
  if (txnOffers != null) {
    boolean hasInTxn=txnOffers.hasNext();
    hasNextCalled=true;
    if (hasInTxn) {
      next=txnOffers.next();
      return true;
    }
 else {
      txnOffers=null;
    }
  }
  while (next == null) {
    boolean canRead=setNextBlock();
    if (!canRead)     return false;
    Read read=new Read();
    next=read.read(name,currentBlockId,currentIndex);
    if (next == null) {
      currentIndex=-1;
    }
 else {
      currentIndex=read.readIndex;
      nextBlockId=currentBlockId;
      nextIndex=currentIndex;
      currentIndex++;
    }
  }
  hasNextCalled=true;
  return true;
}
Program: 50372
Project: 50372
Buggy source:
public void flush(Connection connection) throws IOException {
  DataOutputStream dos=connection.getOutputStream();
  dos.flush();
}

Fixed version (ground truth):
public void flush(Connection connection) throws IOException {
  if (connection != null) {
    DataOutputStream dos=connection.getOutputStream();
    dos.flush();
  }
}
Program: 50373
Project: 50373
Buggy source:
public void write(Connection connection,Packet request) throws IOException {
  if (!connection.headersWritten) {
    connection.getOutputStream().write("String_Node_Str".getBytes());
    connection.headersWritten=true;
    connection.getOutputStream().flush();
  }
  DataOutputStream dos=connection.getOutputStream();
  request.writeTo(dos);
}

Fixed version (ground truth):
public void write(Connection connection,Packet request) throws IOException {
  if (connection != null) {
    if (!connection.headersWritten) {
      connection.getOutputStream().write("String_Node_Str".getBytes());
      connection.headersWritten=true;
      connection.getOutputStream().flush();
    }
    DataOutputStream dos=connection.getOutputStream();
    request.writeTo(dos);
  }
}
Program: 50376
Project: 50376
Buggy source:
public LocalMapStatsImpl getLocalMapStats(){
  ClusterImpl clusterImpl=node.getClusterImpl();
  LocalMapStatsImpl stats=new LocalMapStatsImpl();
  stats.setLockWaitCount(localMapStats.getLockWaitCount());
  stats.setLockedEntryCount(localMapStats.getLockedEntryCount());
  stats.setHits(localMapStats.getHits());
  stats.setOwnedEntryCount(localMapStats.getOwnedEntryCount());
  stats.setBackupEntryCount(localMapStats.getBackupEntryCount());
  stats.setOwnedEntryMemoryCost(localMapStats.getOwnedEntryMemoryCost());
  stats.setBackupEntryMemoryCost(localMapStats.getBackupEntryMemoryCost());
  stats.setLastEvictionTime(clusterImpl.getClusterTimeFor(lastEvictionTime));
  stats.setCreationTime(clusterImpl.getClusterTimeFor(creationTime));
  stats.setLastAccessTime(clusterImpl.getClusterTimeFor(localMapStats.getLastAccessTime()));
  stats.setLastUpdateTime(clusterImpl.getClusterTimeFor(localMapStats.getLastUpdateTime()));
  return stats;
}

Fixed version (ground truth):
public LocalMapStatsImpl getLocalMapStats(){
  LocalMapStatsImpl stats=new LocalMapStatsImpl();
  createStats(stats);
  return stats;
}
Program: 50377
Project: 50377
Buggy source:
public LocalMapStatsImpl getLocalMapStats(String name){
  final CMap cmap=getMap(name);
  if (cmap == null) {
    return new LocalMapStatsImpl();
  }
  int tryCount=0;
  while (tryCount++ < 10 && partitionManager.partitionServiceImpl.isMigrating()) {
    try {
      Thread.sleep(500);
    }
 catch (    InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
  final BlockingQueue responseQ=ResponseQueueFactory.newResponseQueue();
  enqueueAndReturn(new Processable(){
    public void process(){
      responseQ.offer(cmap.getLocalMapStats());
    }
  }
);
  try {
    return (LocalMapStatsImpl)responseQ.take();
  }
 catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public LocalMapStatsImpl getLocalMapStats(String name){
  final CMap cmap=getMap(name);
  if (cmap == null) {
    return new LocalMapStatsImpl();
  }
  return cmap.getLocalMapStats();
}
Program: 50380
Project: 50380
Buggy source:
public static Object readObject(DataInput in) throws IOException {
  byte type=in.readByte();
  if (type == 0) {
    return null;
  }
 else   if (type == 1) {
    return in.readLong();
  }
 else   if (type == 2) {
    return in.readInt();
  }
 else   if (type == 3) {
    return in.readUTF();
  }
 else   if (type == 4) {
    return in.readDouble();
  }
 else   if (type == 5) {
    return in.readFloat();
  }
 else   if (type == 6) {
    return in.readBoolean();
  }
 else   if (type == 7) {
    DataSerializable ds;
    try {
      ds=(DataSerializable)Serializer.classForName(in.readUTF()).newInstance();
    }
 catch (    Throwable e) {
      throw new IOException(e.getMessage());
    }
    ds.readData(in);
    return ds;
  }
 else   if (type == 8) {
    return new Date(in.readLong());
  }
 else   if (type == 9) {
    int len=in.readInt();
    byte[] buf=new byte[len];
    in.readFully(buf);
    ObjectInputStream oin=Serializer.newObjectInputStream(new ByteArrayInputStream(buf));
    try {
      return oin.readObject();
    }
 catch (    ClassNotFoundException e) {
      e.printStackTrace();
    }
    oin.close();
  }
 else {
    throw new IOException("String_Node_Str" + type);
  }
  return null;
}

Fixed version (ground truth):
public static Object readObject(DataInput in) throws IOException {
  byte type=in.readByte();
  if (type == 0) {
    return null;
  }
 else   if (type == 1) {
    return in.readLong();
  }
 else   if (type == 2) {
    return in.readInt();
  }
 else   if (type == 3) {
    return in.readUTF();
  }
 else   if (type == 4) {
    return in.readDouble();
  }
 else   if (type == 5) {
    return in.readFloat();
  }
 else   if (type == 6) {
    return in.readBoolean();
  }
 else   if (type == 7) {
    DataSerializable ds;
    try {
      String className=in.readUTF();
      ds=(DataSerializable)Serializer.newInstance(Serializer.classForName(className));
    }
 catch (    Throwable e) {
      throw new IOException(e.getMessage());
    }
    ds.readData(in);
    return ds;
  }
 else   if (type == 8) {
    return new Date(in.readLong());
  }
 else   if (type == 9) {
    int len=in.readInt();
    byte[] buf=new byte[len];
    in.readFully(buf);
    ObjectInputStream oin=Serializer.newObjectInputStream(new ByteArrayInputStream(buf));
    try {
      return oin.readObject();
    }
 catch (    ClassNotFoundException e) {
      e.printStackTrace();
    }
    oin.close();
  }
 else {
    throw new IOException("String_Node_Str" + type);
  }
  return null;
}
Program: 50381
Project: 50381
Buggy source:
void markAsActive(Record record){
  if (!record.isActive()) {
    record.setActive();
    record.setCreationTime(System.currentTimeMillis());
  }
}

Fixed version (ground truth):
void markAsActive(Record record){
  long now=System.currentTimeMillis();
  if (!record.isActive() || !record.isValid(now)) {
    record.setActive();
    record.setCreationTime(now);
    record.setExpirationTime(ttl);
  }
}
Program: 50382
Project: 50382
Buggy source:
public void stop(){
  if (!started)   return;
  parallelExecutorService.shutdown();
  Collection<NamedExecutorService> executors=mapExecutors.values();
  for (  NamedExecutorService namedExecutorService : executors) {
    namedExecutorService.stop();
  }
  started=false;
}

Fixed version (ground truth):
public void stop(){
  if (!started)   return;
  parallelExecutorService.shutdown();
  Collection<NamedExecutorService> executors=mapExecutors.values();
  for (  NamedExecutorService namedExecutorService : executors) {
    namedExecutorService.stop();
  }
  threadPoolExecutor.shutdownNow();
  try {
    threadPoolExecutor.awaitTermination(3,TimeUnit.SECONDS);
  }
 catch (  InterruptedException ignored) {
  }
  started=false;
}
Program: 50383
Project: 50383
Buggy source:
public void process(){
  Block block=concurrentMapManager.blocks[partitionId];
  if (block == null) {
    block=concurrentMapManager.getOrCreateBlock(partitionId);
  }
  MemberImpl memberOwner=null;
  if (block.getOwner() != null) {
    if (concurrentMapManager.thisAddress.equals(block.getOwner())) {
      memberOwner=concurrentMapManager.thisMember;
    }
 else {
      memberOwner=concurrentMapManager.getMember(block.getOwner());
    }
  }
  responseQ.offer(new PartitionReal(block.getBlockId(),memberOwner,null));
}

Fixed version (ground truth):
public void process(){
  Block block=concurrentMapManager.blocks[partitionId];
  if (block == null) {
    block=concurrentMapManager.getOrCreateBlock(partitionId);
  }
  MemberImpl memberOwner=null;
  if (block.getOwner() != null) {
    if (concurrentMapManager.thisAddress.equals(block.getOwner())) {
      memberOwner=concurrentMapManager.thisMember;
    }
 else {
      memberOwner=concurrentMapManager.getMember(block.getOwner());
    }
  }
  responseQ.offer(new PartitionReal(partitionId,memberOwner,null));
}