mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8297687: new URI(S,S,S,S) throws exception with incorrect index position reported in the error message
Reviewed-by: jpai
This commit is contained in:
parent
2243646fe3
commit
b0e54328c5
2 changed files with 51 additions and 3 deletions
|
@ -3239,6 +3239,7 @@ public final class URI
|
|||
{
|
||||
int p = start;
|
||||
int q = p;
|
||||
int qreg = p;
|
||||
URISyntaxException ex = null;
|
||||
|
||||
boolean serverChars;
|
||||
|
@ -3250,7 +3251,7 @@ public final class URI
|
|||
} else {
|
||||
serverChars = (scan(p, n, L_SERVER, H_SERVER) == n);
|
||||
}
|
||||
regChars = (scan(p, n, L_REG_NAME, H_REG_NAME) == n);
|
||||
regChars = ((qreg = scan(p, n, L_REG_NAME, H_REG_NAME)) == n);
|
||||
|
||||
if (regChars && !serverChars) {
|
||||
// Must be a registry-based authority
|
||||
|
@ -3294,7 +3295,7 @@ public final class URI
|
|||
// a malformed IPv6 address
|
||||
throw ex;
|
||||
} else {
|
||||
fail("Illegal character in authority", q);
|
||||
fail("Illegal character in authority", serverChars ? q : qreg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue