Program: 30082
Project: 30082
Buggy source:
public synchronized Future<Result<Thread>> createNetworkProxy(NetworkListener listener){
  if (!Boolean.valueOf(listener.getEnabled())) {
    logger.log(Level.INFO,"String_Node_Str",new Object[]{listener.getName(),listener.getPort()});
    return null;
  }
  final boolean ajpListener=ConfigBeansUtilities.toBoolean(listener.getJkEnabled());
  GrizzlyProxy proxy=new GrizzlyProxy(this,listener);
  Future<Result<Thread>> future;
  try {
    proxy.initialize();
    if (!ajpListener && !"String_Node_Str".equals(listener.getProtocol())) {
      final NetworkConfig networkConfig=listener.getParent(NetworkListeners.class).getParent(NetworkConfig.class);
      for (      VirtualServer vs : networkConfig.getParent(Config.class).getHttpService().getVirtualServer()) {
        List<String> vsListeners=StringUtils.parseStringList(vs.getNetworkListeners(),"String_Node_Str");
        if (vsListeners == null || vsListeners.isEmpty() || vsListeners.contains(listener.getName())) {
          if (!hosts.contains(vs.getId())) {
            hosts.add(vs.getId());
          }
        }
      }
      addChangeListener(listener);
      addChangeListener(listener.findThreadPool());
      addChangeListener(listener.findTransport());
      final Protocol protocol=listener.findHttpProtocol();
      if (protocol != null) {
        addChangeListener(protocol);
        addChangeListener(protocol.getHttp());
        addChangeListener(protocol.getHttp().getFileCache());
        addChangeListener(protocol.getSsl());
      }
    }
    if (!ajpListener) {
      future=proxy.start();
    }
 else {
      future=ReadyFutureImpl.create(new Result<Thread>(new Thread(new Runnable(){
        @Override public void run(){
        }
      }
)));
    }
    proxies.add(proxy);
    futures.add(future);
  }
 catch (  IOException e) {
    final FutureImpl<Result<Thread>> errorFuture=UnsafeFutureImpl.<Result<Thread>>create();
    errorFuture.failure(e);
    future=errorFuture;
  }
  return future;
}

Fixed version (ground truth):
public synchronized Future<Result<Thread>> createNetworkProxy(NetworkListener listener){
  if (!Boolean.valueOf(listener.getEnabled())) {
    logger.log(Level.INFO,"String_Node_Str",new Object[]{listener.getName(),listener.getPort()});
    return null;
  }
  final boolean ajpListener=ConfigBeansUtilities.toBoolean(listener.getJkEnabled());
  GrizzlyProxy proxy=new GrizzlyProxy(this,listener);
  Future<Result<Thread>> future=null;
  try {
    proxy.initialize();
    if (!ajpListener && !"String_Node_Str".equals(listener.getProtocol())) {
      final NetworkConfig networkConfig=listener.getParent(NetworkListeners.class).getParent(NetworkConfig.class);
      for (      VirtualServer vs : networkConfig.getParent(Config.class).getHttpService().getVirtualServer()) {
        List<String> vsListeners=StringUtils.parseStringList(vs.getNetworkListeners(),"String_Node_Str");
        if (vsListeners == null || vsListeners.isEmpty() || vsListeners.contains(listener.getName())) {
          if (!hosts.contains(vs.getId())) {
            hosts.add(vs.getId());
          }
        }
      }
      addChangeListener(listener);
      addChangeListener(listener.findThreadPool());
      addChangeListener(listener.findTransport());
      final Protocol protocol=listener.findHttpProtocol();
      if (protocol != null) {
        addChangeListener(protocol);
        addChangeListener(protocol.getHttp());
        addChangeListener(protocol.getHttp().getFileCache());
        addChangeListener(protocol.getSsl());
      }
    }
    if (!ajpListener) {
      future=proxy.start();
    }
 else {
      future=ReadyFutureImpl.create(new Result<Thread>(new Thread(new Runnable(){
        @Override public void run(){
        }
      }
)));
    }
    proxies.add(proxy);
  }
 catch (  Throwable e) {
    final FutureImpl<Result<Thread>> errorFuture=UnsafeFutureImpl.<Result<Thread>>create();
    errorFuture.result(new Result<Thread>(e));
    future=errorFuture;
  }
 finally {
    if (future == null) {
      final FutureImpl<Result<Thread>> errorFuture=UnsafeFutureImpl.<Result<Thread>>create();
      errorFuture.result(new Result<Thread>(new IllegalStateException("String_Node_Str")));
      future=errorFuture;
    }
    futures.add(future);
  }
  return future;
}