nus-yam/ex-repair huggingface dataset:
Program: 49987
Project: 49987
Buggy source:
@Test public void putAllMany(){
  HazelcastClient hClient=getHazelcastClient();
  IMap map=hClient.getMap("String_Node_Str");
  int counter=100;
  for (int j=0; j < 4; j++, counter*=10) {
    Map tempMap=new HashMap();
    for (int i=0; i < counter; i++) {
      tempMap.put(i,i);
    }
    System.out.println("String_Node_Str" + tempMap.size() + "String_Node_Str");
    map.putAll(tempMap);
    System.out.println("String_Node_Str" + tempMap.size());
  }
  map.destroy();
}

Fixed version (ground truth):
@Test public void putAllMany(){
  HazelcastClient hClient=getHazelcastClient();
  IMap map=hClient.getMap("String_Node_Str");
  int counter=100;
  for (int j=0; j < 4; j++, counter*=10) {
    Map tempMap=new HashMap();
    for (int i=0; i < counter; i++) {
      tempMap.put(i,i);
    }
    map.putAll(tempMap);
    assertEquals(1,map.get(1));
  }
  map.destroy();
}
Program: 49988
Project: 49988
Buggy source:
public void run(){
  topic.publish("String_Node_Str");
}

Fixed version (ground truth):
public void run(){
  topic.publish("String_Node_Str");
  l.countDown();
}
Program: 49989
Project: 49989
Buggy source:
@Test public void testPerformance(){
  HazelcastClient hClient=getHazelcastClient();
  long begin=System.currentTimeMillis();
  int count=10000;
  final ITopic topic=hClient.getTopic("String_Node_Str");
  ExecutorService ex=Executors.newFixedThreadPool(10);
  for (int i=0; i < count; i++) {
    ex.submit(new Runnable(){
      public void run(){
        topic.publish("String_Node_Str");
      }
    }
);
  }
  long time=System.currentTimeMillis() - begin;
  System.out.println("String_Node_Str" + count * 1000 / time);
}

Fixed version (ground truth):
@Test public void testPerformance() throws InterruptedException {
  HazelcastClient hClient=getHazelcastClient();
  long begin=System.currentTimeMillis();
  int count=10000;
  final ITopic topic=hClient.getTopic("String_Node_Str");
  ExecutorService ex=Executors.newFixedThreadPool(10);
  final CountDownLatch l=new CountDownLatch(count);
  for (int i=0; i < count; i++) {
    ex.submit(new Runnable(){
      public void run(){
        topic.publish("String_Node_Str");
        l.countDown();
      }
    }
);
  }
  assertTrue(l.await(20,TimeUnit.SECONDS));
  long time=System.currentTimeMillis() - begin;
  System.out.println("String_Node_Str" + count * 1000 / time);
}
Program: 49990
Project: 49990
Buggy source:
public Object get(Object key){
  long now=System.currentTimeMillis();
  if (counter.incrementAndGet() == LOCAL_INVALIDATION_COUNTER) {
    counter.addAndGet(-(LOCAL_INVALIDATION_COUNTER));
    evict(now,false);
  }
  CacheEntry entry=cache.get(key);
  if (entry == null) {
    return null;
  }
 else {
    if (entry.isValid(now)) {
      Object value=entry.getValue();
      cmap.concurrentMapManager.enqueueAndReturn(entry);
      entry.touch(now);
      return value;
    }
 else {
      return null;
    }
  }
}

Fixed version (ground truth):
public Object get(Object key){
  long now=System.currentTimeMillis();
  if (counter.incrementAndGet() == LOCAL_INVALIDATION_COUNTER) {
    counter.addAndGet(-(LOCAL_INVALIDATION_COUNTER));
    evict(now,false);
  }
  CacheEntry entry=cache.get(key);
  if (entry == null) {
    return null;
  }
 else {
    if (entry.isValid(now)) {
      Object value=null;
      if (ThreadContext.get().isClient()) {
        value=entry.getValueData();
      }
 else {
        value=entry.getValue();
      }
      cmap.concurrentMapManager.enqueueAndReturn(entry);
      entry.touch(now);
      return value;
    }
 else {
      return null;
    }
  }
}
Program: 49991
Project: 49991
Buggy source:
CMap getOrCreateStorageCMap(String queueName){
  QueueConfig config=node.factory.getConfig().getQueueConfig(queueName);
  return node.concurrentMapManager.getOrCreateMap(Prefix.MAP + config.getBackingMapName());
}

Fixed version (ground truth):
CMap getOrCreateStorageCMap(String queueName){
  return node.concurrentMapManager.getOrCreateMap(Prefix.MAP + queueName);
}
Program: 49992
Project: 49992
Buggy source:
public IMap getStorageMap(String queueName){
  QueueConfig config=node.factory.getConfig().getQueueConfig(queueName);
  return node.factory.getMap(config.getBackingMapName());
}

Fixed version (ground truth):
public IMap getStorageMap(String queueName){
  return node.factory.getMap(queueName);
}
Program: 49993
Project: 49993
Buggy source:
CMap getStorageCMap(String queueName){
  QueueConfig config=node.factory.getConfig().getQueueConfig(queueName);
  return node.concurrentMapManager.getMap(Prefix.MAP + config.getBackingMapName());
}

Fixed version (ground truth):
CMap getStorageCMap(String queueName){
  return node.concurrentMapManager.getMap(Prefix.MAP + queueName);
}
Program: 49994
Project: 49994
Buggy source:
BQ(String name){
  this.name=name;
  QueueConfig qConfig=node.getConfig().findMatchingQueueConfig(name.substring(Prefix.QUEUE.length()));
  MapConfig backingMapConfig=node.getConfig().findMatchingMapConfig(qConfig.getBackingMapName());
  int backingMapTTL=backingMapConfig.getTimeToLiveSeconds();
  this.maxSizePerJVM=(qConfig.getMaxSizePerJVM() == 0) ? Integer.MAX_VALUE : qConfig.getMaxSizePerJVM();
  this.ttl=(backingMapTTL == 0) ? Integer.MAX_VALUE : TimeUnit.SECONDS.toMillis(backingMapTTL);
}

