nus-yam/ex-repair huggingface dataset:
Program: 50540
Project: 50540
Buggy source:
protected void writeObject(DataOutput out,Object obj) throws IOException {
  if (obj == null) {
    out.writeByte(0);
  }
  if (obj instanceof Long) {
    out.writeByte(1);
    out.writeLong((Long)obj);
  }
 else   if (obj instanceof Integer) {
    out.writeByte(2);
    out.writeInt((Integer)obj);
  }
 else   if (obj instanceof String) {
    out.writeByte(3);
    out.writeUTF((String)obj);
  }
 else   if (obj instanceof Double) {
    out.writeByte(4);
    out.writeDouble((Double)obj);
  }
 else   if (obj instanceof Float) {
    out.writeByte(5);
    out.writeDouble((Float)obj);
  }
 else   if (obj instanceof Boolean) {
    out.writeByte(6);
    out.writeBoolean((Boolean)obj);
  }
 else {
    out.writeByte(7);
    ByteArrayOutputStream bos=new ByteArrayOutputStream();
    ObjectOutputStream oos=new ObjectOutputStream(bos);
    oos.writeObject(obj);
    oos.close();
    byte[] buf=bos.toByteArray();
    out.writeInt(buf.length);
    out.write(buf);
  }
}

Fixed version (ground truth):
protected void writeObject(DataOutput out,Object obj) throws IOException {
  if (obj == null) {
    out.writeByte(0);
  }
  if (obj instanceof Long) {
    out.writeByte(1);
    out.writeLong((Long)obj);
  }
 else   if (obj instanceof Integer) {
    out.writeByte(2);
    out.writeInt((Integer)obj);
  }
 else   if (obj instanceof String) {
    out.writeByte(3);
    out.writeUTF((String)obj);
  }
 else   if (obj instanceof Double) {
    out.writeByte(4);
    out.writeDouble((Double)obj);
  }
 else   if (obj instanceof Float) {
    out.writeByte(5);
    out.writeDouble((Float)obj);
  }
 else   if (obj instanceof Boolean) {
    out.writeByte(6);
    out.writeBoolean((Boolean)obj);
  }
 else   if (obj instanceof DataSerializable) {
    out.writeByte(7);
    out.writeUTF(obj.getClass().getName());
    ((DataSerializable)obj).writeData(out);
  }
 else {
    out.writeByte(8);
    ByteArrayOutputStream bos=new ByteArrayOutputStream();
    ObjectOutputStream oos=new ObjectOutputStream(bos);
    oos.writeObject(obj);
    oos.close();
    byte[] buf=bos.toByteArray();
    out.writeInt(buf.length);
    out.write(buf);
  }
}
Program: 50541
Project: 50541
Buggy source:
protected Object readObject(DataInput in) throws IOException {
  byte type=in.readByte();
  if (type == 0) {
    return null;
  }
 else   if (type == 1) {
    return in.readInt();
  }
 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) {
    int len=in.readInt();
    byte[] buf=new byte[len];
    in.readFully(buf);
    ObjectInputStream oin=new ObjectInputStream(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):
protected Object readObject(DataInput in) throws IOException {
  byte type=in.readByte();
  if (type == 0) {
    return null;
  }
 else   if (type == 1) {
    return in.readInt();
  }
 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=null;
    try {
      ds=(DataSerializable)Class.forName(in.readUTF()).newInstance();
    }
 catch (    Throwable e) {
      throw new IOException(e.getMessage());
    }
    ds.readData(in);
    return ds;
  }
 else   if (type == 8) {
    int len=in.readInt();
    byte[] buf=new byte[len];
    in.readFully(buf);
    ObjectInputStream oin=new ObjectInputStream(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: 50542
Project: 50542
Buggy source:
public void doLocalOp(){
  if (isMigrationAware() && isMigrating()) {
    setResult(OBJECT_REDO);
  }
 else {
    request.attachment=TargetAwareOp.this;
    request.local=true;
    ((RequestHandler)getPacketProcessor(request.operation)).handle(request);
  }
}

Fixed version (ground truth):
public void doLocalOp(){
  if (isMigrationAware() && isMigrating(request)) {
    setResult(OBJECT_REDO);
  }
 else {
    request.attachment=TargetAwareOp.this;
    request.local=true;
    ((RequestHandler)getPacketProcessor(request.operation)).handle(request);
  }
}
Program: 50543
Project: 50543
Buggy source:
public void processMigrationAware(Packet packet){
  if (isMigrating()) {
    packet.responseType=RESPONSE_REDO;
    sendResponse(packet);
  }
 else {
    Request remoteReq=new Request();
    remoteReq.setFromPacket(packet);
    remoteReq.local=false;
    handle(remoteReq);
    packet.returnToContainer();
  }
}

Fixed version (ground truth):
public void processMigrationAware(Packet packet){
  Request remoteReq=new Request();
  remoteReq.setFromPacket(packet);
  remoteReq.local=false;
  if (isMigrating(remoteReq)) {
    packet.responseType=RESPONSE_REDO;
    sendResponse(packet);
  }
 else {
    handle(remoteReq);
    packet.returnToContainer();
  }
}
Program: 50544
Project: 50544
Buggy source:
protected boolean isMigrating(){
  return false;
}

Fixed version (ground truth):
protected boolean isMigrating(Request req){
  return false;
}
Program: 50545
Project: 50545
Buggy source:
public Connection getConnection(){
  if (currentConnection == null) {
synchronized (ConnectionManager.class) {
      if (currentConnection == null) {
        currentConnection=searchForAvailableConnection();
        if (currentConnection != null) {
          logger.info("String_Node_Str" + currentConnection);
          bind(currentConnection);
          out.redoWaitingCalls();
        }
      }
    }
  }
  return currentConnection;
}

Fixed version (ground truth):
public Connection getConnection() throws IOException {
  Connection connection=null;
  if (currentConnection == null) {
synchronized (ConnectionManager.class) {
      if (currentConnection == null) {
        connection=searchForAvailableConnection();
        if (connection != null) {
          logger.info("String_Node_Str" + connection);
          bind(connection);
          currentConnection=connection;
          out.redoWaitingCalls();
        }
      }
    }
  }
  return currentConnection;
}
Program: 50546
Project: 50546
Buggy source:
private void bind(Connection connection){
  Bind b=null;
  try {
    b=new Bind(new Address(connection.getAddress().getHostName(),connection.getSocket().getLocalPort()));
  }
 catch (  UnknownHostException e) {
    e.printStackTrace();
  }
  Packet bind=new Packet();
  bind.set("String_Node_Str",ClusterOperation.REMOTELY_PROCESS,Serializer.toByte(null),Serializer.toByte(b));
  Call cBind=new Call();
  cBind.setRequest(bind);
  out.enQueue(cBind);
}

Fixed version (ground truth):
private void bind(Connection connection) throws IOException {
  Bind b=null;
  try {
    b=new Bind(new Address(connection.getAddress().getHostName(),connection.getSocket().getLocalPort()));
  }
 catch (  UnknownHostException e) {
    e.printStackTrace();
  }
  Packet bind=new Packet();
  bind.set("String_Node_Str",ClusterOperation.REMOTELY_PROCESS,Serializer.toByte(null),Serializer.toByte(b));
  Call cBind=new Call();
  cBind.setRequest(bind);
  out.writer.write(connection,bind);
  try {
    Thread.sleep(10);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 50547
Project: 50547
Buggy source:
public void run(){
  while (true) {
    Connection connection=connectionManager.getConnection();
    if (connection == null) {
      notifyWaitingCalls();
      continue;
    }
    Packet packet=null;
    try {
      packet=reader.readPacket(connection);
      Call c=callMap.remove(packet.getCallId());
      if (c != null) {
synchronized (c) {
          c.setResponse(packet);
          c.notify();
        }
      }
 else {
        if (packet.getOperation().equals(ClusterOperation.EVENT)) {
          listenerManager.enqueue(packet);
        }
      }
    }
 catch (    IOException e) {
      connectionManager.destroyConnection(connection);
      continue;
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    Connection connection=null;
    Packet packet=null;
    try {
      connection=connectionManager.getConnection();
      if (connection == null) {
        notifyWaitingCalls();
        continue;
      }
      packet=reader.readPacket(connection);
      Call c=null;
      if (packet.isRedoOnDisConnect()) {
        c=callMap.get(packet.getCallId());
      }
 else {
        c=callMap.remove(packet.getCallId());
      }
      if (c != null) {
synchronized (c) {
          c.setResponse(packet);
          c.notify();
        }
      }
 else {
        if (packet.getOperation().equals(ClusterOperation.EVENT)) {
          listenerManager.enqueue(packet);
        }
      }
    }
 catch (    IOException e) {
      connectionManager.destroyConnection(connection);
      continue;
    }
  }
}
Program: 50548
Project: 50548
Buggy source:
public void addEntryListener(EntryListener listener,K key,boolean includeValue){
  Packet request=createRequestPacket();
  request.setOperation(ClusterOperation.ADD_LISTENER);
  request.setLongValue(includeValue ? 1 : 0);
  request.setKey(Serializer.toByte(key));
  callAndGetResult(request);
  client.listenerManager.registerEntryListener(name,key,listener);
}

Fixed version (ground truth):
public void addEntryListener(EntryListener listener,K key,boolean includeValue){
  Packet request=createRequestPacket();
  request.setOperation(ClusterOperation.ADD_LISTENER);
  request.setLongValue(includeValue ? 1 : 0);
  request.setKey(Serializer.toByte(key));
  request.setRedoOnDisConnect(true);
  callAndGetResult(request);
  client.listenerManager.registerEntryListener(name,key,listener);
}
Program: 50549
Project: 50549
Buggy source:
public void run(){
  while (true) {
    Connection connection=null;
    Call c=null;
    try {
      try {
        c=queue.take();
        callMap.put(c.getId(),c);
        connection=connectionManager.getConnection();
        writer.write(connection,c.getRequest());
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
 catch (    IOException io) {
      io.printStackTrace();
      connectionManager.destroyConnection(connection);
      continue;
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (true) {
    Connection connection=null;
    Call c=null;
    try {
      try {
        c=queue.take();
        callMap.put(c.getId(),c);
        connection=connectionManager.getConnection();
        if (connection != null) {
          writer.write(connection,c.getRequest());
        }
      }
 catch (      InterruptedException e) {
        e.printStackTrace();
      }
    }
 catch (    IOException io) {
      io.printStackTrace();
      connectionManager.destroyConnection(connection);
      continue;
    }
  }
}
Program: 50550
Project: 50550
Buggy source:
private void redo(Call call){
  callMap.remove(call.getId());
  enQueue(call);
}

Fixed version (ground truth):
private void redo(Call call){
  System.out.println("String_Node_Str" + call);
  callMap.remove(call.getId());
  enQueue(call);
}
Program: 50551
Project: 50551
Buggy source:
public void redoWaitingCalls(){
  Collection<Call> cc=callMap.values();
  List<Call> waitingCalls=new ArrayList<Call>();
  waitingCalls.addAll(cc);
  for (Iterator<Call> iterator=waitingCalls.iterator(); iterator.hasNext(); ) {
    Call call=iterator.next();
    redo(call);
  }
}

Fixed version (ground truth):
public void redoWaitingCalls(){
  Collection<Call> cc=callMap.values();
  List<Call> waitingCalls=new ArrayList<Call>();
  waitingCalls.addAll(cc);
  for (Iterator<Call> iterator=waitingCalls.iterator(); iterator.hasNext(); ) {
    Call call=iterator.next();
    if (call.getRequest().isRedoOnDisConnect()) {
      redo(call);
    }
  }
}
Program: 50552
Project: 50552
Buggy source:
public Config(){
  final String superClientProp=System.getProperty("String_Node_Str");
  if (superClientProp != null) {
    if ("String_Node_Str".equalsIgnoreCase(superClientProp)) {
      superClient=true;
    }
  }
}

Fixed version (ground truth):
public Config(){
  final String superClientProp=System.getProperty("String_Node_Str");
  if (superClientProp != null) {
    if ("String_Node_Str".equalsIgnoreCase(superClientProp)) {
      superClient=true;
    }
  }
  String os=System.getProperty("String_Node_Str").toLowerCase();
  reuseAddress=(os.indexOf("String_Node_Str") == -1);
}
Program: 50555
Project: 50555
Buggy source:
public Data put(Request req){
  if (req.value == null) {
    req.value=new Data();
  }
  if (req.operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
    Record record=recordExist(req);
    if (record != null && record.isActive() && record.getValue() != null) {
      return doHardCopy(record.getValue());
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL) {
    Record record=recordExist(req);
    if (record == null || !record.isActive() || record.getValue() == null) {
      return null;
    }
  }
  Record record=getRecord(req.key);
  Data oldValue=null;
  boolean created=true;
  if (record == null) {
    record=createNewRecord(req.key,req.value);
    req.key=null;
  }
 else {
    created=!record.isActive();
    markAsActive(record);
    if (!record.isValid()) {
      record.setExpirationTime(ttl);
    }
    oldValue=record.getValue();
    record.setValue(req.value);
    record.incrementVersion();
    touch(record);
    record.setLastUpdated();
  }
  req.version=record.getVersion();
  req.longValue=record.getCopyCount();
  req.value=null;
  if (oldValue == null) {
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record);
  }
 else {
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_UPDATED,record);
  }
  if (req.txnId != -1) {
    unlock(record);
  }
  updateIndexes(created,req,record);
  markAsDirty(record);
  return oldValue;
}

Fixed version (ground truth):
public Data put(Request req){
  if (ownedEntryCount >= maxSize) {
    startEviction();
  }
  if (req.value == null) {
    req.value=new Data();
  }
  if (req.operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
    Record record=recordExist(req);
    if (record != null && record.isActive() && record.getValue() != null) {
      return doHardCopy(record.getValue());
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL) {
    Record record=recordExist(req);
    if (record == null || !record.isActive() || record.getValue() == null) {
      return null;
    }
  }
  Record record=getRecord(req.key);
  Data oldValue=null;
  boolean created=true;
  if (record == null) {
    record=createNewRecord(req.key,req.value);
    req.key=null;
  }
 else {
    created=!record.isActive();
    if (created) {
      ownedEntryCount++;
    }
    markAsActive(record);
    if (!record.isValid()) {
      record.setExpirationTime(ttl);
    }
    oldValue=record.getValue();
    record.setValue(req.value);
    record.incrementVersion();
    touch(record);
    record.setLastUpdated();
  }
  req.version=record.getVersion();
  req.longValue=record.getCopyCount();
  req.value=null;
  if (oldValue == null) {
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record);
  }
 else {
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_UPDATED,record);
  }
  if (req.txnId != -1) {
    unlock(record);
  }
  updateIndexes(created,req,record);
  markAsDirty(record);
  return oldValue;
}
Program: 50556
Project: 50556
Buggy source:
void reset(){
  if (locallyOwnedMap != null) {
    locallyOwnedMap.reset();
  }
  mapRecords.clear();
  ownedEntryCount=0;
  evicting=false;
  if (setDirtyRecords != null) {
    setDirtyRecords.clear();
  }
  setRemovedRecords.clear();
  node.queryService.reset(name);
}

Fixed version (ground truth):
void reset(){
  if (locallyOwnedMap != null) {
    locallyOwnedMap.reset();
  }
  mapRecords.clear();
  ownedEntryCount=0;
  if (setDirtyRecords != null) {
    setDirtyRecords.clear();
  }
  setRemovedRecords.clear();
  node.queryService.reset(name);
}
Program: 50557
Project: 50557
Buggy source:
public boolean putMulti(Request req){
  Record record=getRecord(req.key);
  boolean added=true;
  if (record == null) {
    record=createNewRecord(req.key,null);
    req.key=null;
  }
 else {
    record.setActive();
    if (record.containsValue(req.value)) {
      added=false;
    }
  }
  if (added) {
    node.queryService.updateIndex(name,null,null,record,Integer.MIN_VALUE);
    record.addValue(req.value);
    req.value=null;
    record.setVersion(record.getVersion() + 1);
    touch(record);
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record.getKey(),req.value,record.getMapListeners());
  }
  logger.log(Level.FINEST,record.getValue() + "String_Node_Str" + record.getMultiValues());
  req.version=record.getVersion();
  return added;
}

Fixed version (ground truth):
public boolean putMulti(Request req){
  Record record=getRecord(req.key);
  boolean added=true;
  if (record == null) {
    record=createNewRecord(req.key,null);
    req.key=null;
  }
 else {
    if (!record.isActive()) {
      markAsActive(record);
      ownedEntryCount++;
    }
    if (record.containsValue(req.value)) {
      added=false;
    }
  }
  if (added) {
    node.queryService.updateIndex(name,null,null,record,Integer.MIN_VALUE);
    record.addValue(req.value);
    req.value=null;
    record.setVersion(record.getVersion() + 1);
    touch(record);
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record.getKey(),req.value,record.getMapListeners());
  }
  logger.log(Level.FINEST,record.getValue() + "String_Node_Str" + record.getMultiValues());
  req.version=record.getVersion();
  return added;
}
Program: 50558
Project: 50558
Buggy source:
public void run(){
  try {
    countDownLatchEvictionStart.await();
    MEvict mEvict=new MEvict();
    mEvict.evict(name,key);
    countDownLatchEvictionEnd.countDown();
  }
 catch (  Exception ignored) {
  }
}

Fixed version (ground truth):
public void run(){
  try {
    MEvict mEvict=new MEvict();
    mEvict.evict(name,key);
  }
 catch (  Exception ignored) {
  }
}
Program: 50560
Project: 50560
Buggy source:
public void start(){
  if (completelyShutdown)   return;
  final Thread inThread=new Thread(threadGroup,inSelector,"String_Node_Str");
  inThread.setPriority(7);
  inThread.start();
  final Thread outThread=new Thread(threadGroup,outSelector,"String_Node_Str");
  outThread.setPriority(7);
  outThread.start();
  final Thread clusterServiceThread=new Thread(threadGroup,clusterService,"String_Node_Str");
  clusterServiceThread.setPriority(8);
  clusterServiceThread.start();
  final Thread queryThread=new Thread(threadGroup,queryService,"String_Node_Str");
  queryThread.setPriority(6);
  queryThread.start();
  if (config.getNetworkConfig().getJoin().getMulticastConfig().isEnabled()) {
    startMulticastService();
  }
  active=true;
  if (!completelyShutdown) {
    logger.log(Level.FINEST,"String_Node_Str");
    Runtime.getRuntime().addShutdownHook(shutdownHookThread);
  }
  join();
}

Fixed version (ground truth):
public void start(){
  if (completelyShutdown)   return;
  final Thread inThread=new Thread(threadGroup,inSelector,"String_Node_Str");
  inThread.setPriority(7);
  inThread.start();
  final Thread outThread=new Thread(threadGroup,outSelector,"String_Node_Str");
  outThread.setPriority(7);
  outThread.start();
  final Thread clusterServiceThread=new Thread(threadGroup,clusterService,"String_Node_Str");
  clusterServiceThread.setPriority(8);
  clusterServiceThread.start();
  final Thread queryThread=new Thread(threadGroup,queryService,"String_Node_Str");
  queryThread.setPriority(6);
  queryThread.start();
  if (config.getNetworkConfig().getJoin().getMulticastConfig().isEnabled()) {
    final Thread multicastServiceThread=new Thread(threadGroup,multicastService,"String_Node_Str");
    multicastServiceThread.start();
    multicastServiceThread.setPriority(6);
  }
  active=true;
  if (!completelyShutdown) {
    logger.log(Level.FINEST,"String_Node_Str");
    Runtime.getRuntime().addShutdownHook(shutdownHookThread);
  }
  join();
}
Program: 50561
Project: 50561
Buggy source:
public void shutdown(){
  try {
    if (active) {
      joined=false;
      active=false;
      inSelector.shutdown();
      outSelector.shutdown();
      clusterService.stop();
      queryService.stop();
      multicastService.stop();
      connectionManager.shutdown();
      concurrentMapManager.reset();
      clientService.reset();
      executorManager.stop();
      address=null;
      masterAddress=null;
      clusterManager.stop();
      int numThreads=threadGroup.activeCount();
      Thread[] threads=new Thread[numThreads * 2];
      numThreads=threadGroup.enumerate(threads,false);
      for (int i=0; i < numThreads; i++) {
        Thread thread=threads[i];
        thread.interrupt();
      }
    }
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void shutdown(){
  if (active) {
    joined=false;
    active=false;
    inSelector.shutdown();
    outSelector.shutdown();
    clusterService.stop();
    queryService.stop();
    if (multicastService != null) {
      multicastService.stop();
    }
    connectionManager.shutdown();
    concurrentMapManager.reset();
    clientService.reset();
    executorManager.stop();
    address=null;
    masterAddress=null;
    clusterManager.stop();
    int numThreads=threadGroup.activeCount();
    Thread[] threads=new Thread[numThreads * 2];
    numThreads=threadGroup.enumerate(threads,false);
    for (int i=0; i < numThreads; i++) {
      Thread thread=threads[i];
      thread.interrupt();
    }
  }
}
Program: 50562
Project: 50562
Buggy source:
@Test public void testMapRemove(){
  IMap<String,String> map=Hazelcast.getMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.remove("String_Node_Str");
  assertEquals(0,map.size());
}

Fixed version (ground truth):
@Test public void testMapRemove(){
  IMap<String,String> map=Hazelcast.getMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(1,map.size());
  assertEquals(1,map.keySet().size());
  map.remove("String_Node_Str");
  assertEquals(0,map.size());
  assertEquals(0,map.keySet().size());
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(1,map.size());
  assertEquals(1,map.keySet().size());
}
Program: 50563
Project: 50563
Buggy source:
@Test public void testMultiMapRemove(){
  MultiMap<String,String> map=Hazelcast.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  Collection<String> values=map.remove("String_Node_Str");
  assertEquals(7,values.size());
  assertEquals(0,map.size());
}

Fixed version (ground truth):
@Test public void testMultiMapRemove(){
  MultiMap<String,String> map=Hazelcast.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(7,map.size());
  assertEquals(1,map.keySet().size());
  Collection<String> values=map.remove("String_Node_Str");
  assertEquals(7,values.size());
  assertEquals(0,map.size());
  assertEquals(0,map.keySet().size());
  map.put("String_Node_Str","String_Node_Str");
  assertEquals(1,map.size());
  assertEquals(1,map.keySet().size());
}
Program: 50564
Project: 50564
Buggy source:
void joinReset(){
  joinInProgress=false;
  setJoins.clear();
  timeToStartJoin=System.currentTimeMillis() + WAIT_SECONDS_BEFORE_JOIN + 1000;
}

Fixed version (ground truth):
void joinReset(){
  joinInProgress=false;
  setJoins.clear();
  timeToStartJoin=System.currentTimeMillis() + WAIT_MILLIS_BEFORE_JOIN;
}
Program: 50566
Project: 50566
Buggy source:
void handleJoinRequest(JoinRequest joinRequest){
  logger.log(Level.FINEST,joinInProgress + "String_Node_Str" + joinRequest);
  if (getMember(joinRequest.address) != null)   return;
  Connection conn=joinRequest.getConnection();
  if (!node.getConfig().getNetworkConfig().getJoin().getMulticastConfig().isEnabled()) {
    if (node.getMasterAddress() != null && !isMaster()) {
      sendProcessableTo(new Master(node.getMasterAddress()),conn);
    }
  }
  if (isMaster()) {
    if (joinRequest.to != null && !joinRequest.to.equals(thisAddress)) {
      sendProcessableTo(new Master(node.getMasterAddress()),conn);
      return;
    }
    Address newAddress=joinRequest.address;
    if (!joinInProgress) {
      MemberInfo newMemberInfo=new MemberInfo(newAddress,joinRequest.nodeType);
      if (setJoins.add(newMemberInfo)) {
        sendProcessableTo(new Master(node.getMasterAddress()),conn);
        timeToStartJoin=System.currentTimeMillis() + (WAIT_SECONDS_BEFORE_JOIN * 1000L);
      }
 else {
        if (System.currentTimeMillis() > timeToStartJoin) {
          startJoin();
        }
      }
    }
  }
}

Fixed version (ground truth):
void handleJoinRequest(JoinRequest joinRequest){
  logger.log(Level.FINEST,joinInProgress + "String_Node_Str" + joinRequest);
  if (getMember(joinRequest.address) != null)   return;
  Connection conn=joinRequest.getConnection();
  if (!node.getConfig().getNetworkConfig().getJoin().getMulticastConfig().isEnabled()) {
    if (node.getMasterAddress() != null && !isMaster()) {
      sendProcessableTo(new Master(node.getMasterAddress()),conn);
    }
  }
  if (isMaster()) {
    if (joinRequest.to != null && !joinRequest.to.equals(thisAddress)) {
      sendProcessableTo(new Master(node.getMasterAddress()),conn);
      return;
    }
    Address newAddress=joinRequest.address;
    if (!joinInProgress) {
      MemberInfo newMemberInfo=new MemberInfo(newAddress,joinRequest.nodeType);
      if (setJoins.add(newMemberInfo)) {
        sendProcessableTo(new Master(node.getMasterAddress()),conn);
        timeToStartJoin=System.currentTimeMillis() + WAIT_MILLIS_BEFORE_JOIN;
      }
 else {
        if (System.currentTimeMillis() > timeToStartJoin) {
          startJoin();
        }
      }
    }
  }
}
Program: 50567
Project: 50567
Buggy source:
public boolean putMulti(Request req){
  Record record=getRecord(req.key);
  boolean added=true;
  if (record == null) {
    record=createNewRecord(req.key,null);
    req.key=null;
  }
 else {
    if (record.containsValue(req.value)) {
      added=false;
    }
  }
  if (added) {
    node.queryService.updateIndex(name,null,null,record,Integer.MIN_VALUE);
    record.addValue(req.value);
    req.value=null;
    record.setVersion(record.getVersion() + 1);
    touch(record);
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record.getKey(),req.value,record.getMapListeners());
  }
  logger.log(Level.FINEST,record.getValue() + "String_Node_Str" + record.getMultiValues());
  req.version=record.getVersion();
  return added;
}

Fixed version (ground truth):
public boolean putMulti(Request req){
  Record record=getRecord(req.key);
  boolean added=true;
  if (record == null) {
    record=createNewRecord(req.key,null);
    req.key=null;
  }
 else {
    record.setActive();
    if (record.containsValue(req.value)) {
      added=false;
    }
  }
  if (added) {
    node.queryService.updateIndex(name,null,null,record,Integer.MIN_VALUE);
    record.addValue(req.value);
    req.value=null;
    record.setVersion(record.getVersion() + 1);
    touch(record);
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record.getKey(),req.value,record.getMapListeners());
  }
  logger.log(Level.FINEST,record.getValue() + "String_Node_Str" + record.getMultiValues());
  req.version=record.getVersion();
  return added;
}
Program: 50568
Project: 50568
Buggy source:
public static HazelcastInstance newHazelcastInstance(Config config){
  return com.hazelcast.impl.FactoryImpl.newFactory(config);
}

Fixed version (ground truth):
/** 
 * Creates a new Hazelcast instance (a new node in a cluster). This method allows you to create and run multiple instances of Hazelcast cluster members on the same JVM. To shutdown all running hazelcast instances (all members on this JVM) call   {@link #shutdownAll()}. 
 * @see #shutdownAll()
 * @param config Configuration for the new hazelcast instance (member)
 * @return new hazelcast instance
 */
public static HazelcastInstance newHazelcastInstance(Config config){
  return com.hazelcast.impl.FactoryImpl.newFactory(config);
}
Program: 50570
Project: 50570
Buggy source:
@Override public boolean isMigrating(){
  for (  Block block : blocks) {
    if (block != null && block.isMigrating()) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean isMigrating(){
  return migrating;
}
Program: 50572
Project: 50572
Buggy source:
public ClusterMBean(HazelcastInstance instance,Config config){
  super(instance);
  this.config=config;
  this.cluster=instance.getCluster();
  mbeanBuilder=new MBeanBuilder();
  mbeanBuilder.setClusterName(instance.getName());
  clusterObjectNames=new ObjectNameSpec(getManagedObject().getName());
}

Fixed version (ground truth):
public ClusterMBean(HazelcastInstance instance,Config config){
  super(instance);
  this.config=config;
  this.cluster=instance.getCluster();
  clusterObjectNames=new ObjectNameSpec(getManagedObject().getName());
}
Program: 50573
Project: 50573
Buggy source:
/** 
 * Stop the management service
 */
public static void shutdown(){
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  Set<ObjectName> entries;
  try {
    entries=mbs.queryNames(new ObjectName(MBeanBuilder.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 static void shutdown(){
  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;
  }
}
Program: 50574
Project: 50574
Buggy source:
public Data put(Request req){
  if (req.value == null) {
    req.value=new Data();
  }
  if (req.operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
    Record record=recordExist(req);
    if (record != null && record.getValue() != null) {
      return doHardCopy(record.getValue());
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL) {
    Record record=recordExist(req);
    if (record == null || record.getValue() == null) {
      return null;
    }
  }
  Record record=getRecord(req.key);
  Data oldValue=null;
  if (record == null) {
    record=createNewRecord(req.key,req.value);
    req.key=null;
  }
 else {
    record.markActive();
    if (!record.isValid()) {
      record.setExpirationTime(ttl);
    }
    oldValue=record.getValue();
    record.setValue(req.value);
    record.version++;
    touch(record);
    record.setLastUpdated();
  }
  req.version=record.version;
  req.longValue=record.copyCount;
  req.value=null;
  if (oldValue == null) {
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record);
  }
 else {
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_UPDATED,record);
  }
  if (req.txnId != -1) {
    record.unlock();
  }
  markRecordDirty(record);
  return oldValue;
}

Fixed version (ground truth):
public Data put(Request req){
  if (req.value == null) {
    req.value=new Data();
  }
  if (req.operation == CONCURRENT_MAP_PUT_IF_ABSENT) {
    Record record=recordExist(req);
    if (record != null && record.getValue() != null) {
      return doHardCopy(record.getValue());
    }
  }
 else   if (req.operation == CONCURRENT_MAP_REPLACE_IF_NOT_NULL) {
    Record record=recordExist(req);
    if (record == null || record.getValue() == null) {
      return null;
    }
  }
  Record record=getRecord(req.key);
  Data oldValue=null;
  if (record == null) {
    record=createNewRecord(req.key,req.value);
    req.key=null;
  }
 else {
    markAsActive(record);
    if (!record.isValid()) {
      record.setExpirationTime(ttl);
    }
    oldValue=record.getValue();
    record.setValue(req.value);
    record.version++;
    touch(record);
    record.setLastUpdated();
  }
  req.version=record.version;
  req.longValue=record.copyCount;
  req.value=null;
  if (oldValue == null) {
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_ADDED,record);
  }
 else {
    fireMapEvent(mapListeners,name,EntryEvent.TYPE_UPDATED,record);
  }
  if (req.txnId != -1) {
    record.unlock();
  }
  markAsDirty(record);
  return oldValue;
}
Program: 50575
Project: 50575
Buggy source:
public synchronized boolean bind(final Address endPoint,final Connection connection,final boolean accept){
  connection.setEndPoint(endPoint);
  final Connection connExisting=mapConnections.get(endPoint);
  if (connExisting != null && connExisting != connection) {
    final String msg="String_Node_Str" + endPoint + "String_Node_Str"+ acceptTypeConnection+ "String_Node_Str"+ accept;
    logger.log(Level.FINEST,msg);
    return true;
  }
  if (!endPoint.equals(Node.get().getThisAddress())) {
    acceptTypeConnection=accept;
    ClusterManager clusterManager=ClusterManager.get();
    Packet bindPacket=clusterManager.createRemotelyProcessablePacket(new Bind(clusterManager.getThisAddress()));
    connection.writeHandler.enqueuePacket(bindPacket);
    mapConnections.put(endPoint,connection);
    setConnectionInProgress.remove(endPoint);
    for (    final ConnectionListener listener : setConnectionListeners) {
      listener.connectionAdded(connection);
    }
  }
 else {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public synchronized boolean bind(final Address endPoint,final Connection connection,final boolean accept){
  connection.setEndPoint(endPoint);
  final Connection connExisting=mapConnections.get(endPoint);
  if (connExisting != null && connExisting != connection) {
    final String msg="String_Node_Str" + endPoint + "String_Node_Str"+ acceptTypeConnection+ "String_Node_Str"+ accept;
    logger.log(Level.FINEST,msg);
    return true;
  }
  if (!endPoint.equals(Node.get().getThisAddress())) {
    acceptTypeConnection=accept;
    if (!accept) {
      ClusterManager clusterManager=ClusterManager.get();
      Packet bindPacket=clusterManager.createRemotelyProcessablePacket(new Bind(clusterManager.getThisAddress()));
      connection.writeHandler.enqueuePacket(bindPacket);
    }
    mapConnections.put(endPoint,connection);
    setConnectionInProgress.remove(endPoint);
    for (    final ConnectionListener listener : setConnectionListeners) {
      listener.connectionAdded(connection);
    }
  }
 else {
    return false;
  }
  return true;
}
Program: 50577
Project: 50577
Buggy source:
public void sendProcessableToAll(RemotelyProcessable rp,boolean processLocally){
  if (processLocally) {
    rp.process();
  }
  Data value=toData(rp);
  for (  MemberImpl member : lsMembers) {
    if (!member.localMember()) {
      Packet packet=obtainPacket();
      try {
        packet.set("String_Node_Str",ClusterOperation.REMOTELY_PROCESS,null,value);
        boolean sent=send(packet,member.getAddress());
        if (!sent) {
          packet.returnToContainer();
        }
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
}

Fixed version (ground truth):
public void sendProcessableToAll(RemotelyProcessable rp,boolean processLocally){
  if (processLocally) {
    rp.process();
  }
  Data value=toData(rp);
  for (  MemberImpl member : lsMembers) {
    if (!member.localMember()) {
      Packet packet=obtainPacket();
      packet.set("String_Node_Str",ClusterOperation.REMOTELY_PROCESS,null,value);
      boolean sent=send(packet,member.getAddress());
      if (!sent) {
        packet.returnToContainer();
      }
    }
  }
}
Program: 50578
Project: 50578
Buggy source:
public void sendEvents(final int eventType,final String name,final Data key,final Data value,final Map<Address,Boolean> mapListeners){
  if (mapListeners != null) {
    final Set<Map.Entry<Address,Boolean>> listeners=mapListeners.entrySet();
    for (    final Map.Entry<Address,Boolean> listener : listeners) {
      final Address address=listener.getKey();
      final boolean includeValue=listener.getValue();
      if (address.isThisAddress()) {
        try {
          enqueueEvent(eventType,name,doHardCopy(key),(includeValue) ? doHardCopy(value) : null,address);
        }
 catch (        final Exception e) {
          e.printStackTrace();
        }
      }
 else {
        final Packet packet=ThreadContext.get().getPacketPool().obtain();
        packet.reset();
        try {
          packet.set(name,ClusterOperation.EVENT,key,(includeValue) ? value : null);
          packet.longValue=eventType;
        }
 catch (        final Exception e) {
          e.printStackTrace();
        }
        final boolean sent=send(packet,address);
        if (!sent)         packet.returnToContainer();
      }
    }
  }
}

Fixed version (ground truth):
public void sendEvents(final int eventType,final String name,final Data key,final Data value,final Map<Address,Boolean> mapListeners){
  if (mapListeners != null) {
    final Set<Map.Entry<Address,Boolean>> listeners=mapListeners.entrySet();
    for (    final Map.Entry<Address,Boolean> listener : listeners) {
      final Address address=listener.getKey();
      final boolean includeValue=listener.getValue();
      if (address.isThisAddress()) {
        try {
          enqueueEvent(eventType,name,doHardCopy(key),(includeValue) ? doHardCopy(value) : null,address);
        }
 catch (        final Exception e) {
          e.printStackTrace();
        }
      }
 else {
        final Packet packet=ThreadContext.get().getPacketPool().obtain();
        packet.reset();
        packet.set(name,ClusterOperation.EVENT,key,(includeValue) ? value : null);
        packet.longValue=eventType;
        final boolean sent=send(packet,address);
        if (!sent)         packet.returnToContainer();
      }
    }
  }
}
Program: 50579
Project: 50579
Buggy source:
public void sendProcessableTo(final RemotelyProcessable rp,final Address address){
  final Data value=toData(rp);
  final Packet packet=obtainPacket();
  try {
    packet.set("String_Node_Str",ClusterOperation.REMOTELY_PROCESS,null,value);
    final boolean sent=send(packet,address);
    if (!sent) {
      packet.returnToContainer();
    }
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void sendProcessableTo(final RemotelyProcessable rp,final Address address){
  final Data value=toData(rp);
  final Packet packet=obtainPacket();
  packet.set("String_Node_Str",ClusterOperation.REMOTELY_PROCESS,null,value);
  final boolean sent=send(packet,address);
  if (!sent) {
    packet.returnToContainer();
  }
}
Program: 50580
Project: 50580
Buggy source:
public static ClusterImpl getCluster(){
  init();
  return node.getClusterImpl();
}

Fixed version (ground truth):
public static ClusterImpl getCluster(){
  initialChecks();
  return node.getClusterImpl();
}
Program: 50581
Project: 50581
Buggy source:
public Object put(Object key,Object value){
  check(key);
  check(value);
  MPut mput=ThreadContext.get().getMPut();
  return mput.put(name,key,value,-1);
}

Fixed version (ground truth):
public Object put(Object key,Object value){
  checkInputObject(key);
  checkInputObject(value);
  MPut mput=ThreadContext.get().getMPut();
  return mput.put(name,key,value,-1);
}
Program: 50582
Project: 50582
Buggy source:
public boolean containsValue(Object value){
  check(value);
  TransactionImpl txn=ThreadContext.get().txn;
  if (txn != null) {
    if (txn.containsValue(name,value))     return true;
  }
  MContainsValue mContainsValue=ConcurrentMapManager.get().new MContainsValue(name,value);
  return (Boolean)mContainsValue.call();
}

Fixed version (ground truth):
public boolean containsValue(Object value){
  checkInputObject(value);
  TransactionImpl txn=ThreadContext.get().txn;
  if (txn != null) {
    if (txn.containsValue(name,value))     return true;
  }
  MContainsValue mContainsValue=ConcurrentMapManager.get().new MContainsValue(name,value);
  return (Boolean)mContainsValue.call();
}
Program: 50583
Project: 50583
Buggy source:
public void lock(Object key){
  check(key);
  MLock mlock=ThreadContext.get().getMLock();
  mlock.lock(name,key,-1);
}

Fixed version (ground truth):
public void lock(Object key){
  checkInputObject(key);
  MLock mlock=ThreadContext.get().getMLock();
  mlock.lock(name,key,-1);
}
Program: 50584
Project: 50584
Buggy source:
public boolean containsEntry(Object key,Object value){
  check(key);
  check(value);
  TransactionImpl txn=ThreadContext.get().txn;
  if (txn != null) {
    if (txn.has(name,key)) {
      Object v=txn.get(name,key);
      return v != null;
    }
  }
  MContainsKey mContainsKey=ConcurrentMapManager.get().new MContainsKey();
  return mContainsKey.containsEntry(name,key,value);
}

Fixed version (ground truth):
public boolean containsEntry(Object key,Object value){
  checkInputObject(key);
  checkInputObject(value);
  TransactionImpl txn=ThreadContext.get().txn;
  if (txn != null) {
    if (txn.has(name,key)) {
      Object v=txn.get(name,key);
      return v != null;
    }
  }
  MContainsKey mContainsKey=ConcurrentMapManager.get().new MContainsKey();
  return mContainsKey.containsEntry(name,key,value);
}
Program: 50585
Project: 50585
Buggy source:
public void removeEntryListener(EntryListener listener,Object key){
  if (listener == null)   throw new IllegalArgumentException("String_Node_Str");
  check(key);
  removeGenericListener(listener,key);
}

Fixed version (ground truth):
public void removeEntryListener(EntryListener listener,Object key){
  if (listener == null)   throw new IllegalArgumentException("String_Node_Str");
  checkInputObject(key);
  removeGenericListener(listener,key);
}
Program: 50586
Project: 50586
Buggy source:
public void addEntryListener(EntryListener listener,Object key,boolean includeValue){
  if (listener == null)   throw new IllegalArgumentException("String_Node_Str");
  check(key);
  addGenericListener(listener,key,includeValue,ListenerManager.Type.Map);
}

Fixed version (ground truth):
public void addEntryListener(EntryListener listener,Object key,boolean includeValue){
  if (listener == null)   throw new IllegalArgumentException("String_Node_Str");
  checkInputObject(key);
  addGenericListener(listener,key,includeValue,ListenerManager.Type.Map);
}
Program: 50587
Project: 50587
Buggy source:
public boolean tryLock(Object key,long time,TimeUnit timeunit){
  check(key);
  if (time < 0)   throw new IllegalArgumentException("String_Node_Str" + time);
  MLock mlock=ThreadContext.get().getMLock();
  return mlock.lock(name,key,timeunit.toMillis(time));
}

Fixed version (ground truth):
public boolean tryLock(Object key,long time,TimeUnit timeunit){
  checkInputObject(key);
  if (time < 0)   throw new IllegalArgumentException("String_Node_Str" + time);
  MLock mlock=ThreadContext.get().getMLock();
  return mlock.lock(name,key,timeunit.toMillis(time));
}
Program: 50588
Project: 50588
Buggy source:
static Collection<Instance> getProxies(){
  init();
  return proxies.values();
}

Fixed version (ground truth):
static Collection<Instance> getProxies(){
  initialChecks();
  return proxies.values();
}
Program: 50589
Project: 50589
Buggy source:
public static Object getProxy(final ProxyKey proxyKey){
  if (!inited)   init();
  Object proxy=proxies.get(proxyKey);
  if (proxy == null) {
    proxy=createInstanceClusterwide(proxyKey);
  }
  return proxy;
}

Fixed version (ground truth):
public static Object getProxy(final ProxyKey proxyKey){
  initialChecks();
  Object proxy=proxies.get(proxyKey);
  if (proxy == null) {
    proxy=createInstanceClusterwide(proxyKey);
  }
  return proxy;
}
Program: 50590
Project: 50590
Buggy source:
public boolean putMulti(Object key,Object value){
  check(key);
  check(value);
  MPutMulti mput=ThreadContext.get().getMPutMulti();
  return mput.put(name,key,value);
}

Fixed version (ground truth):
public boolean putMulti(Object key,Object value){
  checkInputObject(key);
  checkInputObject(value);
  MPutMulti mput=ThreadContext.get().getMPutMulti();
  return mput.put(name,key,value);
}
Program: 50591
Project: 50591
Buggy source:
public Object get(Object key){
  check(key);
  MGet mget=ThreadContext.get().getMGet();
  return mget.get(name,key,-1);
}

Fixed version (ground truth):
public Object get(Object key){
  checkInputObject(key);
  MGet mget=ThreadContext.get().getMGet();
  return mget.get(name,key,-1);
}
Program: 50592
Project: 50592
Buggy source:
public boolean replace(Object key,Object oldValue,Object newValue){
  check(key);
  check(newValue);
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
public boolean replace(Object key,Object oldValue,Object newValue){
  checkInputObject(key);
  checkInputObject(newValue);
  throw new UnsupportedOperationException();
}
Program: 50593
Project: 50593
Buggy source:
public boolean removeMulti(Object key,Object value){
  check(key);
  check(value);
  MRemoveMulti mremove=ThreadContext.get().getMRemoveMulti();
  return mremove.remove(name,key,value);
}

Fixed version (ground truth):
public boolean removeMulti(Object key,Object value){
  checkInputObject(key);
  checkInputObject(value);
  MRemoveMulti mremove=ThreadContext.get().getMRemoveMulti();
  return mremove.remove(name,key,value);
}
Program: 50594
Project: 50594
Buggy source:
private void ensure(){
  if (base == null) {
    base=getIdGenerator(name);
  }
}

Fixed version (ground truth):
private void ensure(){
  initialChecks();
  if (base == null) {
    base=getIdGenerator(name);
  }
}
Program: 50595
Project: 50595
Buggy source:
public void unlock(Object key){
  check(key);
  MLock mlock=ThreadContext.get().getMLock();
  mlock.unlock(name,key,0);
}

Fixed version (ground truth):
public void unlock(Object key){
  checkInputObject(key);
  MLock mlock=ThreadContext.get().getMLock();
  mlock.unlock(name,key,0);
}
Program: 50596
Project: 50596
Buggy source:
public static ExecutorService getExecutorService(){
  init();
  return executorServiceImpl;
}

Fixed version (ground truth):
public static ExecutorService getExecutorService(){
  initialChecks();
  return executorServiceImpl;
}
Program: 50597
Project: 50597
Buggy source:
public boolean containsKey(Object key){
  check(key);
  TransactionImpl txn=ThreadContext.get().txn;
  if (txn != null) {
    if (txn.has(name,key)) {
      Object value=txn.get(name,key);
      return value != null;
    }
  }
  MContainsKey mContainsKey=ConcurrentMapManager.get().new MContainsKey();
  return mContainsKey.containsKey(name,key);
}

Fixed version (ground truth):
public boolean containsKey(Object key){
  checkInputObject(key);
  TransactionImpl txn=ThreadContext.get().txn;
  if (txn != null) {
    if (txn.has(name,key)) {
      Object value=txn.get(name,key);
      return value != null;
    }
  }
  MContainsKey mContainsKey=ConcurrentMapManager.get().new MContainsKey();
  return mContainsKey.containsKey(name,key);
}
Program: 50598
Project: 50598
Buggy source:
public boolean remove(Object key,Object value){
  check(key);
  check(value);
  MRemove mremove=ThreadContext.get().getMRemove();
  return (mremove.removeIfSame(name,key,value,-1) != null);
}

Fixed version (ground truth):
public boolean remove(Object key,Object value){
  checkInputObject(key);
  checkInputObject(value);
  MRemove mremove=ThreadContext.get().getMRemove();
  return (mremove.removeIfSame(name,key,value,-1) != null);
}