RFR: 8242258: (jrtfs) Path::toUri throws AssertionError for malformed input [v2]

Alan Bateman alanb at openjdk.java.net
Tue Dec 8 07:53:15 UTC 2020


On Tue, 8 Dec 2020 02:55:43 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> test/jdk/jdk/internal/jrtfs/Test8242258.java line 60:
>> 
>>> 58:             { "xyz ", "jrt:/xyz%20" },
>>> 59:             { "xy z", "jrt:/xy%20z" },
>>> 60:         };
>> 
>> One other thing we test here is a malformed escape pair, e.g. "jrt:/%5" and check that getPath(URI) throws IAE.
>
> URI.create(String) method itself checks for malformed escape pairs. Do we need anything additional here?

The bug report is Path -> URI but any testing here has to do round-trip (as you have done). My comment about the malformed escaped pair is that we don't seem to have tests for this case, or did I missed it? The example I tased was %5 which isn't a complete pair and will be rejected. In any case, I think what you have is fine for now.

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

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


More information about the core-libs-dev mailing list