Fixed version (ground truth):
BQ(String name){
  this.name=name;
  String shortName=name.substring(Prefix.QUEUE.length());
  QueueConfig qConfig=node.getConfig().findMatchingQueueConfig(shortName);
  MapConfig backingMapConfig=node.getConfig().findMatchingMapConfig(qConfig.getBackingMapName());
  int backingMapTTL=backingMapConfig.getTimeToLiveSeconds();
  this.maxSizePerJVM=(qConfig.getMaxSizePerJVM() == 0) ? Integer.MAX_VALUE : qConfig.getMaxSizePerJVM();
  this.ttl=(backingMapTTL == 0) ? Integer.MAX_VALUE : TimeUnit.SECONDS.toMillis(backingMapTTL);
}
Program: 49997
Project: 49997
Buggy source:
private void loadKeys(MProxy mProxy,CMap cmap,Set keys){
  if (keys.size() > 0) {
    Map map=cmap.loader.loadAll(keys);
    Set<Map.Entry> entries=map.entrySet();
    for (    Map.Entry entry : entries) {
      mProxy.putTransient(entry.getKey(),entry.getValue(),0,null);
    }
  }
}

Fixed version (ground truth):
private void loadKeys(MProxy mProxy,CMap cmap,Set keys){
  if (keys.size() > 0) {
    Map map=cmap.loader.loadAll(keys);
    if (map != null && map.size() > 0) {
      Set<Map.Entry> entries=map.entrySet();
      for (      Map.Entry entry : entries) {
        mProxy.putTransient(entry.getKey(),entry.getValue(),0,null);
      }
    }
  }
}
Program: 49999
Project: 49999
Buggy source:
void checkInit(){
  if (!initialized && shouldInitialize) {
synchronized (initLock) {
      if (!initialized) {
        ((MapLoaderLifecycleSupport)impl).init(hazelcastInstance,properties,mapName);
        initialized=true;
      }
    }
  }
}

Fixed version (ground truth):
void checkInit(){
  if (shouldInitialize && !initialized) {
synchronized (initLock) {
      if (!initialized) {
        ((MapLoaderLifecycleSupport)impl).init(hazelcastInstance,properties,mapName);
        initialized=true;
      }
    }
  }
}
Program: 50000
Project: 50000
Buggy source:
public void appendState(StringBuffer sbState){
  sbState.append("String_Node_Str");
  for (  Connection conn : mapConnections.values()) {
    sbState.append("String_Node_Str" + conn.getEndPoint());
    sbState.append("String_Node_Str" + conn.live());
    sbState.append("String_Node_Str" + conn.getWriteHandler().size());
  }
  sbState.append("String_Node_Str");
}

Fixed version (ground truth):
public void appendState(StringBuffer sbState){
  long now=System.currentTimeMillis();
  sbState.append("String_Node_Str");
  for (  Connection conn : mapConnections.values()) {
    long wr=(now - conn.getWriteHandler().lastRegistration) / 1000;
    long wh=(now - conn.getWriteHandler().lastHandle) / 1000;
    long rr=(now - conn.getReadHandler().lastRegistration) / 1000;
    long rh=(now - conn.getReadHandler().lastHandle) / 1000;
    sbState.append("String_Node_Str" + conn.getEndPoint());
    sbState.append("String_Node_Str" + conn.live());
    sbState.append("String_Node_Str" + conn.getWriteHandler().size());
    sbState.append("String_Node_Str").append(wr).append("String_Node_Str").append(wh);
    sbState.append("String_Node_Str").append(rr).append("String_Node_Str").append(rh);
  }
  sbState.append("String_Node_Str");
}
Program: 50001
Project: 50001
Buggy source:
public final void handle(){
  if (!connection.live()) {
    logger.log(Level.FINEST,"String_Node_Str");
    return;
  }
  try {
    if (socketReader == null) {
      int readBytes=socketChannel.read(protocolBuffer);
      if (readBytes == -1) {
        throw new EOFException();
      }
      if (!protocolBuffer.hasRemaining()) {
        String protocol=new String(protocolBuffer.array());
        WriteHandler writeHandler=connection.getWriteHandler();
        if ("String_Node_Str".equals(protocol)) {
          writeHandler.setProtocol("String_Node_Str");
          socketReader=new SocketPacketReader(node,socketChannel,connection);
        }
 else {
          writeHandler.setProtocol("String_Node_Str");
          inBuffer.put(protocolBuffer.array());
          socketReader=new SocketTextReader(node,connection);
          connection.connectionManager.incrementTextConnections();
        }
      }
    }
    if (socketReader == null)     return;
    int readBytes=socketChannel.read(inBuffer);
    if (readBytes == -1) {
      throw new EOFException();
    }
  }
 catch (  Throwable e) {
    handleSocketException(e);
    return;
  }
  try {
    if (inBuffer.position() == 0)     return;
    inBuffer.flip();
    socketReader.read(inBuffer);
    if (inBuffer.hasRemaining()) {
      inBuffer.compact();
    }
 else {
      inBuffer.clear();
    }
  }
 catch (  Exception t) {
    handleSocketException(t);
  }
 finally {
    run();
  }
}

Fixed version (ground truth):
public final void handle(){
  lastHandle=System.currentTimeMillis();
  if (!connection.live()) {
    logger.log(Level.FINEST,"String_Node_Str");
    return;
  }
  try {
    if (socketReader == null) {
      int readBytes=socketChannel.read(protocolBuffer);
      if (readBytes == -1) {
        throw new EOFException();
      }
      if (!protocolBuffer.hasRemaining()) {
        String protocol=new String(protocolBuffer.array());
        WriteHandler writeHandler=connection.getWriteHandler();
        if ("String_Node_Str".equals(protocol)) {
          writeHandler.setProtocol("String_Node_Str");
          socketReader=new SocketPacketReader(node,socketChannel,connection);
        }
 else {
          writeHandler.setProtocol("String_Node_Str");
          inBuffer.put(protocolBuffer.array());
          socketReader=new SocketTextReader(node,connection);
          connection.connectionManager.incrementTextConnections();
        }
      }
    }
    if (socketReader == null)     return;
    int readBytes=socketChannel.read(inBuffer);
    if (readBytes == -1) {
      throw new EOFException();
    }
  }
 catch (  Throwable e) {
    handleSocketException(e);
    return;
  }
  try {
    if (inBuffer.position() == 0)     return;
    inBuffer.flip();
    socketReader.read(inBuffer);
    if (inBuffer.hasRemaining()) {
      inBuffer.compact();
    }
 else {
      inBuffer.clear();
    }
  }
 catch (  Throwable t) {
    handleSocketException(t);
  }
}
Program: 50002
Project: 50002
Buggy source:
public final void run(){
  registerOp(inSelector.selector,SelectionKey.OP_READ);
}

