nus-yam/ex-repair huggingface dataset:
Program: 3864
Project: 3864
Buggy source:
public BaseServiceQueueImpl(final String rootAddress,final String serviceAddress,final Object service,final QueueBuilder requestQueueBuilder,final QueueBuilder responseQueueBuilder,final ServiceMethodHandler serviceMethodHandler,final Queue<Response<Object>> responseQueue,final boolean async,final boolean handleCallbacks,final QBitSystemManager systemManager){
  if (requestQueueBuilder == null) {
    this.requestQueueBuilder=new QueueBuilder();
  }
 else {
    this.requestQueueBuilder=BeanUtils.copy(requestQueueBuilder);
  }
  if (responseQueueBuilder == null) {
    this.responseQueueBuilder=new QueueBuilder();
  }
 else {
    this.responseQueueBuilder=BeanUtils.copy(responseQueueBuilder);
  }
  if (responseQueue == null) {
    logger.info("String_Node_Str");
    this.responseQueue=this.responseQueueBuilder.setName("String_Node_Str" + serviceMethodHandler.address()).build();
  }
 else {
    this.responseQueue=responseQueue;
  }
  this.responseSendQueue=this.responseQueue.sendQueue();
  this.service=service;
  this.serviceMethodHandler=serviceMethodHandler;
  this.serviceMethodHandler.init(service,rootAddress,serviceAddress,responseSendQueue);
  this.eventQueue=this.requestQueueBuilder.setName("String_Node_Str" + serviceMethodHandler.address()).build();
  this.handleCallbacks=handleCallbacks;
  this.requestQueue=initRequestQueue(serviceMethodHandler,async);
  this.systemManager=systemManager;
}

Fixed version (ground truth):
public BaseServiceQueueImpl(final String rootAddress,final String serviceAddress,final Object service,final QueueBuilder requestQueueBuilder,final QueueBuilder responseQueueBuilder,final ServiceMethodHandler serviceMethodHandler,final Queue<Response<Object>> responseQueue,final boolean async,final boolean handleCallbacks,final QBitSystemManager systemManager){
  if (requestQueueBuilder == null) {
    this.requestQueueBuilder=new QueueBuilder();
  }
 else {
    this.requestQueueBuilder=BeanUtils.copy(requestQueueBuilder);
  }
  if (responseQueueBuilder == null) {
    this.responseQueueBuilder=new QueueBuilder();
  }
 else {
    this.responseQueueBuilder=BeanUtils.copy(responseQueueBuilder);
  }
  if (responseQueue == null) {
    logger.info("String_Node_Str");
    this.responseQueue=this.responseQueueBuilder.setName("String_Node_Str" + serviceMethodHandler.address()).build();
  }
 else {
    this.responseQueue=responseQueue;
  }
  this.responseSendQueue=this.responseQueue.sendQueue();
  this.service=service;
  this.serviceMethodHandler=serviceMethodHandler;
  this.serviceMethodHandler.init(service,rootAddress,serviceAddress,responseSendQueue);
  this.eventQueue=this.requestQueueBuilder.setName("String_Node_Str" + serviceMethodHandler.address()).build();
  this.handleCallbacks=handleCallbacks;
  this.requestQueue=initRequestQueue(serviceMethodHandler,async);
  this.systemManager=systemManager;
  this.factory=factory();
}
Program: 3865
Project: 3865
Buggy source:
public void recordCount(String name,int count){
  recordWithTime(name,count,now);
}

Fixed version (ground truth):
public void recordCount(String name,int count){
  recordCountWithTime(name,count,now);
}
Program: 3866
Project: 3866
Buggy source:
public void increment(String name){
  recordWithTime(name,1,now);
}

Fixed version (ground truth):
public void increment(String name){
  recordCountWithTime(name,1,now);
}
Program: 3867
Project: 3867
Buggy source:
public void recordAllCountsWithTimes(final String[] names,final int[] counts,final long[] times){
  for (int index=0; index < names.length; index++) {
    String name=names[index];
    int count=counts[index];
    long now=times[index];
    recordWithTime(name,count,now);
  }
}

Fixed version (ground truth):
public void recordAllCountsWithTimes(final String[] names,final int[] counts,final long[] times){
  for (int index=0; index < names.length; index++) {
    String name=names[index];
    int count=counts[index];
    long now=times[index];
    recordCountWithTime(name,count,now);
  }
}
Program: 3868
Project: 3868
Buggy source:
public void recordAllCounts(final long timestamp,final String[] names,final int[] counts){
  for (int index=0; index < names.length; index++) {
    String name=names[index];
    int count=counts[index];
    recordWithTime(name,count,timestamp);
  }
}

Fixed version (ground truth):
public void recordAllCounts(final long timestamp,final String[] names,final int[] counts){
  for (int index=0; index < names.length; index++) {
    String name=names[index];
    int count=counts[index];
    recordCountWithTime(name,count,timestamp);
  }
}
Program: 3869
Project: 3869
Buggy source:
private void copyHeaders(HttpRequest request,Request jettyRequest){
  final MultiMap<String,String> headers=request.getHeaders();
  final Iterator<Map.Entry<String,Collection<String>>> iterator=headers.iterator();
  final HttpFields headerFields=jettyRequest.getHeaders();
  while (iterator.hasNext()) {
    final Map.Entry<String,Collection<String>> entry=iterator.next();
    final String paramName=entry.getKey();
    final Collection<String> values=entry.getValue();
    for (    String value : values) {
      headerFields.add(paramName,value);
      if (debug)       logger.debug("String_Node_Str" + paramName + "String_Node_Str"+ value);
    }
  }
}

Fixed version (ground truth):
private void copyHeaders(HttpRequest request,Request jettyRequest){
  final MultiMap<String,String> headers=request.getHeaders();
  final Iterator<Map.Entry<String,Collection<String>>> iterator=headers.iterator();
  while (iterator.hasNext()) {
    final Map.Entry<String,Collection<String>> entry=iterator.next();
    final String headerName=entry.getKey();
    final Collection<String> values=entry.getValue();
    for (    String value : values) {
      jettyRequest.header(headerName,value);
      if (debug)       logger.debug("String_Node_Str" + headerName + "String_Node_Str"+ value);
    }
  }
}
Program: 3870
Project: 3870
Buggy source:
@Override public <T>T createProxyWithChannelPrefix(final EventManager eventManager,final Class<T> eventBusProxyInterface,final String channelPrefix){
  if (!eventBusProxyInterface.isInterface()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final Map<String,String> methodToChannelMap=createMethodToChannelMap(channelPrefix,eventBusProxyInterface);
  final InvocationHandler invocationHandler=(proxy,method,args) -> {
    if (flushMethodNameSet.contains(method.getName())) {
      flushServiceProxy(eventManager);
      return null;
    }
    final String channelName=methodToChannelMap.get(method.toString());
    eventManager.sendArray(channelName,args);
    return null;
  }
;
  final Object o=Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),new Class[]{eventBusProxyInterface,ClientProxy.class},invocationHandler);
  return (T)o;
}

