diff -r d382dacfd73f -r 751852f49324 rt/emul/mini/src/main/java/java/net/URL.java
--- a/rt/emul/mini/src/main/java/java/net/URL.java Tue Feb 26 16:54:16 2013 +0100
+++ b/rt/emul/mini/src/main/java/java/net/URL.java Sat Sep 28 02:11:01 2013 +0200
@@ -920,6 +920,23 @@
}
/**
+ * Returns a {@link java.net.URI} equivalent to this URL.
+ * This method functions in the same way as new URI (this.toString())
.
+ *
Note, any URL instance that complies with RFC 2396 can be converted + * to a URI. However, some URLs that are not strictly in compliance + * can not be converted to a URI. + * + * @exception URISyntaxException if this URL is not formatted strictly according to + * to RFC2396 and cannot be converted to a URI. + * + * @return a URI instance equivalent to this URL. + * @since 1.5 + */ + public URI toURI() throws URISyntaxException { + return new URI (toString()); + } + + /** * Returns a {@link java.net.URLConnection URLConnection} instance that * represents a connection to the remote object referred to by the * {@code URL}.