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

Alan Bateman alanb at openjdk.java.net
Mon Dec 7 20:05:17 UTC 2020


On Mon, 7 Dec 2020 16:35:52 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

> Safe URI encode logic adopted from UnixUriUtils.

test/jdk/jdk/internal/jrtfs/Test8242258.java line 40:

> 38: import static org.testng.Assert.assertEquals;
> 39: 
> 40: public class Test8242258 {

I think it would be better to create something like UriTests that we can add further tests for jrtfs URIs as they arise.

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.

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

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


More information about the core-libs-dev mailing list