A hierarchical URI is subject to further parsing according to the syntax
[scheme:][//authority][path][?query][#fragment]
then path can be null- which is not possible according to RFC
if it can be null
then
http://sun.com?sid=130885#name
is a valid URI and shoud parse
but is is throwing exception
java.net.URISyntaxException: Illegal character in authority at index 7: http://sun.com?sid=130885#name
at java.net.URI$Parser.fail(URI.java:2168)
at java.net.URI$Parser.parseAuthority(URI.java:2494)
at java.net.URI$Parser.parseHierarchical(URI.java:2414)
at java.net.URI$Parser.parse(URI.java:2371)
at java.net.URI.<init>(URI.java:413)
at TestURI.testCons(TestURI.java:60)
at TestURI.main(TestURI.java:36)
[scheme:][//authority][path][?query][#fragment]
then path can be null- which is not possible according to RFC
if it can be null
then
http://sun.com?sid=130885#name
is a valid URI and shoud parse
but is is throwing exception
java.net.URISyntaxException: Illegal character in authority at index 7: http://sun.com?sid=130885#name
at java.net.URI$Parser.fail(URI.java:2168)
at java.net.URI$Parser.parseAuthority(URI.java:2494)
at java.net.URI$Parser.parseHierarchical(URI.java:2414)
at java.net.URI$Parser.parse(URI.java:2371)
at java.net.URI.<init>(URI.java:413)
at TestURI.testCons(TestURI.java:60)
at TestURI.main(TestURI.java:36)
- duplicates
-
JDK-4496719 java.net.URI: improper parse of "scheme://user@host?q"
-
- Closed
-