Fixed version (ground truth):
@Override public <T>T createProxyWithChannelPrefix(final EventManager eventManager,final Class<T> eventBusProxyInterface,final String channelPrefix){
  if (!eventBusProxyInterface.isInterface()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final Map<String,String> methodToChannelMap=createMethodToChannelMap(channelPrefix,eventBusProxyInterface);
  final InvocationHandler invocationHandler=(proxy,method,args) -> {
    if (flushMethodNameSet.contains(method.getName())) {
      flushServiceProxy(eventManager);
      return null;
    }
    final String channelName=methodToChannelMap.get(method.toString());
    eventManager.sendArray(channelName,args);
    return null;
  }
;
  final Object o=Proxy.newProxyInstance(eventBusProxyInterface.getClassLoader(),new Class[]{eventBusProxyInterface,ClientProxy.class},invocationHandler);
  return (T)o;
}
Program: 3872
Project: 3872
Buggy source:
@Override public <T>void forwardEvent(final EventTransferObject<Object> event){
  eventBus.forwardEvent(event);
}

Fixed version (ground truth):
@Override public <T>void forwardEvent(final EventTransferObject<Object> event){
  messageCountSinceLastFlush++;
  eventBus.forwardEvent(event);
}
Program: 3873
Project: 3873
Buggy source:
private EventManager createEventManager(){
  final EventManager eventManagerImpl=eventManagerBuilder().setEventConnector(eventConnectorHub).build();
  eventServiceQueue=serviceBuilder().setServiceObject(eventManagerImpl).build();
  return eventServiceQueue.createProxyWithAutoFlush(EventManager.class,periodicScheduler,100,TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
private EventManager createEventManager(){
  eventManagerImpl=eventManagerBuilder().setEventConnector(eventConnectorHub).build();
  eventServiceQueue=serviceBuilder().setServiceObject(eventManagerImpl).build();
  return eventServiceQueue.createProxyWithAutoFlush(EventManager.class,periodicScheduler,100,TimeUnit.MILLISECONDS);
}
Program: 3874
Project: 3874
Buggy source:
private EventManager wrapEventManager(final EventManager eventManager){
  if (eventManager instanceof ClientProxy) {
    return eventManager;
  }
 else {
    eventServiceQueue=serviceBuilder().setServiceObject(eventManager).build();
    return eventServiceQueue.createProxyWithAutoFlush(EventManager.class,periodicScheduler,100,TimeUnit.MILLISECONDS);
  }
}

Fixed version (ground truth):
private EventManager wrapEventManager(final EventManager eventManager){
  if (eventManager instanceof ClientProxy) {
    return eventManager;
  }
 else {
    eventManagerImpl=eventManager;
    eventServiceQueue=serviceBuilder().setServiceObject(eventManager).build();
    return eventServiceQueue.createProxyWithAutoFlush(EventManager.class,periodicScheduler,100,TimeUnit.MILLISECONDS);
  }
}
Program: 3875
Project: 3875
Buggy source:
private void copyParams(HttpRequest request,Request jettyRequest){
  final MultiMap<String,String> params=request.getParams();
  final Iterator<Map.Entry<String,Collection<String>>> iterator=params.iterator();
  while (iterator.hasNext()) {
    final Map.Entry<String,Collection<String>> entry=iterator.next();
    final String paramName=entry.getKey();
    final Collection<String> values=entry.getValue();
    for (    String value : values) {
      jettyRequest.param(paramName,value);
      if (debug)       puts("String_Node_Str",paramName,value);
    }
  }
}

Fixed version (ground truth):
private void copyParams(HttpRequest request,Request jettyRequest){
  final MultiMap<String,String> params=request.getParams();
  final Iterator<Map.Entry<String,Collection<String>>> iterator=params.iterator();
  while (iterator.hasNext()) {
    final Map.Entry<String,Collection<String>> entry=iterator.next();
    final String paramName=entry.getKey();
    final Collection<String> values=entry.getValue();
    for (    String value : values) {
      jettyRequest.param(paramName,value);
    }
  }
}
Program: 3876
Project: 3876
Buggy source:
public static HttpRequestBuilder getHttpRequestBuilder(String datacenter,String tag,RequestOptions requestOptions,String path){
  final HttpRequestBuilder httpRequestBuilder=HttpRequestBuilder.httpRequestBuilder();
  httpRequestBuilder.setUri(path);
  if (!Str.isEmpty(datacenter)) {
    httpRequestBuilder.addParam("String_Node_Str",datacenter);
  }
  if (!Str.isEmpty(tag)) {
    httpRequestBuilder.addParam("String_Node_Str",tag);
  }
  if (requestOptions.isBlocking()) {
    httpRequestBuilder.addParam("String_Node_Str",requestOptions.getWait());
    httpRequestBuilder.addParam("String_Node_Str",String.valueOf(requestOptions.getIndex()));
  }
  if (requestOptions.getConsistency() == Consistency.CONSISTENT) {
    httpRequestBuilder.addParam("String_Node_Str","String_Node_Str");
  }
  if (requestOptions.getConsistency() == Consistency.STALE) {
    httpRequestBuilder.addParam("String_Node_Str","String_Node_Str");
  }
  return httpRequestBuilder;
}

Fixed version (ground truth):
public static HttpRequestBuilder getHttpRequestBuilder(final String datacenter,final String tag,final RequestOptions requestOptions,final String path){
  final HttpRequestBuilder httpRequestBuilder=HttpRequestBuilder.httpRequestBuilder();
  httpRequestBuilder.setUri(cleanURI(path));
  if (!Str.isEmpty(datacenter)) {
    httpRequestBuilder.addParam("String_Node_Str",datacenter);
  }
  if (!Str.isEmpty(tag)) {
    httpRequestBuilder.addParam("String_Node_Str",tag);
  }
  if (requestOptions.isBlocking()) {
    httpRequestBuilder.addParam("String_Node_Str",requestOptions.getWait());
    httpRequestBuilder.addParam("String_Node_Str",String.valueOf(requestOptions.getIndex()));
  }
  if (requestOptions.getConsistency() == Consistency.CONSISTENT) {
    httpRequestBuilder.addParam("String_Node_Str","String_Node_Str");
  }
  if (requestOptions.getConsistency() == Consistency.STALE) {
    httpRequestBuilder.addParam("String_Node_Str","String_Node_Str");
  }
  return httpRequestBuilder;
}
Program: 3877
Project: 3877
Buggy source:
default ServiceServer addService(String address,ServiceQueue serviceQueue){
  serviceBundle().addServiceObject(address,serviceQueue);
  return this;
}

Fixed version (ground truth):
default ServiceServer addService(String address,ServiceQueue serviceQueue){
  serviceBundle().addService(address,serviceQueue);
  return this;
}
Program: 3878
Project: 3878
Buggy source:
@Override public void recordCount(String name,int count,long now){
  this.count+=count;
  if (out)   puts("String_Node_Str",name,count,now);
}

Fixed version (ground truth):
@Override public void recordCount(String name,int count,long now){
  this.count.addAndGet(count);
  if (out)   puts("String_Node_Str",name,count,now);
}
Program: 3879
Project: 3879
Buggy source:
@Test public void testRecord() throws Exception {
  statServiceClient.recordCount("String_Node_Str",1);
  serviceBundle.flush();
  triggerLatchWhen(o -> replicator.count == 1);
  waitForLatch(20);
  ok=replicator.count == 1 || die();
}

Fixed version (ground truth):
@Test public void testRecord() throws Exception {
  statServiceClient.recordCount("String_Node_Str",1);
  serviceBundle.flush();
  triggerLatchWhen(o -> replicator.count.get() == 1);
  waitForLatch(20);
  ok=replicator.count.get() == 1 || die();
}
Program: 3880
Project: 3880
Buggy source:
@Test public void testRecordAll() throws Exception {
  String[] names=Arry.array("String_Node_Str","String_Node_Str");
  int[] counts=Int.array(1,2);
  statServiceClient.recordAllCounts(Timer.timer().now(),names,counts);
  serviceBundle.flush();
  triggerLatchWhen(o -> replicator.count == 3);
  waitForLatch(20);
  ok=replicator.count == 3 || die(replicator.count);
}

Fixed version (ground truth):
@Test public void testRecordAll() throws Exception {
  String[] names=Arry.array("String_Node_Str","String_Node_Str");
  int[] counts=Int.array(1,2);
  statServiceClient.recordAllCounts(Timer.timer().now(),names,counts);
  serviceBundle.flush();
  triggerLatchWhen(o -> replicator.count.get() == 3);
  waitForLatch(20);
  ok=replicator.count.get() == 3 || die(replicator.count);
}
Program: 3881
Project: 3881
Buggy source:
@Test public void testRecordAll() throws Exception {
  String[] names=Arry.array("String_Node_Str","String_Node_Str");
  int[] counts=Int.array(1,2);
  statService.recordAllCounts(Timer.timer().now(),names,counts);
  ok=replicator.count == 3 || die(replicator.count);
  ok=recorder.count == 0 || die(recorder.count);
  statService.process();
  statService.queueLimit();
  statService.queueEmpty();
  ok=recorder.count == 0 || die(recorder.count);
  statService.time(System.currentTimeMillis() + 61 * 1000);
  statService.process();
  ok=recorder.count == 2 || die(recorder.count);
}

Fixed version (ground truth):
@Test public void testRecordAll() throws Exception {
  String[] names=Arry.array("String_Node_Str","String_Node_Str");
  int[] counts=Int.array(1,2);
  statService.recordAllCounts(Timer.timer().now(),names,counts);
  ok=replicator.count.get() == 3 || die(replicator.count);
  ok=recorder.count == 0 || die(recorder.count);
  statService.process();
  statService.queueLimit();
  statService.queueEmpty();
  ok=recorder.count == 0 || die(recorder.count);
  statService.time(System.currentTimeMillis() + 61 * 1000);
  statService.process();
  ok=recorder.count == 2 || die(recorder.count);
}
Program: 3882
Project: 3882
Buggy source:
@Test public void testRecord() throws Exception {
  statService.recordCount("String_Node_Str",1);
  ok=replicator.count == 1 || die();
  ok=recorder.count == 0 || die();
  statService.process();
  statService.queueLimit();
  statService.queueEmpty();
  ok=recorder.count == 0 || die();
  statService.time(System.currentTimeMillis() + 61 * 1000);
  statService.process();
  ok=recorder.count == 1 || die();
}

Fixed version (ground truth):
@Test public void testRecord() throws Exception {
  statService.recordCount("String_Node_Str",1);
  ok=replicator.count.get() == 1 || die();
  ok=recorder.count == 0 || die();
  statService.process();
  statService.queueLimit();
  statService.queueEmpty();
  ok=recorder.count == 0 || die();
  statService.time(System.currentTimeMillis() + 61 * 1000);
  statService.process();
  ok=recorder.count == 1 || die();
}
Program: 3883
Project: 3883
Buggy source:
@Test public void testReplicators() throws Exception {
  statService=new StatServiceBuilder().setRecorder(recorder).addReplicator(replicator).addReplicator(replicator).addReplicator(new NoOpReplicator()).build();
  String[] names=Arry.array("String_Node_Str","String_Node_Str");
  int[] counts=Int.array(1,2);
  long[] times=Lng.array(Timer.timer().now(),Timer.timer().now() + 2000);
  statService.recordAllCountsWithTimes(names,counts,times);
  ok=replicator.count == 6 || die(replicator.count);
  ok=recorder.count == 0 || die(recorder.count);
  statService.process();
  statService.queueLimit();
  statService.queueEmpty();
  ok=recorder.count == 0 || die(recorder.count);
  statService.time(System.currentTimeMillis() + 61 * 1000);
  statService.process();
  ok=recorder.count == 2 || die(recorder.count);
  statService=new StatServiceBuilder().setRecorder(new NoOpRecorder()).addReplicator(replicator).addReplicator(replicator).addReplicator(new NoOpReplicator()).build();
  statService.time(System.currentTimeMillis() + 61 * 1000);
  statService.process();
  ok=recorder.count == 2 || die(recorder.count);
}

Fixed version (ground truth):
@Test public void testReplicators() throws Exception {
  statService=new StatServiceBuilder().setRecorder(recorder).addReplicator(replicator).addReplicator(replicator).addReplicator(new NoOpReplicator()).build();
  String[] names=Arry.array("String_Node_Str","String_Node_Str");
  int[] counts=Int.array(1,2);
  long[] times=Lng.array(Timer.timer().now(),Timer.timer().now() + 2000);
  statService.recordAllCountsWithTimes(names,counts,times);
  ok=replicator.count.get() == 6 || die(replicator.count);
  ok=recorder.count == 0 || die(recorder.count);
  statService.process();
  statService.queueLimit();
  statService.queueEmpty();
  ok=recorder.count == 0 || die(recorder.count);
  statService.time(System.currentTimeMillis() + 61 * 1000);
  statService.process();
  ok=recorder.count == 2 || die(recorder.count);
  statService=new StatServiceBuilder().setRecorder(new NoOpRecorder()).addReplicator(replicator).addReplicator(replicator).addReplicator(new NoOpReplicator()).build();
  statService.time(System.currentTimeMillis() + 61 * 1000);
  statService.process();
  ok=recorder.count == 2 || die(recorder.count);
}
Program: 3884
Project: 3884
Buggy source:
@Override public <T>T createRemoteProxyWithReturnAddress(Class<T> serviceInterface,String address,String serviceName,String returnAddressArg,Sender<String> sender,BeforeMethodCall beforeMethodCall,int requestBatchSize){
  return remoteServiceProxyFactory.createProxyWithReturnAddress(serviceInterface,serviceName,returnAddressArg,new SenderEndPoint(this.createEncoder(),address,sender,beforeMethodCall,requestBatchSize));
}

Fixed version (ground truth):
@Override public <T>T createRemoteProxyWithReturnAddress(Class<T> serviceInterface,String address,String serviceName,String host,int port,String returnAddressArg,Sender<String> sender,BeforeMethodCall beforeMethodCall,int requestBatchSize){
  return remoteServiceProxyFactory.createProxyWithReturnAddress(serviceInterface,serviceName,host,port,returnAddressArg,new SenderEndPoint(this.createEncoder(),address,sender,beforeMethodCall,requestBatchSize));
}
Program: 3885
Project: 3885
Buggy source:
@Override public <T>T createProxy(Class<T> serviceInterface,String serviceName,EndPoint endPoint){
  return createProxyWithReturnAddress(serviceInterface,serviceName,"String_Node_Str",endPoint);
}

Fixed version (ground truth):
@Override public <T>T createProxy(Class<T> serviceInterface,String serviceName,EndPoint endPoint){
  return createProxyWithReturnAddress(serviceInterface,serviceName,"String_Node_Str",0,"String_Node_Str",endPoint);
}
Program: 3887
Project: 3887
Buggy source:
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  long messageId=generatedMessageId++;
  if (method.getName().equals("String_Node_Str")) {
    endPoint.flush();
    return null;
  }
  times--;
  if (times == 0) {
    timestamp=Timer.timer().now();
    times=10;
  }
 else {
    timestamp++;
  }
  final CharBuf addressBuf=addressCreatorBufRef.get();
  addressBuf.recycle();
  addressBuf.add(objectAddress).add("String_Node_Str").add(method.getName());
  final String address=addressBuf.toString();
  final MethodCall<Object> call=factory.createMethodCallToBeEncodedAndSent(messageId,address,returnAddress,serviceName,method.getName(),timestamp,args,null);
  if (method.getName().equals("String_Node_Str")) {
    return "String_Node_Str";
  }
  endPoint.call(call);
  return null;
}

Fixed version (ground truth):
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  long messageId=generatedMessageId++;
  if (method.getName().equals("String_Node_Str")) {
    endPoint.flush();
    return null;
  }
  times--;
  if (times == 0) {
    timestamp=Timer.timer().now();
    times=10;
  }
 else {
    timestamp++;
  }
  final CharBuf addressBuf=addressCreatorBufRef.get();
  addressBuf.recycle();
  addressBuf.add(objectAddress).add("String_Node_Str").add(method.getName());
  final String address=addressBuf.toString();
  final MethodCall<Object> call=factory.createMethodCallToBeEncodedAndSent(messageId,address,returnAddress,serviceName,method.getName(),timestamp,args,null);
switch (method.getName()) {
case "String_Node_Str":
    return port;
case "String_Node_Str":
  return host;
case "String_Node_Str":
return port == 0 ? sputs("String_Node_Str",serviceName,"String_Node_Str") : sputs("String_Node_Str",serviceName,host,port,"String_Node_Str");
default :
endPoint.call(call);
}
return null;
}
Program: 3889
Project: 3889
Buggy source:
/** 
 * Create a remote proxy using a sender that knows how to forwardEvent method body over wire
 * @param serviceInterface client view of client
 * @param uri              uri of client
 * @param serviceName      name of the client that we are proxying method calls to.
 * @param returnAddressArg return address
 * @param sender           how we are sending the message over the wire
 * @param beforeMethodCall before method call
 * @param < T >              type of client
 * @param requestBatchSize request batch size
 * @return remote proxy
 */
default <T>T createRemoteProxyWithReturnAddress(Class<T> serviceInterface,String uri,String serviceName,String returnAddressArg,Sender<String> sender,BeforeMethodCall beforeMethodCall,int requestBatchSize){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
/** 
 * Create a remote proxy using a sender that knows how to forwardEvent method body over wire
 * @param serviceInterface client view of client
 * @param uri              uri of client
 * @param serviceName      name of the client that we are proxying method calls to.
 * @param port port
 * @param host host
 * @param returnAddressArg return address
 * @param sender           how we are sending the message over the wire
 * @param beforeMethodCall before method call
 * @param < T >              type of client
 * @param requestBatchSize request batch size
 * @return remote proxy
 */
default <T>T createRemoteProxyWithReturnAddress(Class<T> serviceInterface,String uri,String serviceName,String host,int port,String returnAddressArg,Sender<String> sender,BeforeMethodCall beforeMethodCall,int requestBatchSize){
  throw new UnsupportedOperationException();
}
Program: 3890
Project: 3890
Buggy source:
@Test public void test(){
}

Fixed version (ground truth):
@Test public void test(){
  clientEventConnector.forwardEvent(event);
  flushServiceProxy(clientEventConnector);
  waitForLatch(1);
  client.flush();
  waitForLatch(1);
  verify(eventManager).forwardEvent(event);
}
Program: 3891
Project: 3891
Buggy source:
@Before public void setup(){
  setupLatch();
  eventManager=mock(EventManager.class);
  service=new EventRemoteReplicatorService(eventManager);
  serviceServer=serviceServerBuilder().build();
  serviceServer.initServices(service);
  client=clientBuilder().build();
  serviceServer.start();
  Sys.sleep(100);
  client.start();
  clientEventConnector=client.createProxy(EventConnector.class,"String_Node_Str");
}

Fixed version (ground truth):
@Before public void setup() throws IOException {
  setupLatch();
  eventManager=mock(EventManager.class);
  service=new EventRemoteReplicatorService(eventManager);
  int port=useOneOfThese(8080,7070,6060,6666,5555,4444,2121,8081,8082,7777,6767,2323,5555);
  serviceServer=serviceServerBuilder().setPort(port).build();
  serviceServer.initServices(service);
  client=clientBuilder().build();
  serviceServer.start();
  Sys.sleep(100);
  client.start();
  clientEventConnector=client.createProxy(EventConnector.class,"String_Node_Str");
}
Program: 3892
Project: 3892
Buggy source:
private Response<Object> invokeByName(MethodCall<Object> methodCall){
  final MethodAccess method=classMeta.method(methodCall.name());
  return mapArgsAsyncHandlersAndInvoke(methodCall,method);
}

Fixed version (ground truth):
private Response<Object> invokeByName(MethodCall<Object> methodCall){
  final MethodAccess method=classMeta.method(methodCall.name());
  if (method != null) {
    return mapArgsAsyncHandlersAndInvoke(methodCall,method);
  }
 else {
    if (methodCall.name().equals("String_Node_Str")) {
      puts("String_Node_Str",methodCall.objectName(),methodCall.name(),methodCall.address());
      return ResponseImpl.response(methodCall.id(),methodCall.timestamp(),methodCall.address(),methodCall.returnAddress(),sputs("String_Node_Str",methodCall.objectName(),methodCall.name(),methodCall.address()),methodCall,false);
    }
 else {
      return ResponseImpl.response(methodCall.id(),methodCall.timestamp(),methodCall.address(),methodCall.returnAddress(),new Exception("String_Node_Str"),methodCall,true);
    }
  }
}
Program: 3893
Project: 3893
Buggy source:
private void extactHandlersFromArgumentList(MethodAccess method,Object body,List<Object> argsList){
  if (body instanceof List) {
    List<Object> list=(List<Object>)body;
    extractHandlersFromArgumentListBodyIsList(method,argsList,list);
  }
 else   if (body instanceof Object[]) {
    extactHandlersFromArgumentListArrayCase(method,(Object[])body,argsList);
  }
}

Fixed version (ground truth):
private void extactHandlersFromArgumentList(MethodAccess method,Object body,List<Object> argsList){
  if (body instanceof List) {
    List<Object> list=(List<Object>)body;
    extractHandlersFromArgumentListBodyIsList(method,argsList,list);
  }
 else   if (body instanceof Object[]) {
    extractHandlersFromArgumentListArrayCase(method,(Object[])body,argsList);
  }
}
Program: 3894
Project: 3894
Buggy source:
@Test public void testAsync2(){
  String addressToMethodCall="String_Node_Str";
  serviceBundle.addService(employeeService);
  call=factory.createMethodCallByAddress(addressToMethodCall,returnAddress,"String_Node_Str",params);
  doCall();
  response=responseReceiveQueue.pollWait();
  Exceptions.requireNonNull(response);
  puts(response.body());
  ok=!response.wasErrors() || die();
  puts(response.body());
  Boon.equalsOrDie("String_Node_Str",response.body());
}

Fixed version (ground truth):
@Test public void testAsync2(){
  String addressToMethodCall="String_Node_Str";
  serviceBundle.addService(employeeService);
  call=factory.createMethodCallByAddress(addressToMethodCall,returnAddress,new Object[]{new Callback<String>(){
    @Override public void accept(    String s){
      puts("String_Node_Str" + s);
    }
  }
,"String_Node_Str"},params);
  doCall();
  response=responseReceiveQueue.pollWait();
  Exceptions.requireNonNull(response);
  puts(response.body());
  ok=!response.wasErrors() || die();
  puts(response.body());
  Boon.equalsOrDie("String_Node_Str",response.body());
}
Program: 3895
Project: 3895
Buggy source:
public void joinEventManager(){
  final EventManager eventManager=eventManager();
  eventManager.joinService(currentService());
}

Fixed version (ground truth):
public void joinEventManager(){
  final EventManager eventManager=eventManager();
  Service service=currentService();
  eventManager.joinService(service);
}
Program: 3896
Project: 3896
Buggy source:
public static HttpRequest convertRequest(final AsyncContext asyncContext){
  final HttpServletRequest request=(HttpServletRequest)asyncContext.getRequest();
  final HttpServletResponse response=(HttpServletResponse)asyncContext.getResponse();
  final MultiMap<String,String> headers=new HttpServletHeaderMultiMap(request);
  final MultiMap<String,String> params=new HttpServletParamMultiMap(request);
  final HttpRequestBuilder httpRequestBuilder=httpRequestBuilder().setParams(params).setHeaders(headers).setUri(request.getPathInfo()).setMethod(request.getMethod());
  setRequestBodyIfNeeded(request,httpRequestBuilder);
  setupRequestHandler(asyncContext,response,httpRequestBuilder);
  return httpRequestBuilder.build();
}

Fixed version (ground truth):
public static HttpRequest convertRequest(final AsyncContext asyncContext){
  final HttpServletRequest request=(HttpServletRequest)asyncContext.getRequest();
  final HttpServletResponse response=(HttpServletResponse)asyncContext.getResponse();
  final MultiMap<String,String> headers=new HttpServletHeaderMultiMap(request);
  final MultiMap<String,String> params=new HttpServletParamMultiMap(request);
  final HttpRequestBuilder httpRequestBuilder=httpRequestBuilder().setParams(params).setHeaders(headers).setUri(request.getRequestURI()).setMethod(request.getMethod());
  setRequestBodyIfNeeded(request,httpRequestBuilder);
  setupRequestHandler(asyncContext,response,httpRequestBuilder);
  return httpRequestBuilder.build();
}
Program: 3897
Project: 3897
Buggy source:
private static void setupRequestHandler(final AsyncContext asyncContext,final HttpServletResponse response,final HttpRequestBuilder httpRequestBuilder){
  httpRequestBuilder.setTextReceiver((code,contentType,body) -> {
    response.setHeader("String_Node_Str",contentType);
    try {
      final ServletOutputStream outputStream=response.getOutputStream();
      outputStream.write(body.getBytes(StandardCharsets.UTF_8));
      outputStream.close();
      asyncContext.complete();
    }
 catch (    final IOException e) {
      throw new IllegalStateException(e);
    }
  }
);
}

Fixed version (ground truth):
private static void setupRequestHandler(final AsyncContext asyncContext,final HttpServletResponse response,final HttpRequestBuilder httpRequestBuilder){
  httpRequestBuilder.setTextReceiver((code,contentType,body) -> {
    response.setHeader("String_Node_Str",contentType);
    response.setStatus(code);
    try {
      final ServletOutputStream outputStream=response.getOutputStream();
      outputStream.write(body.getBytes(StandardCharsets.UTF_8));
      outputStream.close();
      asyncContext.complete();
    }
 catch (    final IOException e) {
      throw new IllegalStateException(e);
    }
  }
);
}
Program: 3898
Project: 3898
Buggy source:
@Test public void testRecord() throws Exception {
  statServiceClient.recordCount("String_Node_Str",1);
  serviceBundle.flush();
  Sys.sleep(100);
  ok=replicator.count == 1 || die();
}

Fixed version (ground truth):
@Test public void testRecord() throws Exception {
  statServiceClient.recordCount("String_Node_Str",1);
  serviceBundle.flush();
  triggerLatchWhen(o -> replicator.count == 1);
  waitForLatch(20);
  ok=replicator.count == 1 || die();
}
Program: 3899
Project: 3899
Buggy source:
@Test public void testRecordAll() throws Exception {
  String[] names=Arry.array("String_Node_Str","String_Node_Str");
  int[] counts=Int.array(1,2);
  statServiceClient.recordAllCounts(Timer.timer().now(),names,counts);
  serviceBundle.flush();
  Sys.sleep(100);
  ok=replicator.count == 3 || die(replicator.count);
}

Fixed version (ground truth):
@Test public void testRecordAll() throws Exception {
  String[] names=Arry.array("String_Node_Str","String_Node_Str");
  int[] counts=Int.array(1,2);
  statServiceClient.recordAllCounts(Timer.timer().now(),names,counts);
  serviceBundle.flush();
  triggerLatchWhen(o -> replicator.count == 3);
  waitForLatch(20);
  ok=replicator.count == 3 || die(replicator.count);
}
Program: 3900
Project: 3900
Buggy source:
@Test public void testNoMethodCallFound(){
}

Fixed version (ground truth):
@Test public void testNoMethodCallFound(){
  ProtocolEncoder encoder=QBit.factory().createEncoder();
  MockHttpServer httpServer=new MockHttpServer();
  final ServiceBundle serviceBundle=new ServiceBundleBuilder().setAddress("String_Node_Str").build();
  JsonMapper mapper=new BoonJsonMapper();
  ServiceServerImpl server=new ServiceServerImpl(httpServer,encoder,QBit.factory().createProtocolParser(),serviceBundle,mapper,1,100,30,10,null);
  server.initServices(new TodoService());
  server.start();
  final AtomicBoolean resultsWorked=new AtomicBoolean();
  resultsWorked.set(false);
  httpServer.sendHttpGet("String_Node_Str",null,(code,mimeType,body) -> {
    if (code == 404 && body != null && body.startsWith("String_Node_Str")) {
      resultsWorked.set(true);
    }
  }
);
  waitForTrigger(20,o -> resultsWorked.get());
  if (!resultsWorked.get()) {
    die("String_Node_Str");
  }
  resultsWorked.set(false);
}
Program: 3901
Project: 3901
Buggy source:
@Test public void testServerTimeout(){
}

Fixed version (ground truth):
@Test public void testServerTimeout(){
  ProtocolEncoder encoder=QBit.factory().createEncoder();
  MockHttpServer httpServer=new MockHttpServer();
  final ServiceBundle serviceBundle=new ServiceBundleBuilder().setAddress("String_Node_Str").build();
  JsonMapper mapper=new BoonJsonMapper();
  ServiceServerImpl server=new ServiceServerImpl(httpServer,encoder,QBit.factory().createProtocolParser(),serviceBundle,mapper,1,100,30,10,null);
  server.initServices(Sets.set(new TodoService()));
  server.start();
  final AtomicBoolean resultsWorked=new AtomicBoolean();
  for (int index=0; index < 100; index++) {
    httpServer.sendHttpGet("String_Node_Str",null,(code,mimeType,body) -> {
      if (code == 408 && body != null && body.equals("String_Node_Str")) {
        resultsWorked.set(true);
      }
    }
);
  }
  waitForTrigger(8,o -> resultsWorked.get());
  if (!resultsWorked.get()) {
    die("String_Node_Str");
  }
  resultsWorked.set(false);
}
Program: 3902
Project: 3902
Buggy source:
@Test public void testServer(){
}

Fixed version (ground truth):
@Test public void testServer(){
  latch=new CountDownLatch(1);
  ProtocolEncoder encoder=QBit.factory().createEncoder();
  ProtocolParser parser=QBit.factory().createProtocolParser();
  MockHttpServer httpServer=new MockHttpServer();
  final ServiceBundle serviceBundle=new ServiceBundleBuilder().setAddress("String_Node_Str").build();
  JsonMapper mapper=new BoonJsonMapper();
  ServiceServerImpl server=new ServiceServerImpl(httpServer,encoder,parser,serviceBundle,mapper,30,100,30,10,null);
  server.initServices(Sets.set(new TodoService()));
  final AtomicBoolean resultsWorked=new AtomicBoolean();
  server.start();
  httpServer.postRequestObject("String_Node_Str",new Todo("String_Node_Str","String_Node_Str",new Date()),(code,mimeType,body) -> {
    puts("String_Node_Str",body,"String_Node_Str");
    if (body != null && code == 200 && body.equals("String_Node_Str")) {
      resultsWorked.set(true);
    }
  }
);
  waitForTrigger(20,o -> resultsWorked.get());
  if (!resultsWorked.get()) {
    die("String_Node_Str");
  }
  resultsWorked.set(false);
  httpServer.sendHttpGet("String_Node_Str",null,(code,mimeType,body) -> {
    puts("String_Node_Str",code,"String_Node_Str",mimeType,"String_Node_Str",body);
    List<Todo> todos=Boon.fromJsonArray(body,Todo.class);
    if (todos.size() > 0) {
      Todo todo=todos.get(0);
      if (todo.getDescription().equals("String_Node_Str")) {
        resultsWorked.set(true);
      }
    }
  }
);
  server.flush();
  waitForTrigger(20,o -> resultsWorked.get());
  if (!resultsWorked.get()) {
    die("String_Node_Str");
  }
}
Program: 3903
Project: 3903
Buggy source:
private void handleResponseFromServiceBundle(final Response<Object> response,final Request<Object> originatingRequest){
  originatingRequest.handled();
  if (originatingRequest instanceof HttpRequest) {
    handleResponseFromServiceToHttpResponse(response,(HttpRequest)originatingRequest);
  }
 else   if (originatingRequest instanceof WebSocketMessage) {
    handleResponseFromServiceBundleToWebSocketSender(response,(WebSocketMessage)originatingRequest);
  }
 else {
    throw new IllegalStateException("String_Node_Str" + response);
  }
}

Fixed version (ground truth):
private void handleResponseFromServiceBundle(final Response<Object> response,final Request<Object> originatingRequest){
  if (originatingRequest.isHandled()) {
    return;
  }
  originatingRequest.handled();
  if (originatingRequest instanceof HttpRequest) {
    handleResponseFromServiceToHttpResponse(response,(HttpRequest)originatingRequest);
  }
 else   if (originatingRequest instanceof WebSocketMessage) {
    handleResponseFromServiceBundleToWebSocketSender(response,(WebSocketMessage)originatingRequest);
  }
 else {
    throw new IllegalStateException("String_Node_Str" + response);
  }
}
Program: 3904
Project: 3904
Buggy source:
@Override public boolean isHandled(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isHandled(){
  return handled;
}
Program: 3905
Project: 3905
Buggy source:
private SendQueue<MethodCall<Object>> handleByAddressCall(MethodCall<Object> methodCall){
  SendQueue<MethodCall<Object>> sendQueue;
  final String callAddress=methodCall.address();
  sendQueue=serviceMapping.get(callAddress);
  if (sendQueue == null) {
    if (callAddress.indexOf('{') != -1) {
      final String[] split=StringScanner.split(callAddress,'{');
      sendQueue=serviceMapping.get(split[0]);
    }
  }
  return sendQueue;
}

Fixed version (ground truth):
private SendQueue<MethodCall<Object>> handleByAddressCall(MethodCall<Object> methodCall){
  SendQueue<MethodCall<Object>> sendQueue;
  final String callAddress=methodCall.address();
  sendQueue=serviceMapping.get(callAddress);
  if (sendQueue == null) {
    String addr;
    addr=seenAddressesDescending.higher(callAddress);
    if (addr != null && callAddress.startsWith(addr)) {
      sendQueue=serviceMapping.get(addr);
      return sendQueue;
    }
    addr=addressesByDescending.higher(callAddress);
    if (addr != null && callAddress.startsWith(addr)) {
      sendQueue=serviceMapping.get(addr);
      if (sendQueue != null) {
        seenAddressesDescending.add(addr);
      }
    }
  }
  return sendQueue;
}
Program: 3906
Project: 3906
Buggy source:
public ServiceBundleImpl(String address,int batchSize,int pollRate,Factory factory){
  if (address.endsWith("String_Node_Str")) {
    address=Str.slc(address,0,-1);
  }
  this.address=address;
  this.factory=factory;
  this.responseQueue=new BasicQueue<>("String_Node_Str" + address,pollRate,TimeUnit.MILLISECONDS,batchSize);
  this.methodQueue=new BasicQueue<>("String_Node_Str" + address,pollRate,TimeUnit.MILLISECONDS,batchSize);
  methodSendQueue=methodQueue.sendQueue();
  methodQueue.startListener(new ReceiveQueueListener<MethodCall<Object>>(){
    long time;
    long lastTimeAutoFlush;
    @Override public void receive(    MethodCall<Object> item){
      doCall(item);
    }
    @Override public void empty(){
      time=Timer.timer().now();
      if (time > (lastTimeAutoFlush + 50)) {
        for (        SendQueue<MethodCall<Object>> sendQueue : sendQueues) {
          sendQueue.flushSends();
        }
        lastTimeAutoFlush=time;
      }
    }
    @Override public void limit(){
    }
    @Override public void shutdown(){
    }
    @Override public void idle(){
    }
  }
);
}

Fixed version (ground truth):
public ServiceBundleImpl(String address,int batchSize,int pollRate,Factory factory){
  if (address.endsWith("String_Node_Str")) {
    address=Str.slc(address,0,-1);
  }
  this.address=address;
  this.factory=factory;
  this.responseQueue=new BasicQueue<>("String_Node_Str" + address,pollRate,TimeUnit.MILLISECONDS,batchSize);
  this.methodQueue=new BasicQueue<>("String_Node_Str" + address,pollRate,TimeUnit.MILLISECONDS,batchSize);
  methodSendQueue=methodQueue.sendQueue();
  start();
}
Program: 3907
Project: 3907
Buggy source:
@Override public void addService(String serviceAddress,Object object){
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this),serviceAddress,object);
  }
  final Service service=factory.createService(address,serviceAddress,object,responseQueue);
  services.add(service);
  final SendQueue<MethodCall<Object>> requests=service.requests();
  if (!Str.isEmpty(serviceAddress)) {
    serviceMapping.put(serviceAddress,requests);
  }
  serviceMapping.put(service.name(),requests);
  sendQueues.add(requests);
  final List<String> addresses=service.addresses(this.address);
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this),"String_Node_Str",addresses);
  }
  for (  String addr : addresses) {
    SendQueue<MethodCall<Object>> methodCallSendQueue=serviceMapping.get(service.name());
    serviceMapping.put(addr,methodCallSendQueue);
  }
}

