8288207: Enhance MalformedURLException in Uri.parseCompat

Reviewed-by: dfuchs, alanb
This commit is contained in:
Matthias Baesken 2022-06-15 06:53:12 +00:00
parent 444a0d98ac
commit 33f34d540e

View File

@ -364,7 +364,8 @@ public class Uri {
+ (port == -1?"":(":" + port)); + (port == -1?"":(":" + port));
if (!auth.equals(hostport)) { if (!auth.equals(hostport)) {
// throw if we have user info or regname // throw if we have user info or regname
throw new MalformedURLException("unsupported authority: " + auth); throw new MalformedURLException("Authority component is not server-based, " +
"or contains user info. Unsupported authority: " + auth);
} }
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
var mue = new MalformedURLException(e.getMessage()); var mue = new MalformedURLException(e.getMessage());