Fixed version (ground truth):
public final void run(){
  lastRegistration=System.currentTimeMillis();
  registerOp(inSelector.selector,SelectionKey.OP_READ);
}
Program: 50004
Project: 50004
Buggy source:
public void enqueueSocketWritable(SocketWritable socketWritable){
  socketWritable.onEnqueue();
  writeQueue.offer(socketWritable);
  outSelector.writeQueueSize.incrementAndGet();
  if (informSelector.compareAndSet(true,false)) {
    outSelector.addTask(this);
    outSelector.selector.wakeup();
  }
}

Fixed version (ground truth):
public void enqueueSocketWritable(SocketWritable socketWritable){
  socketWritable.onEnqueue();
  writeQueue.offer(socketWritable);
  outSelector.writeQueueSize.incrementAndGet();
  if (true || informSelector.compareAndSet(true,false)) {
    outSelector.addTask(this);
    outSelector.selector.wakeup();
  }
}
Program: 50005
Project: 50005
Buggy source:
private void registerWrite(){
  registerOp(outSelector.selector,SelectionKey.OP_WRITE);
}

Fixed version (ground truth):
private void registerWrite(){
  lastRegistration=System.currentTimeMillis();
  registerOp(outSelector.selector,SelectionKey.OP_WRITE);
}
Program: 50006
Project: 50006
Buggy source:
public void handle(){
  if (socketWriter == null) {
    setProtocol("String_Node_Str");
  }
  if (lastWritable == null) {
    lastWritable=poll();
    if (lastWritable == null && socketBB.position() == 0) {
      ready=true;
      return;
    }
  }
  if (!connection.live())   return;
  try {
    while (socketBB.hasRemaining()) {
      if (lastWritable == null) {
        lastWritable=poll();
      }
      if (lastWritable != null) {
        boolean complete=socketWriter.write(lastWritable,socketBB);
        if (complete) {
          if (lastWritable instanceof Packet) {
            node.getPacketPool().release((Packet)lastWritable);
          }
          lastWritable=null;
        }
 else {
          if (socketBB.hasRemaining()) {
            break;
          }
        }
      }
 else {
        break;
      }
    }
    if (socketBB.position() > 0) {
      socketBB.flip();
      try {
        int written=socketChannel.write(socketBB);
      }
 catch (      Exception e) {
        lastWritable=null;
        handleSocketException(e);
        return;
      }
      if (socketBB.hasRemaining()) {
        socketBB.compact();
      }
 else {
        socketBB.clear();
      }
    }
  }
 catch (  Throwable t) {
    logger.log(Level.SEVERE,"String_Node_Str" + connection.getEndPoint(),t);
    t.printStackTrace();
  }
 finally {
    ready=false;
    registerWrite();
  }
}

Fixed version (ground truth):
public void handle(){
  lastHandle=System.currentTimeMillis();
  runCount++;
  if (socketWriter == null) {
    setProtocol("String_Node_Str");
  }
  if (lastWritable == null) {
    lastWritable=poll();
    if (lastWritable == null && socketBB.position() == 0) {
      ready=true;
      return;
    }
  }
  if (!connection.live())   return;
  try {
    while (socketBB.hasRemaining()) {
      if (lastWritable == null) {
        lastWritable=poll();
      }
      if (lastWritable != null) {
        boolean complete=socketWriter.write(lastWritable,socketBB);
        if (complete) {
          if (lastWritable instanceof Packet) {
            node.getPacketPool().release((Packet)lastWritable);
          }
          lastWritable=null;
        }
 else {
          if (socketBB.hasRemaining()) {
            break;
          }
        }
      }
 else {
        break;
      }
    }
    if (socketBB.position() > 0) {
      socketBB.flip();
      try {
        int written=socketChannel.write(socketBB);
      }
 catch (      Exception e) {
        lastWritable=null;
        handleSocketException(e);
        return;
      }
      if (socketBB.hasRemaining()) {
        socketBB.compact();
      }
 else {
        socketBB.clear();
      }
    }
  }
 catch (  Throwable t) {
    logger.log(Level.SEVERE,"String_Node_Str" + connection.getEndPoint(),t);
    t.printStackTrace();
  }
 finally {
    ready=false;
    registerWrite();
  }
}
Program: 50007
Project: 50007
Buggy source:
public boolean writeTo(ByteBuffer bb){
  IOUtil.copyToHeapBuffer(header,bb);
  IOUtil.copyToHeapBuffer(value,bb);
  IOUtil.copyToHeapBuffer(lastOne,bb);
  return !(header != null && header.hasRemaining() || (value != null && value.hasRemaining()) || (lastOne != null && lastOne.hasRemaining()));
}

