nus-yam/ex-repair huggingface dataset:
Program: 49024
Project: 49024
Buggy source:
@Override public Collection<DistributedObject> getDistributedObjects(){
  try {
    GetDistributedObjectsRequest request=new GetDistributedObjectsRequest();
    final SerializableCollection serializableCollection=(SerializableCollection)invocationService.invokeOnRandomTarget(request);
    final ArrayList<DistributedObject> coll=new ArrayList<DistributedObject>(serializableCollection.size());
    for (    Data data : serializableCollection) {
      final DistributedObjectInfo o=(DistributedObjectInfo)serializationService.toObject(data);
      coll.add(getDistributedObject(o.getServiceName(),o.getId()));
    }
    return coll;
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
@Override public Collection<DistributedObject> getDistributedObjects(){
  try {
    GetDistributedObjectsRequest request=new GetDistributedObjectsRequest();
    final SerializableCollection serializableCollection=(SerializableCollection)invocationService.invokeOnRandomTarget(request);
    for (    Data data : serializableCollection) {
      final DistributedObjectInfo o=(DistributedObjectInfo)serializationService.toObject(data);
      getDistributedObject(o.getServiceName(),o.getId());
    }
    return (Collection<DistributedObject>)proxyManager.getDistributedObjects();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 49025
Project: 49025
Buggy source:
public void shutdown(){
  final Collection<MemberImpl> memberList=getContext().getClusterService().getMemberList();
  for (  MemberImpl member : memberList) {
    ShutdownRequest request=new ShutdownRequest(name,member.getAddress());
    invoke(request,member.getAddress());
  }
}

Fixed version (ground truth):
public void shutdown(){
  ShutdownRequest request=new ShutdownRequest(name);
  invoke(request);
}
Program: 49026
Project: 49026
Buggy source:
protected void onDestroy(){
  LockDestroyRequest request=new LockDestroyRequest(getKeyData());
  invoke(request);
}

Fixed version (ground truth):
protected void onDestroy(){
  LockDestroyRequest request=new LockDestroyRequest(getId());
  invoke(request);
}
Program: 49027
Project: 49027
Buggy source:
public Object call() throws Exception {
  final CollectionService service=getService();
  service.destroyDistributedObject(proxyId);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),proxyId);
  return null;
}
Program: 49028
Project: 49028
Buggy source:
public Object call() throws Exception {
  final AtomicLongService service=getService();
  service.destroyDistributedObject(name);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49029
Project: 49029
Buggy source:
public Object call() throws Exception {
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49030
Project: 49030
Buggy source:
public Object call() throws Exception {
  final LockServiceImpl service=getService();
  service.destroyDistributedObject(keyData);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),objectId);
  return null;
}
Program: 49031
Project: 49031
Buggy source:
public LockDestroyRequest(Data keyData){
  this.keyData=keyData;
}

Fixed version (ground truth):
public LockDestroyRequest(Object objectId){
  this.objectId=objectId;
}
Program: 49032
Project: 49032
Buggy source:
public void writePortable(PortableWriter writer) throws IOException {
  keyData.writeData(writer.getRawDataOutput());
}

Fixed version (ground truth):
public void writePortable(PortableWriter writer) throws IOException {
  writer.getRawDataOutput().writeObject(objectId);
}
Program: 49033
Project: 49033
Buggy source:
public void readPortable(PortableReader reader) throws IOException {
  keyData=new Data();
  keyData.readData(reader.getRawDataInput());
}

Fixed version (ground truth):
public void readPortable(PortableReader reader) throws IOException {
  objectId=reader.getRawDataInput().readObject();
}
Program: 49034
Project: 49034
Buggy source:
public Object call() throws Exception {
  SemaphoreService service=getService();
  service.destroyDistributedObject(name);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49035
Project: 49035
Buggy source:
public ShutdownRequest(String name,Address target){
  this.name=name;
  this.target=target;
}

Fixed version (ground truth):
public ShutdownRequest(String name){
  this.name=name;
}
Program: 49036
Project: 49036
Buggy source:
@Override public Object call(){
  final MapService mapService=getService();
  mapService.destroyDistributedObject(name);
  return true;
}

Fixed version (ground truth):
@Override public Object call(){
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return true;
}
Program: 49037
Project: 49037
Buggy source:
public Object call() throws Exception {
  final QueueService service=getService();
  service.destroyDistributedObject(name);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49038
Project: 49038
Buggy source:
public Object call() throws Exception {
  final TopicService service=getService();
  service.destroyDistributedObject(name);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49039
Project: 49039
Buggy source:
@Override public Collection<DistributedObject> getDistributedObjects(){
  try {
    GetDistributedObjectsRequest request=new GetDistributedObjectsRequest();
    final SerializableCollection serializableCollection=(SerializableCollection)invocationService.invokeOnRandomTarget(request);
    final ArrayList<DistributedObject> coll=new ArrayList<DistributedObject>(serializableCollection.size());
    for (    Data data : serializableCollection) {
      final DistributedObjectInfo o=(DistributedObjectInfo)serializationService.toObject(data);
      coll.add(getDistributedObject(o.getServiceName(),o.getId()));
    }
    return coll;
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}

Fixed version (ground truth):
@Override public Collection<DistributedObject> getDistributedObjects(){
  try {
    GetDistributedObjectsRequest request=new GetDistributedObjectsRequest();
    final SerializableCollection serializableCollection=(SerializableCollection)invocationService.invokeOnRandomTarget(request);
    for (    Data data : serializableCollection) {
      final DistributedObjectInfo o=(DistributedObjectInfo)serializationService.toObject(data);
      getDistributedObject(o.getServiceName(),o.getId());
    }
    return (Collection<DistributedObject>)proxyManager.getDistributedObjects();
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 49040
Project: 49040
Buggy source:
public void shutdown(){
  final Collection<MemberImpl> memberList=getContext().getClusterService().getMemberList();
  for (  MemberImpl member : memberList) {
    ShutdownRequest request=new ShutdownRequest(name,member.getAddress());
    invoke(request,member.getAddress());
  }
}

Fixed version (ground truth):
public void shutdown(){
  ShutdownRequest request=new ShutdownRequest(name);
  invoke(request);
}
Program: 49041
Project: 49041
Buggy source:
protected void onDestroy(){
  LockDestroyRequest request=new LockDestroyRequest(getKeyData());
  invoke(request);
}

Fixed version (ground truth):
protected void onDestroy(){
  LockDestroyRequest request=new LockDestroyRequest(getId());
  invoke(request);
}
Program: 49042
Project: 49042
Buggy source:
public Object call() throws Exception {
  final CollectionService service=getService();
  service.destroyDistributedObject(proxyId);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),proxyId);
  return null;
}
Program: 49043
Project: 49043
Buggy source:
public Object call() throws Exception {
  final AtomicLongService service=getService();
  service.destroyDistributedObject(name);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49044
Project: 49044
Buggy source:
public Object call() throws Exception {
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49045
Project: 49045
Buggy source:
public Object call() throws Exception {
  final LockServiceImpl service=getService();
  service.destroyDistributedObject(keyData);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),objectId);
  return null;
}
Program: 49046
Project: 49046
Buggy source:
public LockDestroyRequest(Data keyData){
  this.keyData=keyData;
}

Fixed version (ground truth):
public LockDestroyRequest(Object objectId){
  this.objectId=objectId;
}
Program: 49047
Project: 49047
Buggy source:
public void writePortable(PortableWriter writer) throws IOException {
  keyData.writeData(writer.getRawDataOutput());
}

Fixed version (ground truth):
public void writePortable(PortableWriter writer) throws IOException {
  writer.getRawDataOutput().writeObject(objectId);
}
Program: 49048
Project: 49048
Buggy source:
public void readPortable(PortableReader reader) throws IOException {
  keyData=new Data();
  keyData.readData(reader.getRawDataInput());
}

Fixed version (ground truth):
public void readPortable(PortableReader reader) throws IOException {
  objectId=reader.getRawDataInput().readObject();
}
Program: 49049
Project: 49049
Buggy source:
public Object call() throws Exception {
  SemaphoreService service=getService();
  service.destroyDistributedObject(name);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49050
Project: 49050
Buggy source:
public ShutdownRequest(String name,Address target){
  this.name=name;
  this.target=target;
}

Fixed version (ground truth):
public ShutdownRequest(String name){
  this.name=name;
}
Program: 49051
Project: 49051
Buggy source:
@Override public Object call(){
  final MapService mapService=getService();
  mapService.destroyDistributedObject(name);
  return true;
}

Fixed version (ground truth):
@Override public Object call(){
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return true;
}
Program: 49052
Project: 49052
Buggy source:
public Object call() throws Exception {
  final QueueService service=getService();
  service.destroyDistributedObject(name);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49053
Project: 49053
Buggy source:
public Object call() throws Exception {
  final TopicService service=getService();
  service.destroyDistributedObject(name);
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  getClientEngine().getProxyService().destroyDistributedObject(getServiceName(),name);
  return null;
}
Program: 49056
Project: 49056
Buggy source:
public void run(){
  int partitionId=getPartitionId();
  RecordStore recordStore=mapService.getRecordStore(partitionId,name);
  entrySet=new MapEntrySet();
  for (  Data key : keys) {
    if (partitionId == getNodeEngine().getPartitionService().getPartitionId(key)) {
      Object value=recordStore.get(key);
      if (value != null) {
        entrySet.add(new AbstractMap.SimpleImmutableEntry(key,mapService.toData(value)));
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  int partitionId=getPartitionId();
  RecordStore recordStore=mapService.getRecordStore(partitionId,name);
  Set<Data> partitionKeySet=new HashSet<Data>();
  for (  Data key : keys) {
    if (partitionId == getNodeEngine().getPartitionService().getPartitionId(key)) {
      partitionKeySet.add(key);
    }
  }
  entrySet=recordStore.getAll(partitionKeySet);
}
Program: 49058
Project: 49058
Buggy source:
public SocketAddress getSocketAddress(){
  if (conn instanceof TcpIpConnection) {
    return ((TcpIpConnection)conn).getSocketChannelWrapper().socket().getRemoteSocketAddress();
  }
  return null;
}

Fixed version (ground truth):
public SocketAddress getSocketAddress(){
  return socketAddress;
}
Program: 49059
Project: 49059
Buggy source:
ClientEndpoint(ClientEngine clientEngine,Connection conn,String uuid){
  this.clientEngine=clientEngine;
  this.conn=conn;
  this.uuid=uuid;
}

Fixed version (ground truth):
ClientEndpoint(ClientEngine clientEngine,Connection conn,String uuid){
  this.clientEngine=clientEngine;
  this.conn=conn;
  socketAddress=conn instanceof TcpIpConnection ? ((TcpIpConnection)conn).getSocketChannelWrapper().socket().getRemoteSocketAddress() : null;
  this.uuid=uuid;
}
Program: 49060
Project: 49060
Buggy source:
public SocketAddress getSocketAddress(){
  if (conn instanceof TcpIpConnection) {
    return ((TcpIpConnection)conn).getSocketChannelWrapper().socket().getRemoteSocketAddress();
  }
  return null;
}

Fixed version (ground truth):
public SocketAddress getSocketAddress(){
  return socketAddress;
}
Program: 49061
Project: 49061
Buggy source:
ClientEndpoint(ClientEngine clientEngine,Connection conn,String uuid){
  this.clientEngine=clientEngine;
  this.conn=conn;
  this.uuid=uuid;
}

Fixed version (ground truth):
ClientEndpoint(ClientEngine clientEngine,Connection conn,String uuid){
  this.clientEngine=clientEngine;
  this.conn=conn;
  socketAddress=conn instanceof TcpIpConnection ? ((TcpIpConnection)conn).getSocketChannelWrapper().socket().getRemoteSocketAddress() : null;
  this.uuid=uuid;
}
Program: 49063
Project: 49063
Buggy source:
public ClassLoader getClassLoader(){
  return classLoader;
}

Fixed version (ground truth):
/** 
 * Returns the class-loader that will be used in serialization. <p> If null, then thread context class-loader will be used instead.
 * @return the class-loader
 */
public ClassLoader getClassLoader(){
  return classLoader;
}
Program: 49064
Project: 49064
Buggy source:
public Config setClassLoader(ClassLoader classLoader){
  this.classLoader=classLoader;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the class-loader to be used during de-serialization and as context class-loader of Hazelcast internal threads. <p> If not set (or set to null); thread context class-loader will be used in required places. <p> Default value is null.
 * @param classLoader class-loader to be used during de-serialization
 * @return Config instance
 */
public Config setClassLoader(ClassLoader classLoader){
  this.classLoader=classLoader;
  return this;
}
Program: 49065
Project: 49065
Buggy source:
public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  t.setContextClassLoader(classLoader);
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}

Fixed version (ground truth):
public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  ClassLoader cl=classLoader != null ? classLoader : Thread.currentThread().getContextClassLoader();
  t.setContextClassLoader(cl);
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}
Program: 49066
Project: 49066
Buggy source:
protected void onDestroy(){
  if (nearCacheListenerId != null) {
    removeEntryListener(nearCacheListenerId);
  }
  nearCache.clear();
  MapDestroyRequest request=new MapDestroyRequest(name);
  invoke(request);
}

Fixed version (ground truth):
protected void onDestroy(){
  if (nearCacheListenerId != null) {
    removeEntryListener(nearCacheListenerId);
  }
  if (nearCache != null) {
    nearCache.clear();
  }
  MapDestroyRequest request=new MapDestroyRequest(name);
  invoke(request);
}
Program: 49067
Project: 49067
Buggy source:
void clear(){
  for (  PartitionRecordStore store : maps.values()) {
    store.clear();
  }
  maps.clear();
}

Fixed version (ground truth):
void clear(){
  for (  PartitionRecordStore recordStore : maps.values()) {
    recordStore.clear();
  }
  maps.clear();
}
Program: 49068
Project: 49068
Buggy source:
public void removeAll(){
  final Collection<Data> locks=lockStore != null ? lockStore.getLockedKeys() : Collections.<Data>emptySet();
  final Map<Data,Record> lockRecords=new HashMap<Data,Record>(locks.size());
  for (  Data key : locks) {
    Record record=records.get(key);
    if (record != null) {
      lockRecords.put(key,record);
    }
  }
  Set<Data> keysToDelete=records.keySet();
  keysToDelete.removeAll(lockRecords.keySet());
  final MapStoreWrapper store=mapContainer.getStore();
  if (store != null) {
    Set<Object> keysObject=new HashSet<Object>();
    for (    Data key : keysToDelete) {
      removeIndex(key);
      keysObject.add(mapService.toObject(key));
    }
    store.deleteAll(keysObject);
    toBeRemovedKeys.clear();
  }
  records.clear();
  records.putAll(lockRecords);
}

Fixed version (ground truth):
public void removeAll(){
  final Collection<Data> locks=lockStore != null ? lockStore.getLockedKeys() : Collections.<Data>emptySet();
  final Map<Data,Record> lockRecords=new HashMap<Data,Record>(locks.size());
  for (  Data key : locks) {
    Record record=records.get(key);
    if (record != null) {
      lockRecords.put(key,record);
    }
  }
  Set<Data> keysToDelete=records.keySet();
  keysToDelete.removeAll(lockRecords.keySet());
  final MapStoreWrapper store=mapContainer.getStore();
  Set<Object> keysObject=new HashSet<Object>();
  for (  Data key : keysToDelete) {
    removeIndex(key);
    keysObject.add(mapService.toObject(key));
  }
  if (store != null) {
    store.deleteAll(keysObject);
    toBeRemovedKeys.clear();
  }
  records.clear();
  records.putAll(lockRecords);
}
Program: 49069
Project: 49069
Buggy source:
void clear(){
  final LockService lockService=mapService.getNodeEngine().getSharedService(LockService.SERVICE_NAME);
  if (lockService != null) {
    lockService.clearLockStore(partitionContainer.getPartitionId(),new DefaultObjectNamespace(MapService.SERVICE_NAME,name));
  }
  records.clear();
}

Fixed version (ground truth):
void clear(){
  final LockService lockService=mapService.getNodeEngine().getSharedService(LockService.SERVICE_NAME);
  if (lockService != null) {
    lockService.clearLockStore(partitionContainer.getPartitionId(),new DefaultObjectNamespace(MapService.SERVICE_NAME,name));
  }
  records.clear();
  final IndexService indexService=mapContainer.getIndexService();
  if (indexService.hasIndex()) {
    indexService.clear();
  }
}
Program: 49070
Project: 49070
Buggy source:
protected void onDestroy(){
  if (nearCacheListenerId != null) {
    removeEntryListener(nearCacheListenerId);
  }
  nearCache.clear();
  MapDestroyRequest request=new MapDestroyRequest(name);
  invoke(request);
}

Fixed version (ground truth):
protected void onDestroy(){
  if (nearCacheListenerId != null) {
    removeEntryListener(nearCacheListenerId);
  }
  if (nearCache != null) {
    nearCache.clear();
  }
  MapDestroyRequest request=new MapDestroyRequest(name);
  invoke(request);
}
Program: 49071
Project: 49071
Buggy source:
public ClassLoader getClassLoader(){
  return classLoader;
}

Fixed version (ground truth):
/** 
 * Returns the class-loader that will be used in serialization. <p> If null, then thread context class-loader will be used instead.
 * @return the class-loader
 */
public ClassLoader getClassLoader(){
  return classLoader;
}
Program: 49072
Project: 49072
Buggy source:
public Config setClassLoader(ClassLoader classLoader){
  this.classLoader=classLoader;
  return this;
}

Fixed version (ground truth):
/** 
 * Sets the class-loader to be used during de-serialization and as context class-loader of Hazelcast internal threads. <p> If not set (or set to null); thread context class-loader will be used in required places. <p> Default value is null.
 * @param classLoader class-loader to be used during de-serialization
 * @return Config instance
 */
public Config setClassLoader(ClassLoader classLoader){
  this.classLoader=classLoader;
  return this;
}
Program: 49073
Project: 49073
Buggy source:
public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  t.setContextClassLoader(classLoader);
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}

Fixed version (ground truth):
public final Thread newThread(Runnable r){
  final Thread t=createThread(r);
  ClassLoader cl=classLoader != null ? classLoader : Thread.currentThread().getContextClassLoader();
  t.setContextClassLoader(cl);
  if (t.isDaemon()) {
    t.setDaemon(false);
  }
  if (t.getPriority() != Thread.NORM_PRIORITY) {
    t.setPriority(Thread.NORM_PRIORITY);
  }
  return t;
}
Program: 49074
Project: 49074
Buggy source:
public boolean replace(K key,V oldValue,V newValue){
  TxnMapRequest request=new TxnMapRequest(getName(),TxnMapRequest.TxnMapRequestType.REPLACE,toData(key),toData(oldValue),toData(newValue));
  Boolean result=invoke(request);
  return result;
}

Fixed version (ground truth):
public boolean replace(K key,V oldValue,V newValue){
  TxnMapRequest request=new TxnMapRequest(getName(),TxnMapRequest.TxnMapRequestType.REPLACE_IF_SAME,toData(key),toData(oldValue),toData(newValue));
  Boolean result=invoke(request);
  return result;
}
Program: 49075
Project: 49075
Buggy source:
public Object call() throws Exception {
  final TransactionContext context=getEndpoint().getTransactionContext();
  final TransactionalMap map=context.getMap(name);
switch (requestType) {
case CONTAINS_KEY:
    return map.containsKey(key);
case GET:
  return map.get(key);
case SIZE:
return map.size();
case PUT:
return map.put(key,value);
case PUT_IF_ABSENT:
return map.putIfAbsent(key,value);
case REPLACE:
return map.replace(key,value);
case REPLACE_IS_SAME:
return map.replace(key,value,newValue);
case SET:
map.set(key,value);
break;
case REMOVE:
return map.remove(key);
case DELETE:
map.delete(key);
break;
case REMOVE_IF_SAME:
return map.remove(key,value);
}
return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  final TransactionContext context=getEndpoint().getTransactionContext();
  final TransactionalMap map=context.getMap(name);
switch (requestType) {
case CONTAINS_KEY:
    return map.containsKey(key);
case GET:
  return map.get(key);
case SIZE:
return map.size();
case PUT:
return map.put(key,value);
case PUT_IF_ABSENT:
return map.putIfAbsent(key,value);
case REPLACE:
return map.replace(key,value);
case REPLACE_IF_SAME:
return map.replace(key,value,newValue);
case SET:
map.set(key,value);
break;
case REMOVE:
return map.remove(key);
case DELETE:
map.delete(key);
break;
case REMOVE_IF_SAME:
return map.remove(key,value);
}
return null;
}
Program: 49076
Project: 49076
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeItemListener(registrationId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeItemListener(registrationId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49077
Project: 49077
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeEntryListener(listenerId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeEntryListener(listenerId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49078
Project: 49078
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeItemListener(registrationId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeItemListener(registrationId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49079
Project: 49079
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeItemListener(registrationId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeItemListener(registrationId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49080
Project: 49080
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeMessageListener(registrationId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeMessageListener(registrationId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49081
Project: 49081
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeItemListener(registrationId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeItemListener(registrationId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49082
Project: 49082
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeEntryListener(listenerId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeEntryListener(listenerId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49083
Project: 49083
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeItemListener(registrationId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeItemListener(registrationId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49084
Project: 49084
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeItemListener(registrationId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeItemListener(registrationId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49085
Project: 49085
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeMessageListener(registrationId);
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  try {
    managedObject.removeMessageListener(registrationId);
  }
 catch (  Exception ignored) {
  }
}
Program: 49086
Project: 49086
Buggy source:
public AtomicLongMBean(IAtomicLong managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
}

Fixed version (ground truth):
public AtomicLongMBean(IAtomicLong managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
}
Program: 49087
Project: 49087
Buggy source:
protected CountDownLatchMBean(ICountDownLatch managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
}

Fixed version (ground truth):
protected CountDownLatchMBean(ICountDownLatch managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
}
Program: 49088
Project: 49088
Buggy source:
protected InstanceMBean(HazelcastInstance managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName(null,null);
  config=managedObject.getConfig();
  cluster=managedObject.getCluster();
}

Fixed version (ground truth):
protected InstanceMBean(HazelcastInstance managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName(null,null);
  config=managedObject.getConfig();
  cluster=managedObject.getCluster();
}
Program: 49089
Project: 49089
Buggy source:
protected ListMBean(IList<?> managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
  ItemListener itemListener=new ItemListener(){
    public void itemAdded(    ItemEvent item){
      totalAddedItemCount.incrementAndGet();
    }
    public void itemRemoved(    ItemEvent item){
      totalRemovedItemCount.incrementAndGet();
    }
  }
;
  registrationId=managedObject.addItemListener(itemListener,false);
}

Fixed version (ground truth):
protected ListMBean(IList<?> managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
  ItemListener itemListener=new ItemListener(){
    public void itemAdded(    ItemEvent item){
      totalAddedItemCount.incrementAndGet();
    }
    public void itemRemoved(    ItemEvent item){
      totalRemovedItemCount.incrementAndGet();
    }
  }
;
  registrationId=managedObject.addItemListener(itemListener,false);
}
Program: 49090
Project: 49090
Buggy source:
protected LockMBean(ILock managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
}

Fixed version (ground truth):
protected LockMBean(ILock managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
}
Program: 49091
Project: 49091
Buggy source:
public static void shutdownAll(){
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  try {
    Set<ObjectName> entries=mbs.queryNames(new ObjectName(HazelcastMBean.DOMAIN + "String_Node_Str"),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    Logger.getLogger(ManagementService.class.getName()).log(Level.WARNING,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static void shutdownAll(){
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  try {
    Set<ObjectName> entries=mbs.queryNames(new ObjectName(DOMAIN + "String_Node_Str"),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    Logger.getLogger(ManagementService.class.getName()).log(Level.WARNING,"String_Node_Str",e);
  }
}
Program: 49092
Project: 49092
Buggy source:
public void destroy(){
  if (!enabled) {
    return;
  }
  instance.removeDistributedObjectListener(registrationId);
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  try {
    Set<ObjectName> entries=mbs.queryNames(new ObjectName(HazelcastMBean.DOMAIN + "String_Node_Str" + instance.getName()+ "String_Node_Str"),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    logger.warning("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void destroy(){
  if (!enabled) {
    return;
  }
  instance.removeDistributedObjectListener(registrationId);
  MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
  try {
    Set<ObjectName> entries=mbs.queryNames(new ObjectName(DOMAIN + "String_Node_Str" + quote(instance.getName())+ "String_Node_Str"),null);
    for (    ObjectName name : entries) {
      if (mbs.isRegistered(name)) {
        mbs.unregisterMBean(name);
      }
    }
  }
 catch (  Exception e) {
    logger.warning("String_Node_Str",e);
  }
}
Program: 49093
Project: 49093
Buggy source:
private void unregisterDistributedObject(DistributedObject distributedObject){
  HazelcastMBean bean=createHazelcastBean(distributedObject);
  if (bean != null) {
    MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
    if (mbs.isRegistered(bean.objectName)) {
      try {
        mbs.unregisterMBean(bean.objectName);
      }
 catch (      Exception e) {
        logger.warning("String_Node_Str" + bean.objectName,e);
      }
    }
  }
}

Fixed version (ground truth):
private void unregisterDistributedObject(DistributedObject distributedObject){
  final String objectType=getObjectType(distributedObject);
  if (objectType != null) {
    ObjectName objectName=createObjectName(objectType,distributedObject.getName());
    MBeanServer mbs=ManagementFactory.getPlatformMBeanServer();
    if (mbs.isRegistered(objectName)) {
      try {
        mbs.unregisterMBean(objectName);
      }
 catch (      Exception e) {
        logger.warning("String_Node_Str" + objectName,e);
      }
    }
  }
}
Program: 49094
Project: 49094
Buggy source:
protected MapMBean(IMap managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
  EntryListener entryListener=new EntryListener(){
    public void entryAdded(    EntryEvent event){
      totalAddedEntryCount.incrementAndGet();
    }
    public void entryRemoved(    EntryEvent event){
      totalRemovedEntryCount.incrementAndGet();
    }
    public void entryUpdated(    EntryEvent event){
      totalUpdatedEntryCount.incrementAndGet();
    }
    public void entryEvicted(    EntryEvent event){
      totalEvictedEntryCount.incrementAndGet();
    }
  }
;
  listenerId=managedObject.addEntryListener(entryListener,false);
}

Fixed version (ground truth):
protected MapMBean(IMap managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
  EntryListener entryListener=new EntryListener(){
    public void entryAdded(    EntryEvent event){
      totalAddedEntryCount.incrementAndGet();
    }
    public void entryRemoved(    EntryEvent event){
      totalRemovedEntryCount.incrementAndGet();
    }
    public void entryUpdated(    EntryEvent event){
      totalUpdatedEntryCount.incrementAndGet();
    }
    public void entryEvicted(    EntryEvent event){
      totalEvictedEntryCount.incrementAndGet();
    }
  }
;
  listenerId=managedObject.addEntryListener(entryListener,false);
}
Program: 49095
Project: 49095
Buggy source:
protected MultiMapMBean(MultiMap managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
}

Fixed version (ground truth):
protected MultiMapMBean(MultiMap managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
}
Program: 49096
Project: 49096
Buggy source:
protected QueueMBean(IQueue managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
  ItemListener itemListener=new ItemListener(){
    public void itemAdded(    ItemEvent item){
      totalAddedItemCount.incrementAndGet();
    }
    public void itemRemoved(    ItemEvent item){
      totalRemovedItemCount.incrementAndGet();
    }
  }
;
  registrationId=managedObject.addItemListener(itemListener,false);
}

Fixed version (ground truth):
protected QueueMBean(IQueue managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
  ItemListener itemListener=new ItemListener(){
    public void itemAdded(    ItemEvent item){
      totalAddedItemCount.incrementAndGet();
    }
    public void itemRemoved(    ItemEvent item){
      totalRemovedItemCount.incrementAndGet();
    }
  }
;
  registrationId=managedObject.addItemListener(itemListener,false);
}
Program: 49097
Project: 49097
Buggy source:
protected SemaphoreMBean(ISemaphore managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
}

Fixed version (ground truth):
protected SemaphoreMBean(ISemaphore managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
}
Program: 49098
Project: 49098
Buggy source:
public void preDeregister() throws Exception {
  super.preDeregister();
}

Fixed version (ground truth):
public void preDeregister() throws Exception {
  super.preDeregister();
  managedObject.removeItemListener(registrationId);
}
Program: 49099
Project: 49099
Buggy source:
protected SetMBean(ISet managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
  ItemListener itemListener=new ItemListener(){
    public void itemAdded(    ItemEvent item){
      totalAddedItemCount.incrementAndGet();
    }
    public void itemRemoved(    ItemEvent item){
      totalRemovedItemCount.incrementAndGet();
    }
  }
;
}

Fixed version (ground truth):
protected SetMBean(ISet managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
  ItemListener itemListener=new ItemListener(){
    public void itemAdded(    ItemEvent item){
      totalAddedItemCount.incrementAndGet();
    }
    public void itemRemoved(    ItemEvent item){
      totalRemovedItemCount.incrementAndGet();
    }
  }
;
  registrationId=managedObject.addItemListener(itemListener,false);
}
Program: 49100
Project: 49100
Buggy source:
protected TopicMBean(ITopic managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
  MessageListener messageListener=new MessageListener(){
    public void onMessage(    Message message){
      totalMessageCount.incrementAndGet();
    }
  }
;
  registrationId=managedObject.addMessageListener(messageListener);
}

Fixed version (ground truth):
protected TopicMBean(ITopic managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
  MessageListener messageListener=new MessageListener(){
    public void onMessage(    Message message){
      totalMessageCount.incrementAndGet();
    }
  }
;
  registrationId=managedObject.addMessageListener(messageListener);
}
Program: 49101
Project: 49101
Buggy source:
public boolean replace(K key,V oldValue,V newValue){
  TxnMapRequest request=new TxnMapRequest(getName(),TxnMapRequest.TxnMapRequestType.REPLACE,toData(key),toData(oldValue),toData(newValue));
  Boolean result=invoke(request);
  return result;
}

Fixed version (ground truth):
public boolean replace(K key,V oldValue,V newValue){
  TxnMapRequest request=new TxnMapRequest(getName(),TxnMapRequest.TxnMapRequestType.REPLACE_IF_SAME,toData(key),toData(oldValue),toData(newValue));
  Boolean result=invoke(request);
  return result;
}
Program: 49102
Project: 49102
Buggy source:
public Object call() throws Exception {
  final TransactionContext context=getEndpoint().getTransactionContext();
  final TransactionalMap map=context.getMap(name);
switch (requestType) {
case CONTAINS_KEY:
    return map.containsKey(key);
case GET:
  return map.get(key);
case SIZE:
return map.size();
case PUT:
return map.put(key,value);
case PUT_IF_ABSENT:
return map.putIfAbsent(key,value);
case REPLACE:
return map.replace(key,value);
case REPLACE_IS_SAME:
return map.replace(key,value,newValue);
case SET:
map.set(key,value);
break;
case REMOVE:
return map.remove(key);
case DELETE:
map.delete(key);
break;
case REMOVE_IF_SAME:
return map.remove(key,value);
}
return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  final TransactionContext context=getEndpoint().getTransactionContext();
  final TransactionalMap map=context.getMap(name);
switch (requestType) {
case CONTAINS_KEY:
    return map.containsKey(key);
case GET:
  return map.get(key);
case SIZE:
return map.size();
case PUT:
return map.put(key,value);
case PUT_IF_ABSENT:
return map.putIfAbsent(key,value);
case REPLACE:
return map.replace(key,value);
case REPLACE_IF_SAME:
return map.replace(key,value,newValue);
case SET:
map.set(key,value);
break;
case REMOVE:
return map.remove(key);
case DELETE:
map.delete(key);
break;
case REMOVE_IF_SAME:
return map.remove(key,value);
}
return null;
}
Program: 49103
Project: 49103
Buggy source:
@Override public Collection<DistributedObject> getDistributedObjects(){
  Collection<DistributedObject> objects=new LinkedList<DistributedObject>();
  for (  ClientProxy clientProxy : proxyManager.getProxies()) {
    objects.add(clientProxy);
  }
  return objects;
}

Fixed version (ground truth):
@Override public Collection<DistributedObject> getDistributedObjects(){
  try {
    GetDistributedObjectsRequest request=new GetDistributedObjectsRequest();
    final SerializableCollection serializableCollection=(SerializableCollection)invocationService.invokeOnRandomTarget(request);
    final ArrayList<DistributedObject> coll=new ArrayList<DistributedObject>(serializableCollection.size());
    for (    Data data : serializableCollection) {
      final DistributedObjectInfo o=(DistributedObjectInfo)serializationService.toObject(data);
      coll.add(getDistributedObject(o.getServiceName(),o.getId()));
    }
    return coll;
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 49104
Project: 49104
Buggy source:
void shutdown(){
  CLIENTS.remove(id);
  executionService.shutdown();
  partitionService.stop();
  clusterService.stop();
  connectionManager.shutdown();
}

Fixed version (ground truth):
void shutdown(){
  CLIENTS.remove(id);
  executionService.shutdown();
  partitionService.stop();
  clusterService.stop();
  connectionManager.shutdown();
  proxyManager.destroy();
}
Program: 49105
Project: 49105
Buggy source:
public void destroy(){
  for (  ClientProxy proxy : getProxies()) {
    try {
      proxy.destroy();
    }
 catch (    Exception ignored) {
    }
  }
  proxies.clear();
  listeners.clear();
}

Fixed version (ground truth):
public void destroy(){
  proxies.clear();
  listeners.clear();
}
Program: 49106
Project: 49106
Buggy source:
@Override public int getClassId(){
  return 2;
}

Fixed version (ground truth):
@Override public int getClassId(){
  return ClientPortableHook.AUTH;
}
Program: 49107
Project: 49107
Buggy source:
void doShutdown(){
  CLIENTS.remove(id);
  executionService.shutdown();
  partitionService.stop();
  clusterService.stop();
  connectionManager.shutdown();
}

Fixed version (ground truth):
void doShutdown(){
  CLIENTS.remove(id);
  executionService.shutdown();
  partitionService.stop();
  clusterService.stop();
  connectionManager.shutdown();
  proxyManager.destroy();
}
Program: 49108
Project: 49108
Buggy source:
@Override public Collection<DistributedObject> getDistributedObjects(){
  Collection<DistributedObject> objects=new LinkedList<DistributedObject>();
  for (  ClientProxy clientProxy : proxyManager.getProxies()) {
    objects.add(clientProxy);
  }
  return objects;
}

Fixed version (ground truth):
@Override public Collection<DistributedObject> getDistributedObjects(){
  try {
    GetDistributedObjectsRequest request=new GetDistributedObjectsRequest();
    final SerializableCollection serializableCollection=(SerializableCollection)invocationService.invokeOnRandomTarget(request);
    final ArrayList<DistributedObject> coll=new ArrayList<DistributedObject>(serializableCollection.size());
    for (    Data data : serializableCollection) {
      final DistributedObjectInfo o=(DistributedObjectInfo)serializationService.toObject(data);
      coll.add(getDistributedObject(o.getServiceName(),o.getId()));
    }
    return coll;
  }
 catch (  Exception e) {
    throw ExceptionUtil.rethrow(e);
  }
}
Program: 49109
Project: 49109
Buggy source:
public void destroy(){
  for (  ClientProxy proxy : getProxies()) {
    try {
      proxy.destroy();
    }
 catch (    Exception ignored) {
    }
  }
  proxies.clear();
  listeners.clear();
}

Fixed version (ground truth):
public void destroy(){
  proxies.clear();
  listeners.clear();
}
Program: 49110
Project: 49110
Buggy source:
@Override public int getClassId(){
  return 2;
}

Fixed version (ground truth):
@Override public int getClassId(){
  return ClientPortableHook.AUTH;
}
Program: 49111
Project: 49111
Buggy source:
public AtomicLongMBean(IAtomicLong managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
}

Fixed version (ground truth):
public AtomicLongMBean(IAtomicLong managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
}
Program: 49112
Project: 49112
Buggy source:
protected CountDownLatchMBean(ICountDownLatch managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
}

Fixed version (ground truth):
protected CountDownLatchMBean(ICountDownLatch managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
}
Program: 49113
Project: 49113
Buggy source:
protected InstanceMBean(HazelcastInstance managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName(null,null);
  config=managedObject.getConfig();
  cluster=managedObject.getCluster();
}

Fixed version (ground truth):
protected InstanceMBean(HazelcastInstance managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName(null,null);
  config=managedObject.getConfig();
  cluster=managedObject.getCluster();
}
Program: 49114
Project: 49114
Buggy source:
protected ListMBean(IList<?> managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
  ItemListener itemListener=new ItemListener(){
    public void itemAdded(    ItemEvent item){
      totalAddedItemCount.incrementAndGet();
    }
    public void itemRemoved(    ItemEvent item){
      totalRemovedItemCount.incrementAndGet();
    }
  }
;
  registrationId=managedObject.addItemListener(itemListener,false);
}

Fixed version (ground truth):
protected ListMBean(IList<?> managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
  ItemListener itemListener=new ItemListener(){
    public void itemAdded(    ItemEvent item){
      totalAddedItemCount.incrementAndGet();
    }
    public void itemRemoved(    ItemEvent item){
      totalRemovedItemCount.incrementAndGet();
    }
  }
;
  registrationId=managedObject.addItemListener(itemListener,false);
}
Program: 49115
Project: 49115
Buggy source:
protected LockMBean(ILock managedObject,ManagementService service){
  super(managedObject,service);
  objectName=createObjectName("String_Node_Str",managedObject.getName());
}

Fixed version (ground truth):
protected LockMBean(ILock managedObject,ManagementService service){
  super(managedObject,service);
  objectName=service.createObjectName("String_Node_Str",managedObject.getName());
}