private Proxy nextProxy(){
  if (userSpecifiedProxy != null) {
    hasNextProxy=false;
    return userSpecifiedProxy;
  }
  if (proxySelectorProxies != null) {
    while (proxySelectorProxies.hasNext()) {
      Proxy candidate=proxySelectorProxies.next();
      if (candidate.type() != Proxy.Type.DIRECT) {
        return candidate;
      }
    }
  }
  hasNextProxy=false;
  return Proxy.NO_PROXY;
}

private Proxy nextProxy ( ) { if ( userSpecifiedProxy != null ) { hasNextProxy = false ; return userSpecifiedProxy ; } if ( proxySelectorProxies != null ) { while ( proxySelectorProxies . hasNext ( ) ) { Proxy candidate = proxySelectorProxies . next ( ) ; if ( candidate . type ( ) != Proxy . Type . DIRECT ) { return candidate ; } } } hasNextProxy = false ; return Proxy . NO_PROXY ; }
returns the next proxy to try . may be proxy . no_proxy but never null .
