Just a quick one off the back of what was added earlier today.
Looks like the current implementation will allow itself to be initialised with any form of protocol. Right now, I can see that initialising a URL with a protocol of "some-crazy-random-scheme" gets assigned to the Handler class in this module, rather than it throwing an Exception about it.
I've added some additional checks to try and help avoid this, especially since this can occur implicitly if using the Java 9 SPI for the URL handler factory.
Upon performing these checks, the behaviour changes to the expected outcome:
java.net.MalformedURLException: unknown protocol: some-crazy-random-scheme
at java.base/java.net.URL.<init>(URL.java:682)
at java.base/java.net.URL.fromURI(URL.java:749)
at java.base/java.net.URI.toURL(URI.java:1136)
... 58 more
Just a quick one off the back of what was added earlier today.
Looks like the current implementation will allow itself to be initialised with any form of protocol. Right now, I can see that initialising a URL with a protocol of "some-crazy-random-scheme" gets assigned to the
Handler
class in this module, rather than it throwing an Exception about it.I've added some additional checks to try and help avoid this, especially since this can occur implicitly if using the Java 9 SPI for the URL handler factory.
Upon performing these checks, the behaviour changes to the expected outcome: