-
Bug
-
Resolution: Fixed
-
P4
-
5.0, 6, 7, 8, 9
-
b48
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084436 | emb-9 | Konstantin Shefov | P4 | Resolved | Fixed | team |
JDK-8132019 | 8-pool | Robert Mckenna | P4 | Closed | Won't Fix |
SYNOPSIS
URISyntaxException thrown when non alpha-numeric characters are used in the scope_id field along with the IPv6 literal
OPERATING SYSTEM(S)
All Platforms. The problem is platform independent.
FULL JDK VERSION(S)
Sun Java 5 and Sun Java 6 (All releases)
PROBLEM DESCRIPTION
Stack Trace:-
java.net.URISyntaxException: Illegal character in scope id at index 37: http://[fe80::c00:16fe:cebe:3214%eth1.12]:10/
at java.net.URI$Parser.fail(URI.java:2821)
at java.net.URI$Parser.checkChars(URI.java:2994)
at java.net.URI$Parser.parseServer(URI.java:3196)
at java.net.URI$Parser.parseAuthority(URI.java:3128)
at java.net.URI$Parser.parseHierarchical(URI.java:3070)
at java.net.URI$Parser.parse(URI.java:3026)
at java.net.URI.<init>(URI.java:675)
at URIsyntaxexception.main(URIsyntaxexception.java:8)
Expected behaviour:- No exception should be thrown
Observed behaviour:- URISyntaxException is thrown
Links to relevant specification/documentation
1. http://java.sun.com/javase/6/docs/api/java/net/URI.html
2. http://java.sun.com/javase/6/docs/api/java/net/Inet6Address.html#scoped
3. http://www.ietf.org/rfc/rfc2373.txt
4. http://www.ietf.org/rfc/rfc2732.txt
5. http://www.ietf.org/rfc/rfc2396.txt
New problem or regression
Existing problem with URI for all Java releases
TESTCASE
import java.net.*;
public class URIsyntaxexception {
public static void main(String[] arg) {
try {
new URI("http", null, "fe80::c00:16fe:cebe:3214%eth1.12", 10, "/", null, null);
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
REPRODUCTION INSTRUCTIONS
Compile and execute the above testcase to see the exception thrown
If the scope_id does not contain any non-alphanumeric characters the testcase runs fine. There are no issues.
SUGGESTED FIX
None
OTHER INFORMATION
The same scope_id with IPv6 literal to URL works just fine.
import java.net.*;
public class URLScopeID {
public static void main(String[] arg) {
try {
new URL("http", "fe80::c00:16fe:cebe:3214%eth1.12", 10, "RandomFile.txt" );
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
URISyntaxException thrown when non alpha-numeric characters are used in the scope_id field along with the IPv6 literal
OPERATING SYSTEM(S)
All Platforms. The problem is platform independent.
FULL JDK VERSION(S)
Sun Java 5 and Sun Java 6 (All releases)
PROBLEM DESCRIPTION
Stack Trace:-
java.net.URISyntaxException: Illegal character in scope id at index 37: http://[fe80::c00:16fe:cebe:3214%eth1.12]:10/
at java.net.URI$Parser.fail(URI.java:2821)
at java.net.URI$Parser.checkChars(URI.java:2994)
at java.net.URI$Parser.parseServer(URI.java:3196)
at java.net.URI$Parser.parseAuthority(URI.java:3128)
at java.net.URI$Parser.parseHierarchical(URI.java:3070)
at java.net.URI$Parser.parse(URI.java:3026)
at java.net.URI.<init>(URI.java:675)
at URIsyntaxexception.main(URIsyntaxexception.java:8)
Expected behaviour:- No exception should be thrown
Observed behaviour:- URISyntaxException is thrown
Links to relevant specification/documentation
1. http://java.sun.com/javase/6/docs/api/java/net/URI.html
2. http://java.sun.com/javase/6/docs/api/java/net/Inet6Address.html#scoped
3. http://www.ietf.org/rfc/rfc2373.txt
4. http://www.ietf.org/rfc/rfc2732.txt
5. http://www.ietf.org/rfc/rfc2396.txt
New problem or regression
Existing problem with URI for all Java releases
TESTCASE
import java.net.*;
public class URIsyntaxexception {
public static void main(String[] arg) {
try {
new URI("http", null, "fe80::c00:16fe:cebe:3214%eth1.12", 10, "/", null, null);
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
REPRODUCTION INSTRUCTIONS
Compile and execute the above testcase to see the exception thrown
If the scope_id does not contain any non-alphanumeric characters the testcase runs fine. There are no issues.
SUGGESTED FIX
None
OTHER INFORMATION
The same scope_id with IPv6 literal to URL works just fine.
import java.net.*;
public class URLScopeID {
public static void main(String[] arg) {
try {
new URL("http", "fe80::c00:16fe:cebe:3214%eth1.12", 10, "RandomFile.txt" );
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
- backported by
-
JDK-8084436 URISyntaxException when non-alphanumeric characters are present in scope_id
-
- Resolved
-
-
JDK-8132019 URISyntaxException when non-alphanumeric characters are present in scope_id
-
- Closed
-
- relates to
-
JDK-8071458 URI handling of IPv6 scopes needs to be re-examined.
-
- Open
-
-
JDK-8067436 URI (multiparam) constructor throws URISyntaxException when path contains []
-
- Closed
-