code: private URL setURL(URL url) throws RepositoryIllegalArgumentException {
          int port = url.getPort();
          if (port == -1) {
              throw new RepositoryIllegalArgumentException("Bad proxy URL", new IllegalArgumentException("Proxy URL does not contain a port"));
          }
          String host = url.getHost();
          if (host.equals("")) {
              throw new RepositoryIllegalArgumentException("Bad proxy URL", new IllegalArgumentException("Proxy URL does not contain a host"));
          }
          return url;
      }
docs: Rather than setting the port directly, verify that the proxy URL did contain a port
  and throw an exception if it did not. This avoids problems later.
  
  @param url
  @return