RFR: 8272702: Resolving URI relative path with no / may lead to incorrect toString [v2]

Daniel Fuchs dfuchs at openjdk.org
Fri Jun 17 09:55:03 UTC 2022


On Fri, 17 Jun 2022 09:17:53 GMT, KIRIYAMA Takuya <duke at openjdk.org> wrote:

>> src/java.base/share/classes/java/net/URI.java line 2140:
>> 
>>> 2138:             } else {
>>> 2139:                 sb.append("/");
>>> 2140:             }
>> 
>> This is wrong as it will cause  `URI.create("foo").resolve(URI.create("test"))` to return `"/test"` instead of `"test"`
>
> @dfuch 
> Could you review this fix again, please?

I will have a look but analyzing the proposed fix and thinking about the potential side effects will take me some time.

-------------

PR: https://git.openjdk.org/jdk/pull/8899


More information about the net-dev mailing list