try { result = new URL(new URL(baseURL), uri); } catch (MalformedURLException e1) { XRLog.exception("The default NaiveUserAgent cannot resolve the URL " + uri + " with base URL " + baseURL); return null; } return result.toString();
return ret;
    public String resolveURI(String uri) {        URL result;        if (baseURL == null) {            try {                result = new URL(uri);                setBaseURL(result.toExternalForm());                return result.toExternalForm();            } catch (MalformedURLException e) {                try {                    setBaseURL(new File(".").toURI().toURL().toExternalForm());                } catch (MalformedURLException e1) {                    XRLog.exception("The default NaiveUserAgent doesn't know how to resolve the base URL for " + uri);                    return null;                }            }        }        try {            result = new URL(new URL(baseURL), uri);        } catch (MalformedURLException e1) {            XRLog.exception("The default NaiveUserAgent cannot resolve the URL " + uri + " with base URL " + baseURL);            return null;        }        return result.toString();    }