RFR: 8273961: [testbug] jdk/nio/zipfs/ZipFSTester.java fails if the path has plus character

Lance Andersen lancea at openjdk.java.net
Mon Sep 20 10:13:02 UTC 2021


On Sat, 18 Sep 2021 09:57:12 GMT, Remilia Scarlet <github.com+22913521+1996scarlet at openjdk.org> wrote:

> Add the pre-processing to replace "+" by "%2b" which avoids `URLDecoder.decoder` changing the path unexpectedly.
> 
> Please review this change. Thanks!

test/jdk/jdk/nio/zipfs/ZipFSTester.java line 689:

> 687:         throws Exception
> 688:     {
> 689:         var plusReplacedUri = path.toUri().toString().replace("+", "%2b");

Thank you for your proposed patch.

The path described in the bug  is a bit unusual and not something we typically expect (or have seen).

Please add a comment describing the purpose(maybe include a trivial example) of this change to make it more readily apparent to future maintainers.

Not sure I am enamored with the name of the variable `plusReplacedUri`.  Perhaps consider an alternative name.

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

PR: https://git.openjdk.java.net/jdk/pull/5574


More information about the nio-dev mailing list