code: public static URL codeLocationFromURL(String url) {
          try {
              return new URL(url);
          } catch (Exception e) {
              throw new InvalidCodeLocation(url);
          }
      }
docs: Creates a code location URL from a URL
  
  @param url the URL external form
  @return A URL created from URL
  @throws InvalidCodeLocation if URL creation fails