Fixed version (ground truth):
public boolean writeTo(ByteBuffer bb){
  if (value != null) {
    IOUtil.copyToHeapBuffer(value,bb);
  }
  if (lastOne != null) {
    IOUtil.copyToHeapBuffer(lastOne,bb);
  }
  return !(value != null && value.hasRemaining()) || (lastOne != null && lastOne.hasRemaining());
}
Program: 50008
Project: 50008
Buggy source:
public void setValue(byte[] value,boolean singleGet){
  if (value == null) {
    if (singleGet) {
      lastOne=ByteBuffer.wrap(END);
    }
    return;
  }
  lastOne=ByteBuffer.wrap((singleGet) ? RETURN_END : RETURN);
  this.value=ByteBuffer.wrap(value);
  int valueLenInt=value.length;
  byte[] valueLen=String.valueOf(valueLenInt).getBytes();
  byte[] keyBytes=key.getBytes();
  int headerSize=VALUE_SPACE.length + keyBytes.length + FLAG_ZERO.length+ valueLen.length+ RETURN.length;
  header=ByteBuffer.allocate(headerSize);
  header.put(VALUE_SPACE);
  header.put(keyBytes);
  header.put(FLAG_ZERO);
  header.put(valueLen);
  header.put(RETURN);
  header.flip();
}

Fixed version (ground truth):
public void setValue(MemcacheEntry entry,boolean singleGet){
  if (entry != null)   value=entry.toNewBuffer();
  lastOne=(singleGet) ? ByteBuffer.wrap(END) : null;
}
Program: 50009
Project: 50009
Buggy source:
public void handle(GetCommand getCommand){
  String key=getCommand.getKey();
  String mapName="String_Node_Str";
  int index=key.indexOf(':');
  if (index != -1) {
    mapName=key.substring(0,index);
    key=key.substring(index + 1);
  }
  byte[] valueBytes=textCommandService.getByteArray(mapName,key);
  textCommandService.incrementGetCount();
  if (valueBytes != null) {
    textCommandService.incrementHitCount();
  }
  getCommand.setValue(valueBytes,single);
  textCommandService.sendResponse(getCommand);
}

Fixed version (ground truth):
public void handle(GetCommand getCommand){
  String key=getCommand.getKey();
  String mapName="String_Node_Str";
  int index=key.indexOf(':');
  if (index != -1) {
    mapName=key.substring(0,index);
    key=key.substring(index + 1);
  }
  Object value=textCommandService.get(mapName,key);
  MemcacheEntry entry=null;
  if (value != null) {
    if (value instanceof MemcacheEntry) {
      entry=(MemcacheEntry)value;
    }
 else {
      try {
        entry=new MemcacheEntry(key,IOUtil.serializeToBytes(value),0);
      }
 catch (      Exception e) {
        e.printStackTrace();
      }
    }
  }
  textCommandService.incrementGetCount();
  if (entry != null) {
    textCommandService.incrementHitCount();
  }
  getCommand.setValue(entry,single);
  textCommandService.sendResponse(getCommand);
}
Program: 50011
Project: 50011
Buggy source:
public boolean validateJoinRequest(JoinRequest joinRequest) throws Exception {
  boolean valid=Packet.PACKET_VERSION == joinRequest.packetVersion && buildNumber == joinRequest.buildNumber;
  if (valid) {
    try {
      config.checkCompatibility(joinRequest.config);
    }
 catch (    Exception e) {
      logger.log(Level.INFO,"String_Node_Str" + e.getMessage());
      throw e;
    }
  }
  return valid;
}

Fixed version (ground truth):
public boolean validateJoinRequest(JoinRequest joinRequest) throws Exception {
  boolean valid=Packet.PACKET_VERSION == joinRequest.packetVersion && buildNumber == joinRequest.buildNumber;
  if (valid) {
    try {
      valid=config.isCompatible(joinRequest.config);
    }
 catch (    Exception e) {
      logger.log(Level.INFO,"String_Node_Str" + e.getMessage());
      throw e;
    }
  }
  return valid;
}
Program: 50012
Project: 50012
Buggy source:
/** 
 * @param config
 * @return true if config is compatible with this one, false if config belongs to another group
 * @throws RuntimeException if map, queue, topic configs are incompatible 
 */
