On Thu, 14 Apr 2022 06:56:24 GMT, KIRIYAMA Takuya <d...@openjdk.java.net> wrote:
> I think we should accept any codes like "%25%s%G1" according to URL standard. > > Is there a reason why an exception should be thrown? Yes. It is not a valid escape sequence according to the spec. jshell> URI.create("ftp://host:5678/%25%s%G1"); | Exception java.lang.IllegalArgumentException: Malformed escape pair at index 19: ftp://host:5678/%25%s%G1 | at URI.create (URI.java:906) | at (#1:1) | Caused by: java.net.URISyntaxException: Malformed escape pair at index 19: ftp://host:5678/%25%s%G1 | at URI$Parser.fail (URI.java:2973) | at URI$Parser.scanEscape (URI.java:3101) | at URI$Parser.scan (URI.java:3124) | at URI$Parser.checkChars (URI.java:3142) | at URI$Parser.parseHierarchical (URI.java:3226) | at URI$Parser.parse (URI.java:3174) | at URI.<init> (URI.java:623) | at URI.create (URI.java:904) | ... ------------- PR: https://git.openjdk.java.net/jdk/pull/8155