code: @Sensitive
      protected String restoreHostNameToURL(@Sensitive String referrerURL, String url) {
          if ((referrerURL.startsWith("/")) || (referrerURL.length() == 0)) {
              int doubleSlash = url.indexOf("//");
              int firstSingleSlash = url.indexOf("/", doubleSlash + 2);
              referrerURL = url.substring(0, firstSingleSlash) + referrerURL;
          } else {
              try {
                  URL referrer = new URL(referrerURL);
                  String referrerHost = referrer.getHost();
                  if ((referrerHost == null) || (referrerHost.length() == 0)) {
                      URL currentURL = new URL(url);
                      String currentHost = currentURL.getHost();
                      int doubleSlash = referrerURL.indexOf("//");
                      StringBuffer newURLBuf = new StringBuffer(referrerURL);
                      newURLBuf.insert(doubleSlash + 2, currentHost);
                      referrerURL = newURLBuf.toString();
                  }
              } catch (java.net.MalformedURLException e) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "restoreHostNameToURL", new Object[] { e });
                  }
              }
          }
          return referrerURL;
      }
docs: Updates the referrerURL with the host for the current request
  if one is missing. If referrerURL is relative or an empty String,
  use the host for the current request and append the referrerURL.
  Otherwise, inject into the referrer URL String the host for the
  current request.
  
  Note, this method does not handle the following scenarios:
  - either storeReq or URLString is null (could they ever be?)
  - URLString being incomplete, e.g. http://myhost.com (missing first /)
  
  @param referrerURL A valid URL string, potentially without host name, from the referrer URL cookie
  @param url A valid, fully qualified URL representing the current request
  @return