Fixed version (ground truth):
@Override public void addService(String serviceAddress,Object object){
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this),serviceAddress,object);
  }
  final Service service=factory.createService(address,serviceAddress,object,responseQueue);
  services.add(service);
  final SendQueue<MethodCall<Object>> requests=service.requests();
  if (!Str.isEmpty(serviceAddress)) {
    serviceMapping.put(serviceAddress,requests);
  }
  serviceMapping.put(service.name(),requests);
  sendQueues.add(requests);
  final List<String> addresses=service.addresses(this.address);
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this),"String_Node_Str",addresses);
  }
  for (  String addr : addresses) {
    addressesByDescending.add(addr);
    SendQueue<MethodCall<Object>> methodCallSendQueue=serviceMapping.get(service.name());
    serviceMapping.put(addr,methodCallSendQueue);
  }
}
Program: 3909
Project: 3909
Buggy source:
private Response<Object> invokeByAddressWithSimpleBinding(MethodCall<Object> methodCall,Pair<MethodBinding,MethodAccess> binding){
  MethodAccess methodAccess=binding.getSecond();
  if (methodAccess.returnType() == Void.class) {
    methodAccess.invokeDynamicObject(service,methodCall.body());
    return ServiceConstants.VOID;
  }
 else {
    Object returnValue=methodAccess.invokeDynamicObject(service,methodCall.body());
    Response<Object> response=ResponseImpl.response(methodCall.id(),methodCall.timestamp(),methodCall.name(),methodCall.returnAddress(),returnValue);
    return response;
  }
}

