Program: 85164
Project: 85164
Buggy source:
private void collect(Invoker<?> invoker,Invocation invocation,RpcContext context,long start,boolean error){
  long elapsed=System.currentTimeMillis() - start;
  int concurrent=getConcurrent(invoker,invocation).get();
  String application=invoker.getUrl().getParameter(Constants.APPLICATION_KEY);
  String service=invoker.getInterface().getName();
  String method=invocation.getMethodName();
  URL url=URL.valueOf(invoker.getUrl().getParameterAndDecoded(Constants.MONITOR_KEY));
  Monitor monitor=monitorFactory.getMonitor(url);
  String server=context.getLocalAddressString();
  if (invoker.getUrl().getAddress().equals(server)) {
    monitor.count(new URL(invoker.getUrl().getProtocol(),NetUtils.getLocalHost(),context.getLocalPort()).addParameters(MonitorService.APPLICATION,application,MonitorService.INTERFACE,service,MonitorService.METHOD,method,MonitorService.CLIENT,context.getRemoteHost(),error ? MonitorService.FAILURE : MonitorService.SUCCESS,String.valueOf(1),MonitorService.ELAPSED,String.valueOf(elapsed),MonitorService.CONCURRENT,String.valueOf(concurrent)));
  }
  context=RpcContext.getContext();
  server=context.getRemoteAddressString();
  if (invoker.getUrl().getAddress().equals(server)) {
    monitor.count(new URL(invoker.getUrl().getProtocol(),NetUtils.getLocalHost(),0).addParameters(MonitorService.APPLICATION,application,MonitorService.INTERFACE,service,MonitorService.METHOD,method,MonitorService.SERVER,server,error ? MonitorService.FAILURE : MonitorService.SUCCESS,String.valueOf(1),MonitorService.ELAPSED,String.valueOf(elapsed),MonitorService.CONCURRENT,String.valueOf(concurrent)));
  }
}

Fixed version (ground truth):
private void collect(Invoker<?> invoker,Invocation invocation,RpcContext context,long start,boolean error){
  try {
    long elapsed=System.currentTimeMillis() - start;
    int concurrent=getConcurrent(invoker,invocation).get();
    String application=invoker.getUrl().getParameter(Constants.APPLICATION_KEY);
    String service=invoker.getInterface().getName();
    String method=invocation.getMethodName();
    URL url=URL.valueOf(invoker.getUrl().getParameterAndDecoded(Constants.MONITOR_KEY));
    Monitor monitor=monitorFactory.getMonitor(url);
    String server=context.getLocalAddressString();
    if (invoker.getUrl().getAddress().equals(server)) {
      monitor.count(new URL(invoker.getUrl().getProtocol(),NetUtils.getLocalHost(),context.getLocalPort()).addParameters(MonitorService.APPLICATION,application,MonitorService.INTERFACE,service,MonitorService.METHOD,method,MonitorService.CLIENT,context.getRemoteHost(),error ? MonitorService.FAILURE : MonitorService.SUCCESS,String.valueOf(1),MonitorService.ELAPSED,String.valueOf(elapsed),MonitorService.CONCURRENT,String.valueOf(concurrent)));
    }
    context=RpcContext.getContext();
    server=context.getRemoteAddressString();
    if (invoker.getUrl().getAddress().equals(server)) {
      monitor.count(new URL(invoker.getUrl().getProtocol(),NetUtils.getLocalHost(),0).addParameters(MonitorService.APPLICATION,application,MonitorService.INTERFACE,service,MonitorService.METHOD,method,MonitorService.SERVER,server,error ? MonitorService.FAILURE : MonitorService.SUCCESS,String.valueOf(1),MonitorService.ELAPSED,String.valueOf(elapsed),MonitorService.CONCURRENT,String.valueOf(concurrent)));
    }
  }
 catch (  Throwable t) {
    logger.error("String_Node_Str" + invoker.getUrl() + "String_Node_Str"+ t.getMessage(),t);
  }
}