public boolean isCompatible(final Config config){
  if (config == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!this.groupConfig.equals(config.getGroupConfig())) {
    return false;
  }
  if (checkCompatibility) {
    checkMapConfigCompatible(config);
    checkQueueConfigCompatible(config);
    checkTopicConfigCompatible(config);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @param config
 * @return true if config is compatible with this one, false if config belongs to another group
 * @throws RuntimeException if map, queue, topic configs are incompatible 
 */
public boolean isCompatible(final Config config){
  if (config == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!this.groupConfig.getName().equals(config.getGroupConfig().getName())) {
    return false;
  }
  if (!this.groupConfig.getPassword().equals(config.getGroupConfig().getPassword())) {
    throw new RuntimeException("String_Node_Str");
  }
  if (checkCompatibility) {
    checkMapConfigCompatible(config);
    checkQueueConfigCompatible(config);
    checkTopicConfigCompatible(config);
  }
  return true;
}
Program: 50013
Project: 50013
Buggy source:
protected static Object getConvertedRealValue(Object firstValue,Object value){
  if (firstValue == null)   return value;
  if (firstValue.getClass() == value.getClass()) {
    return value;
  }
 else   if (value instanceof String) {
    String str=(String)value;
    return getRealObject(firstValue,str);
  }
 else   throw new RuntimeException("String_Node_Str" + value);
}

Fixed version (ground truth):
protected static Object getConvertedRealValue(Object firstValue,Object value){
  if (firstValue == null)   return value;
  if (firstValue.getClass() == value.getClass()) {
    return value;
  }
 else   if (value instanceof String) {
    String str=(String)value;
    return getRealObject(firstValue,str);
  }
 else   if (value != null) {
    String str=String.valueOf(value);
    return getRealObject(firstValue,str);
  }
 else   throw new RuntimeException("String_Node_Str" + value);
}
Program: 50014
Project: 50014
Buggy source:
public void putAll(final Map<? extends K,? extends V> map){
  int counter=0;
  List<Future> lsFutures=new ArrayList<Future>(map.size());
  for (  final K key : map.keySet()) {
    final V value=map.get(key);
    lsFutures.add(putAsync(key,value));
  }
  for (  Future future : lsFutures) {
    try {
      System.out.println("String_Node_Str" + counter++);
      future.get();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void putAll(final Map<? extends K,? extends V> map){
  int counter=0;
  List<Future> lsFutures=new ArrayList<Future>(map.size());
  for (  final K key : map.keySet()) {
    final V value=map.get(key);
    lsFutures.add(putAsync(key,value));
  }
  for (  Future future : lsFutures) {
    try {
      future.get();
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
}
Program: 50015
Project: 50015
Buggy source:
protected Object getValue(Packet response){
  if (response.getValue() != null) {
    return toObject(response.getValue());
  }
  return null;
}

Fixed version (ground truth):
protected Object getValue(Packet response){
  if (response.getValue() != null) {
    Object result=toObject(response.getValue());
    if (result instanceof ClientServiceException) {
      throw new RuntimeException(((ClientServiceException)result).getThrowable());
    }
    return result;
  }
  return null;
}
Program: 50016
Project: 50016
Buggy source:
public void handle(Node node,Packet packet){
  try {
    processCall(node,packet);
  }
 catch (  RuntimeException e) {
    logger.log(Level.WARNING,"String_Node_Str" + packet.operation + "String_Node_Str"+ e.getMessage(),e);
    packet.clearForResponse();
    packet.setValue(toData(e));
  }
  sendResponse(packet);
}

Fixed version (ground truth):
public void handle(Node node,Packet packet){
  try {
    processCall(node,packet);
  }
 catch (  RuntimeException e) {
    logger.log(Level.WARNING,"String_Node_Str" + packet.operation + "String_Node_Str"+ e.getMessage(),e);
    packet.clearForResponse();
    packet.setValue(toData(new ClientServiceException(e)));
  }
  sendResponse(packet);
}
Program: 50020
Project: 50020
Buggy source:
public boolean removeItem(String name,Object key,Object value){
  ThreadContext threadContext=ThreadContext.get();
  TransactionImpl txn=threadContext.getCallContext().getTransaction();
  if (txn != null && txn.getStatus() == Transaction.TXN_STATUS_ACTIVE) {
    try {
      boolean locked;
      if (!txn.has(name,key)) {
        MLock mlock=new MLock();
        locked=mlock.lockAndGetValue(name,key,DEFAULT_TXN_TIMEOUT);
        if (!locked)         throwCME(key);
        Object oldObject=null;
        Data oldValue=mlock.oldValue;
        if (oldValue != null) {
          oldObject=threadContext.toObject(oldValue);
        }
        txn.attachRemoveOp(name,key,null,(oldObject == null));
        return (oldObject != null);
      }
 else {
        return (txn.attachRemoveOp(name,key,null,false) != null);
      }
    }
 catch (    Exception e1) {
      e1.printStackTrace();
    }
    return false;
  }
 else {
    boolean removed=booleanCall(CONCURRENT_MAP_REMOVE_ITEM,name,key,value,0,-1);
    if (removed) {
      backup(CONCURRENT_MAP_BACKUP_REMOVE);
    }
    return removed;
  }
}

Fixed version (ground truth):
public boolean removeItem(String name,Object key,Object value){
  ThreadContext threadContext=ThreadContext.get();
  TransactionImpl txn=threadContext.getCallContext().getTransaction();
  if (txn != null && txn.getStatus() == Transaction.TXN_STATUS_ACTIVE) {
    try {
      boolean locked;
      if (!txn.has(name,key)) {
        MLock mlock=new MLock();
        locked=mlock.lockAndGetValue(name,key,DEFAULT_TXN_TIMEOUT);
        if (!locked)         throwCME(key);
        Object oldObject=null;
        Data oldValue=mlock.oldValue;
        if (oldValue != null) {
          oldObject=threadContext.isClient() ? oldValue : threadContext.toObject(oldValue);
        }
        txn.attachRemoveOp(name,key,null,(oldObject == null));
        return (oldObject != null);
      }
 else {
        return (txn.attachRemoveOp(name,key,null,false) != null);
      }
    }
 catch (    Exception e1) {
      e1.printStackTrace();
    }
    return false;
  }
 else {
    boolean removed=booleanCall(CONCURRENT_MAP_REMOVE_ITEM,name,key,value,0,-1);
    if (removed) {
      backup(CONCURRENT_MAP_BACKUP_REMOVE);
    }
    return removed;
  }
}
Program: 50021
Project: 50021
Buggy source:
private void ensure(){
  factory.initialChecks();
  if (base == null) {
    base=(AtomicNumberReal)factory.getOrCreateProxyByName(name);
  }
}

Fixed version (ground truth):
private void ensure(){
  factory.initialChecks();
  if (base == null) {
    base=(AtomicNumber)factory.getOrCreateProxyByName(name);
  }
}
Program: 50023
Project: 50023
Buggy source:
public V get(long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  if (result != null) {
    return getResult();
  }
  setResult(remoteCall.getResponse(timeout,unit));
  return getResult();
}

Fixed version (ground truth):
public V get(long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  if (result != null) {
    return getResult();
  }
  processResult(remoteCall.getResponse(timeout,unit));
  return getResult();
}
Program: 50024
Project: 50024
Buggy source:
protected Object getValue(Packet response){
  if (response.getValue() != null) {
    Object result=toObject(response.getValue());
    if (result instanceof ClientServiceException) {
      throw new RuntimeException(((ClientServiceException)result).getThrowable());
    }
    return result;
  }
  return null;
}

Fixed version (ground truth):
static Object getValue(Packet response){
  if (response.getValue() != null) {
    Object result=toObject(response.getValue());
    if (result instanceof ClientServiceException) {
      throw new RuntimeException(((ClientServiceException)result).getThrowable());
    }
    return result;
  }
  return null;
}
Program: 50025
Project: 50025
Buggy source:
@Test public void testMultiMapPutAndGet(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  Collection<String> values=map.get("String_Node_Str");
  assertEquals("String_Node_Str",values.iterator().next());
  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");
  values=map.get("String_Node_Str");
  assertEquals(7,values.size());
}

Fixed version (ground truth):
@Test public void testMultiMapPutAndGet(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  Collection<String> values=map.get("String_Node_Str");
  assertEquals("String_Node_Str",values.iterator().next());
  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");
  values=map.get("String_Node_Str");
  assertEquals(7,values.size());
  assertTrue(map.containsKey("String_Node_Str"));
  assertFalse(map.containsKey("String_Node_Str"));
}
Program: 50026
Project: 50026
Buggy source:
@Test public void testMultiMapRemoveEntries(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.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");
  boolean removed=map.remove("String_Node_Str","String_Node_Str");
  Assert.assertTrue(removed);
  assertEquals(6,map.size());
}

Fixed version (ground truth):
@Test public void testMultiMapRemoveEntries(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.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");
  boolean removed=map.remove("String_Node_Str","String_Node_Str");
  assertTrue(removed);
  assertEquals(6,map.size());
}
Program: 50027
Project: 50027
Buggy source:
@Test public void testMultiMapContainsEntry(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  Assert.assertTrue(map.containsEntry("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testMultiMapContainsEntry(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertTrue(map.containsEntry("String_Node_Str","String_Node_Str"));
}
Program: 50028
Project: 50028
Buggy source:
@Test public void testMultiMapContainsValue(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  Assert.assertTrue(map.containsValue("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testMultiMapContainsValue(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertTrue(map.containsValue("String_Node_Str"));
}
Program: 50029
Project: 50029
Buggy source:
@Test public void testMultiMapContainsKey(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  Assert.assertTrue(map.containsKey("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testMultiMapContainsKey(){
  HazelcastClient hClient=getHazelcastClient();
  MultiMap<String,String> map=hClient.getMultiMap("String_Node_Str");
  map.put("String_Node_Str","String_Node_Str");
  assertTrue(map.containsKey("String_Node_Str"));
}
Program: 50032
Project: 50032
Buggy source:
public long addAndGet(long delta){
  ConcurrentMapManager.MAtomic a=newMAtomic(ClusterOperation.ATOMIC_NUMBER_ADD_AND_GET,delta);
  long result=a.doLongAtomic();
  a.backup(result - delta);
  return result;
}

Fixed version (ground truth):
public long addAndGet(long delta){
  ConcurrentMapManager.MAtomic a=newMAtomic(ClusterOperation.ATOMIC_NUMBER_ADD_AND_GET,delta);
  long result=a.doLongAtomic();
  a.backup(result);
  return result;
}
Program: 50033
Project: 50033
Buggy source:
private int dequeuePackets(){
  Packet packet=null;
  try {
    for (int i=0; i < PACKET_BULK_SIZE; i++) {
      checkPeriodics();
      packet=packetQueue.poll();
      if (packet == null) {
        return i;
      }
      processPacket(packet);
    }
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,"String_Node_Str" + packet,e);
  }
  return PACKET_BULK_SIZE;
}

Fixed version (ground truth):
private int dequeuePackets() throws Throwable {
  Packet packet=null;
  try {
    for (int i=0; i < PACKET_BULK_SIZE; i++) {
      checkPeriodics();
      packet=packetQueue.poll();
      if (packet == null) {
        return i;
      }
      processPacket(packet);
    }
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,"String_Node_Str" + packet,e);
    throw e;
  }
  return PACKET_BULK_SIZE;
}
Program: 50034
Project: 50034
Buggy source:
private int dequeueProcessables(){
  Processable processable=null;
  try {
    for (int i=0; i < PROCESSABLE_BULK_SIZE; i++) {
      checkPeriodics();
      processable=processableQueue.poll();
      if (processable == null) {
        return i;
      }
      processProcessable(processable);
    }
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,"String_Node_Str" + processable,e);
  }
  return PACKET_BULK_SIZE;
}

Fixed version (ground truth):
private int dequeueProcessables() throws Throwable {
  Processable processable=null;
  try {
    for (int i=0; i < PROCESSABLE_BULK_SIZE; i++) {
      checkPeriodics();
      processable=processableQueue.poll();
      if (processable == null) {
        return i;
      }
      processProcessable(processable);
    }
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,"String_Node_Str" + processable,e);
    throw e;
  }
  return PACKET_BULK_SIZE;
}
Program: 50035
Project: 50035
Buggy source:
public boolean enqueueAndWait(final Processable processable,final int seconds){
  try {
    final CountDownLatch l=new CountDownLatch(1);
    enqueueAndReturn(new Processable(){
      public void process(){
        processable.process();
        l.countDown();
      }
    }
);
    return l.await(seconds,TimeUnit.SECONDS);
  }
 catch (  InterruptedException ignored) {
  }
  return false;
}

Fixed version (ground truth):
public boolean enqueueAndWait(final Processable processable,final int seconds){
  try {
    final CountDownLatch l=new CountDownLatch(1);
    enqueueAndReturn(new Processable(){
      public void process(){
        processable.process();
        l.countDown();
      }
    }
);
    node.checkNodeState();
    return l.await(seconds,TimeUnit.SECONDS);
  }
 catch (  InterruptedException ignored) {
  }
  return false;
}
Program: 50037
Project: 50037
Buggy source:
void checkNodeState(){
  if (factory.restarted) {
    throw new IllegalStateException("String_Node_Str");
  }
 else   if (!isActive()) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
public void checkNodeState(){
  if (factory.restarted) {
    throw new IllegalStateException("String_Node_Str");
  }
 else   if (!isActive()) {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 50038
Project: 50038
Buggy source:
public PartitionReal getPartitionReal(final int partitionId){
  PartitionReal partitionReal=mapRealPartitions.get(partitionId);
  if (partitionReal == null) {
    final BlockingQueue<PartitionReal> responseQ=ResponseQueueFactory.newResponseQueue();
    concurrentMapManager.enqueueAndReturn(new Processable(){
      public void process(){
        Block block=concurrentMapManager.partitionManager.getOrCreateBlock(partitionId);
        MemberImpl memberOwner=null;
        MemberImpl memberMigration=null;
        if (block.getOwner() != null) {
          if (concurrentMapManager.thisAddress.equals(block.getOwner())) {
            memberOwner=concurrentMapManager.thisMember;
          }
 else {
            memberOwner=concurrentMapManager.getMember(block.getOwner());
          }
        }
        if (block.getMigrationAddress() != null) {
          if (concurrentMapManager.thisAddress.equals(block.getMigrationAddress())) {
            memberMigration=concurrentMapManager.thisMember;
          }
 else {
            memberMigration=concurrentMapManager.getMember(block.getMigrationAddress());
          }
        }
        responseQ.offer(new PartitionReal(partitionId,memberOwner,memberMigration));
      }
    }
);
    try {
      partitionReal=responseQ.take();
      mapRealPartitions.put(partitionId,partitionReal);
      return partitionReal;
    }
 catch (    InterruptedException ignored) {
    }
  }
  return partitionReal;
}

Fixed version (ground truth):
public PartitionReal getPartitionReal(final int partitionId){
  PartitionReal partitionReal=mapRealPartitions.get(partitionId);
  if (partitionReal == null) {
    final BlockingQueue<PartitionReal> responseQ=ResponseQueueFactory.newResponseQueue();
    concurrentMapManager.enqueueAndReturn(new Processable(){
      public void process(){
        Block block=concurrentMapManager.partitionManager.getOrCreateBlock(partitionId);
        MemberImpl memberOwner=null;
        MemberImpl memberMigration=null;
        if (block.getOwner() != null) {
          if (concurrentMapManager.thisAddress.equals(block.getOwner())) {
            memberOwner=concurrentMapManager.thisMember;
          }
 else {
            memberOwner=concurrentMapManager.getMember(block.getOwner());
          }
        }
        if (block.getMigrationAddress() != null) {
          if (concurrentMapManager.thisAddress.equals(block.getMigrationAddress())) {
            memberMigration=concurrentMapManager.thisMember;
          }
 else {
            memberMigration=concurrentMapManager.getMember(block.getMigrationAddress());
          }
        }
        responseQ.offer(new PartitionReal(partitionId,memberOwner,memberMigration));
      }
    }
);
    try {
      while (partitionReal == null) {
        partitionReal=responseQ.poll(5,TimeUnit.SECONDS);
        if (partitionVersion == null) {
          concurrentMapManager.node.checkNodeState();
        }
      }
      mapRealPartitions.put(partitionId,partitionReal);
      return partitionReal;
    }
 catch (    InterruptedException ignored) {
    }
  }
  return partitionReal;
}
Program: 50042
Project: 50042
Buggy source:
void backupIfNextOrPreviousChanged(boolean add){
  List<Record> lsOwnedRecords=new ArrayList<Record>(1000);
  Collection<CMap> cmaps=concurrentMapManager.maps.values();
  for (  final CMap cmap : cmaps) {
    boolean shouldBackup=false;
    if (cmap.backupCount > 0) {
      if (add) {
        shouldBackup=node.clusterManager.isNextChanged(cmap.backupCount);
      }
 else {
        shouldBackup=node.clusterManager.isNextChanged(cmap.backupCount) || node.clusterManager.isPreviousChanged(cmap.backupCount);
      }
    }
    if (shouldBackup) {
      for (      Record rec : cmap.mapRecords.values()) {
        if (rec.isActive()) {
          if (rec.getKeyData() == null || rec.getKeyData().size() == 0) {
            throw new RuntimeException("String_Node_Str" + rec.getKeyData());
          }
          lsOwnedRecords.add(rec);
        }
      }
    }
  }
  if (!add)   logger.log(Level.FINEST,thisAddress + "String_Node_Str" + lsOwnedRecords.size());
  for (  final Record rec : lsOwnedRecords) {
    parallelExecutorBackups.execute(new FallThroughRunnable(){
      public void doRun(){
        concurrentMapManager.backupRecord(rec);
      }
    }
);
  }
}

Fixed version (ground truth):
void backupIfNextOrPreviousChanged(boolean add){
  List<Record> lsOwnedRecords=new ArrayList<Record>(1000);
  Collection<CMap> cmaps=concurrentMapManager.maps.values();
  for (  final CMap cmap : cmaps) {
    boolean shouldBackup=false;
    if (cmap.backupCount > 0) {
      if (add) {
        shouldBackup=node.clusterManager.isNextChanged(cmap.backupCount);
      }
 else {
        shouldBackup=node.clusterManager.isNextChanged(cmap.backupCount) || node.clusterManager.isPreviousChanged(cmap.backupCount);
      }
    }
    if (shouldBackup) {
      for (      Record rec : cmap.mapRecords.values()) {
        if (rec.isActive()) {
          if (rec.getKeyData() == null || rec.getKeyData().size() == 0) {
            throw new RuntimeException("String_Node_Str" + rec.getKeyData());
          }
          lsOwnedRecords.add(rec);
        }
      }
    }
  }
  if (!add)   logger.log(Level.FINEST,thisAddress + "String_Node_Str" + lsOwnedRecords.size());
  backupTaskCount.addAndGet(lsOwnedRecords.size());
  for (  final Record rec : lsOwnedRecords) {
    parallelExecutorBackups.execute(new FallThroughRunnable(){
      public void doRun(){
        try {
          concurrentMapManager.backupRecord(rec);
        }
  finally {
          backupTaskCount.decrementAndGet();
        }
      }
    }
);
  }
}
Program: 50043
Project: 50043
Buggy source:
public void reset(){
  lsBlocksToMigrate.clear();
  for (int i=0; i < PARTITION_COUNT; i++) {
    blocks[i]=null;
  }
  partitionServiceImpl.reset();
  parallelExecutorBackups.shutdown();
  parallelExecutorMigration.shutdown();
}

Fixed version (ground truth):
public void reset(){
  lsBlocksToMigrate.clear();
  for (int i=0; i < PARTITION_COUNT; i++) {
    blocks[i]=null;
  }
  partitionServiceImpl.reset();
  parallelExecutorBackups.shutdown();
  parallelExecutorMigration.shutdown();
  backupTaskCount.set(0);
}
Program: 50044
Project: 50044
Buggy source:
public Values(Collection<Data> lsValues){
  super();
  this.lsValues=lsValues;
}

Fixed version (ground truth):
public Values(Collection<Data> values){
  super();
  if (values != null) {
    this.lsValues=new ArrayList<Data>(values.size());
    for (    Data data : values) {
      if (data != null) {
        lsValues.add(data);
      }
    }
  }
}
Program: 50045
Project: 50045
Buggy source:
Record toRecord(Request req){
  Record record=getRecord(req);
  if (record == null) {
    if (isMultiMap()) {
      record=createNewRecord(req.key,null);
      record.addValue(req.value);
    }
 else {
      record=createNewRecord(req.key,req.value);
    }
    mapRecords.put(req.key,record);
  }
 else {
    if (req.value != null) {
      if (isMultiMap()) {
        record.addValue(req.value);
      }
 else {
        record.setValue(req.value);
      }
    }
  }
  record.setIndexes(req.indexes,req.indexTypes);
  record.setCopyCount((int)req.longValue);
  if (req.lockCount >= 0) {
    DistributedLock lock=new DistributedLock(req.lockAddress,req.lockThreadId,req.lockCount);
    record.setLock(lock);
  }
  return record;
}

Fixed version (ground truth):
Record toRecord(Request req){
  Record record=getRecord(req);
  if (record == null) {
    if (isMultiMap()) {
      record=createNewRecord(req.key,null);
      if (req.value != null) {
        record.addValue(req.value);
      }
    }
 else {
      record=createNewRecord(req.key,req.value);
    }
    mapRecords.put(req.key,record);
  }
 else {
    if (req.value != null) {
      if (isMultiMap()) {
        record.addValue(req.value);
      }
 else {
        record.setValue(req.value);
      }
    }
  }
  record.setIndexes(req.indexes,req.indexTypes);
  record.setCopyCount((int)req.longValue);
  if (req.lockCount >= 0) {
    DistributedLock lock=new DistributedLock(req.lockAddress,req.lockThreadId,req.lockCount);
    record.setLock(lock);
  }
  return record;
}
Program: 50046
Project: 50046
Buggy source:
public boolean removeMulti(Request req){
  Record record=getRecord(req);
  if (record == null)   return false;
  boolean removed=false;
  if (req.value == null) {
    removed=true;
    markAsRemoved(record);
  }
 else {
    if (record.containsValue(req.value)) {
      if (record.getMultiValues() != null) {
        Iterator<Data> itValues=record.getMultiValues().iterator();
        while (itValues.hasNext()) {
          Data value=itValues.next();
          if (req.value.equals(value)) {
            itValues.remove();
            removed=true;
          }
        }
      }
    }
  }
  if (req.txnId != -1) {
    unlock(record);
  }
  if (removed) {
    record.incrementVersion();
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_REMOVED,record.getKeyData(),null,req.value,record.getListeners(),req.caller);
    logger.log(Level.FINEST,record.getValueData() + "String_Node_Str" + record.getMultiValues());
  }
  req.version=record.getVersion();
  if (record.valueCount() == 0) {
    markAsRemoved(record);
  }
  return removed;
}

Fixed version (ground truth):
public boolean removeMulti(Request req){
  Record record=getRecord(req);
  if (record == null)   return false;
  boolean removed=false;
  if (req.value == null) {
    removed=true;
    markAsRemoved(record);
  }
 else {
    if (record.containsValue(req.value)) {
      if (record.getMultiValues() != null) {
        removed=record.getMultiValues().remove(req.value);
      }
    }
  }
  if (req.txnId != -1) {
    unlock(record);
  }
  if (removed) {
    record.incrementVersion();
    concurrentMapManager.fireMapEvent(mapListeners,getName(),EntryEvent.TYPE_REMOVED,record.getKeyData(),null,req.value,record.getListeners(),req.caller);
    logger.log(Level.FINEST,record.getValueData() + "String_Node_Str" + record.getMultiValues());
  }
  req.version=record.getVersion();
  if (record.valueCount() == 0) {
    markAsRemoved(record);
  }
  return removed;
}
Program: 50047
Project: 50047
Buggy source:
public void addValue(Data value){
  if (getMultiValues() == null) {
    setMultiValues(new HashSet<Data>(2));
  }
  getMultiValues().add(value);
}

Fixed version (ground truth):
public void addValue(Data value){
  if (value != null) {
    if (getMultiValues() == null) {
      setMultiValues(new CopyOnWriteArraySet<Data>(){
        @Override public boolean add(        Data e){
          return e != null && super.add(e);
        }
      }
);
    }
    getMultiValues().add(value);
  }
}
Program: 50048
Project: 50048
Buggy source:
public byte[] toByteArray(Object obj){
  if (obj == null) {
    return null;
  }
  try {
    this.bbos.reset();
    toByte(this.bbos,obj);
    final byte[] result=this.bbos.toByteArray();
    if (this.bbos.size() > OUTPUT_STREAM_BUFFER_SIZE) {
      this.bbos.set(new byte[OUTPUT_STREAM_BUFFER_SIZE]);
    }
    return result;
  }
 catch (  final Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public byte[] toByteArray(Object obj){
  if (obj == null) {
    return null;
  }
  try {
    this.bbos.reset();
    toByte(this.bbos,obj);
    final byte[] result=this.bbos.toByteArray();
    if (this.bbos.size() > OUTPUT_STREAM_BUFFER_SIZE) {
      this.bbos.set(new byte[OUTPUT_STREAM_BUFFER_SIZE]);
    }
    return result;
  }
 catch (  Throwable e) {
    logger.log(Level.SEVERE,e.getMessage(),e);
    throw new RuntimeException(e);
  }
}
Program: 50049
Project: 50049
Buggy source:
public static final ObjectInputStream newObjectInputStream(final InputStream in) throws IOException {
  return new ObjectInputStream(in){
    @Override protected Class<?> resolveClass(    final ObjectStreamClass desc) throws ClassNotFoundException {
      return classForName(desc.getName());
    }
  }
;
}

Fixed version (ground truth):
public static ObjectInputStream newObjectInputStream(final InputStream in) throws IOException {
  return new ObjectInputStream(in){
    @Override protected Class<?> resolveClass(    final ObjectStreamClass desc) throws ClassNotFoundException {
      return classForName(desc.getName());
    }
  }
;
}