Fixed version (ground truth):
private Response<Object> invokeByAddressWithSimpleBinding(MethodCall<Object> methodCall,Pair<MethodBinding,MethodAccess> binding){
  MethodAccess methodAccess=binding.getSecond();
  if (methodAccess.returnType() == Void.class) {
    methodAccess.invokeDynamicObject(service,methodCall.body());
    return ServiceConstants.VOID;
  }
 else {
    Object body=methodCall.body();
    if (Str.isEmpty(body) && methodAccess.parameterTypes().length > 0) {
      body=methodCall.params();
    }
    Object returnValue=methodAccess.invokeDynamicObject(service,body);
    Response<Object> response=ResponseImpl.response(methodCall.id(),methodCall.timestamp(),methodCall.name(),methodCall.returnAddress(),returnValue);
    return response;
  }
}
Program: 3911
Project: 3911
Buggy source:
/** 
 * Creates an HttpWebRequest instance and initialises it with the appropriate parameters, based on the configuration of this service object.
 * @param url                The URL that the HttpWebRequest should target.
 * @param acceptGzipEncoding If true, ask server for GZip compressed content.
 * @param allowAutoRedirect  If true, redirection response will be automatically followed.
 * @return An initialised instance of HttpWebRequest.
 * @throws ServiceLocalException       the service local exception
 * @throws java.net.URISyntaxException the uRI syntax exception
 */
