code: public static void isReferrerHostValid(final String currentReqURL, final String storedReq, final List<String> domainList) throws RuntimeException {
          Boolean isValid = false;
          isValid = java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<Boolean>() {
              @Override
              public Boolean run() {
                  Boolean _isValid = false;
                  URL referrerURL = null;
                  URL currentURL = null;
                  try {
                      referrerURL = new URL(storedReq);
                      currentURL = new URL(currentReqURL);
                      if (referrerURL != null && currentURL != null) {
                          String referrerHost = referrerURL.getHost();
                          String currentReqHost = currentURL.getHost();
                          if (referrerHost != null && currentReqHost != null
                              && (referrerHost.equalsIgnoreCase(currentReqHost) || isReferrerHostMatchDomainNameList(referrerHost, domainList))) {
                              _isValid = true;
                          }
                      }
                  } catch (MalformedURLException me) {
  
                      //if referrerURL==null then storedReq is not a valid URL. Otherwise, currentURL is invalid
                      if (referrerURL == null) {
                          if (tc.isDebugEnabled()) {
                              Tr.debug(tc, "WASReqURL:" + storedReq + " is a MalformedURL.");
                          }
                          RuntimeException e = new RuntimeException("WASReqURL:" + "'" + storedReq + "'" + " is not a valid URL.", me);
                          throw e;
                      } else {
                          if (tc.isDebugEnabled()) {
                              Tr.debug(tc, "currentURL:" + currentReqURL + " is a MalformedURL.");
                          }
                          RuntimeException e = new RuntimeException("The request URL:" + "'" + currentReqURL + "'"
                                                                    + " is not a valid URL.", me);
                          throw e;
                      }
                  }
                  return _isValid;
              }
          });
          if (!isValid) {
              RuntimeException e = new RuntimeException("WASReqURL:" + "'" + storedReq + "'"
                                                        + " hostname does not match current request hostname: " + "'" + currentReqURL
                                                        + "'");
              throw e;
          }
          return;
      }
docs: /*
  Goals:
  1: MalformedException: indicate which URL failed in the exception text.
  2: RuntimeException: If this was a MalformedException, RuntimeException should include the MalformedException.