Program: 8120
Project: 8120
Buggy source:
/** 
 * Configures the service.
 * @param args from command line based for configuring service
 * @param conf Configuration instance passed around.
 * @return Pair of args for registering the service and the port service is running on.
 */
@Override protected RegisteredServerInfo configure(String[] args,CConfiguration conf){
  try {
    InetAddress serverAddress=getServerInetAddress(conf.get(Constants.CFG_METADATA_SERVER_ADDRESS));
    int serverPort=conf.getInt(Constants.CFG_METADATA_SERVER_PORT,Constants.DEFAULT_METADATA_SERVER_PORT);
    int threads=conf.getInt(Constants.CFG_METADATA_SERVER_THREADS,Constants.DEFAULT_METADATA_SERVER_THREADS);
    MetadataServiceImpl serviceImpl=new MetadataServiceImpl(opex);
    THsHaServer.Args serverArgs=new THsHaServer.Args(new TNonblockingServerSocket(new InetSocketAddress(serverAddress,serverPort))).executorService(executorService).processor(new MetadataService.Processor(serviceImpl)).workerThreads(threads);
    serverArgs.maxReadBufferBytes=getMaxReadBuffer(conf);
    server=new THsHaServer(serverArgs);
    setServerName(Constants.SERVICE_METADATA_SERVER);
    RegisteredServerInfo info=new RegisteredServerInfo(serverAddress.getHostName(),serverPort);
    info.addPayload("String_Node_Str",Integer.toString(threads));
    Log.info("String_Node_Str",serverAddress.getHostAddress(),serverPort);
    return info;
  }
 catch (  UnknownHostException e) {
    Log.error("String_Node_Str",e.getMessage());
    stop();
  }
catch (  TTransportException e) {
    Log.error("String_Node_Str",e.getMessage());
    stop();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Configures the service.
 * @param args from command line based for configuring service
 * @param conf Configuration instance passed around.
 * @return Pair of args for registering the service and the port service is running on.
 */
@Override protected RegisteredServerInfo configure(String[] args,CConfiguration conf){
  try {
    InetAddress serverAddress=getServerInetAddress(conf.get(Constants.CFG_METADATA_SERVER_ADDRESS));
    int serverPort=conf.getInt(Constants.CFG_METADATA_SERVER_PORT,Constants.DEFAULT_METADATA_SERVER_PORT);
    int threads=conf.getInt(Constants.CFG_METADATA_SERVER_THREADS,Constants.DEFAULT_METADATA_SERVER_THREADS);
    MetadataService service=new MetadataService(opex);
    THsHaServer.Args serverArgs=new THsHaServer.Args(new TNonblockingServerSocket(new InetSocketAddress(serverAddress,serverPort))).executorService(executorService).processor(new com.continuuity.metadata.stubs.MetadataService.Processor(service)).workerThreads(threads);
    serverArgs.maxReadBufferBytes=getMaxReadBuffer(conf);
    server=new THsHaServer(serverArgs);
    setServerName(Constants.SERVICE_METADATA_SERVER);
    RegisteredServerInfo info=new RegisteredServerInfo(serverAddress.getHostName(),serverPort);
    info.addPayload("String_Node_Str",Integer.toString(threads));
    Log.info("String_Node_Str",serverAddress.getHostAddress(),serverPort);
    return info;
  }
 catch (  UnknownHostException e) {
    Log.error("String_Node_Str",e.getMessage());
    stop();
  }
catch (  TTransportException e) {
    Log.error("String_Node_Str",e.getMessage());
    stop();
  }
  return null;
}