protected HttpWebRequest prepareHttpWebRequestForUrl(URI url,boolean acceptGzipEncoding,boolean allowAutoRedirect) throws ServiceLocalException, URISyntaxException {
  String scheme=url.getScheme();
  if (!scheme.equalsIgnoreCase(EWSConstants.HTTP_SCHEME) && !scheme.equalsIgnoreCase(EWSConstants.HTTPS_SCHEME)) {
    String strErr=String.format("String_Node_Str",scheme);
    throw new ServiceLocalException(strErr);
  }
  request=new HttpClientWebRequest(httpClient,httpContext);
  request.setProxy(getWebProxy());
  try {
    request.setUrl(url.toURL());
  }
 catch (  MalformedURLException e) {
    String strErr=String.format("String_Node_Str",url);
    throw new ServiceLocalException(strErr);
  }
  request.setPreAuthenticate(preAuthenticate);
  request.setTimeout(timeout);
  request.setContentType("String_Node_Str");
  request.setAccept("String_Node_Str");
  request.setUserAgent(userAgent);
  request.setAllowAutoRedirect(allowAutoRedirect);
  request.setAcceptGzipEncoding(acceptGzipEncoding);
  request.setHeaders(getHttpHeaders());
  prepareCredentials(request);
  request.prepareConnection();
  httpResponseHeaders.clear();
  return request;
}

