docs: @Pure
  	public static URL makeCanonicalURL(URL url) {
  		if (url != null) {
  			final String[] pathComponents = url.getPath().split(Pattern.quote(URL_PATH_SEPARATOR));
  
  			final List<String> canonicalPath = new LinkedList<>();
  			for (final String component : pathComponents) {
  				if (!CURRENT_DIRECTORY.equals(component)) {
  					if (PARENT_DIRECTORY.equals(component)) {
  						if (!canonicalPath.isEmpty()) {
  							canonicalPath.remove(canonicalPath.size() - 1);
  						} else {
  							canonicalPath.add(component);
  						}
  					} else {
  						canonicalPath.add(component);
  					}
  				}
  			}
  
  			final StringBuilder newPathBuffer = new StringBuilder();
  			boolean isFirst = true;
  			for (final String component : canonicalPath) {
  				if (!isFirst) {
  					newPathBuffer.append(URL_PATH_SEPARATOR_CHAR);
  				} else {
  					isFirst = false;
  				}
  				newPathBuffer.append(component);
  			}
  
  			try {
  				return new URI(
  						url.getProtocol(),
  						url.getUserInfo(),
  						url.getHost(),
  						url.getPort(),
  						newPathBuffer.toString(),
  						url.getQuery(),
  						url.getRef()).toURL();
  			} catch (MalformedURLException | URISyntaxException exception) {
  				//
  			}
  
  			try {
  				return new URL(
  						url.getProtocol(),
  						url.getHost(),
  						newPathBuffer.toString());
  			} catch (Throwable exception) {
  				//
  			}
  		}
  		return url;
  	}