Fixed version (ground truth):
private void prepareHttpWebRequestForUrl(URI url,boolean acceptGzipEncoding,boolean allowAutoRedirect,HttpClientWebRequest request) throws ServiceLocalException, URISyntaxException {
  try {
    request.setUrl(url.toURL());
  }
 catch (  MalformedURLException e) {
    String strErr=String.format("String_Node_Str",url);
    throw new ServiceLocalException(strErr);
  }
  request.setPreAuthenticate(preAuthenticate);
  request.setTimeout(timeout);
  request.setContentType("String_Node_Str");
  request.setAccept("String_Node_Str");
  request.setUserAgent(userAgent);
  request.setAllowAutoRedirect(allowAutoRedirect);
  request.setAcceptGzipEncoding(acceptGzipEncoding);
  request.setHeaders(getHttpHeaders());
  prepareCredentials(request);
  request.prepareConnection();
  httpResponseHeaders.clear();
}
Program: 3912
Project: 3912
Buggy source:
/** 
 * Create registry with configured   {@link ConnectionSocketFactory} instances.Override this method to change how to work with different schemas.
 * @return registry object
 */
protected Registry<ConnectionSocketFactory> createConnectionSocketFactoryRegistry(){
  try {
    return RegistryBuilder.<ConnectionSocketFactory>create().register(EWSConstants.HTTP_SCHEME,new PlainConnectionSocketFactory()).register(EWSConstants.HTTPS_SCHEME,EwsSSLProtocolSocketFactory.build(null)).build();
  }
 catch (  GeneralSecurityException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
/** 
 * Create registry with configured   {@see ConnectionSocketFactory} instances.Override this method to change how to work with different schemas.
 * @return registry object
 */
protected Registry<ConnectionSocketFactory> createConnectionSocketFactoryRegistry(){
  try {
    return RegistryBuilder.<ConnectionSocketFactory>create().register(EWSConstants.HTTP_SCHEME,new PlainConnectionSocketFactory()).register(EWSConstants.HTTPS_SCHEME,EwsSSLProtocolSocketFactory.build(null)).build();
  }
 catch (  GeneralSecurityException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 3913
Project: 3913
Buggy source:
@Override public void close(){
  try {
    httpClient.close();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
@Override public void close(){
  try {
    httpClient.close();
    if (httpPoolingClient != null)     httpPoolingClient.close();
  }
 catch (  IOException e) {
  }
}