4880778: URL final class has protected methods
authorjzavgren
Tue, 05 Mar 2013 09:50:53 -0500
changeset 16055 311a101eb72c
parent 16054 a7cdb40ea8e8
child 16056 2d02a05cd526
4880778: URL final class has protected methods Summary: The two set() methods have been defined to be package private. Reviewed-by: alanb, chegar, khazra
jdk/src/share/classes/java/net/URL.java
jdk/src/share/classes/java/net/URLStreamHandler.java
--- a/jdk/src/share/classes/java/net/URL.java	Tue Mar 05 14:30:18 2013 +0000
+++ b/jdk/src/share/classes/java/net/URL.java	Tue Mar 05 09:50:53 2013 -0500
@@ -661,8 +661,8 @@
      * @param file the file on the host
      * @param ref the internal reference in the URL
      */
-    protected void set(String protocol, String host,
-                       int port, String file, String ref) {
+    void set(String protocol, String host, int port,
+             String file, String ref) {
         synchronized (this) {
             this.protocol = protocol;
             this.host = host;
@@ -698,9 +698,9 @@
      * @param query the query part of this URL
      * @since 1.3
      */
-    protected void set(String protocol, String host, int port,
-                       String authority, String userInfo, String path,
-                       String query, String ref) {
+    void set(String protocol, String host, int port,
+             String authority, String userInfo, String path,
+             String query, String ref) {
         synchronized (this) {
             this.protocol = protocol;
             this.host = host;
--- a/jdk/src/share/classes/java/net/URLStreamHandler.java	Tue Mar 05 14:30:18 2013 +0000
+++ b/jdk/src/share/classes/java/net/URLStreamHandler.java	Tue Mar 05 09:50:53 2013 -0500
@@ -509,8 +509,8 @@
 
     /**
      * Sets the fields of the <code>URL</code> argument to the indicated values.
-     * Only classes derived from URLStreamHandler are supposed to be able
-     * to call the set method on a URL.
+     * Only classes derived from URLStreamHandler are able
+     * to use this method to set the values of the URL fields.
      *
      * @param   u         the URL to modify.
      * @param   protocol  the protocol name.
@@ -539,8 +539,8 @@
 
     /**
      * Sets the fields of the <code>URL</code> argument to the indicated values.
-     * Only classes derived from URLStreamHandler are supposed to be able
-     * to call the set method on a URL.
+     * Only classes derived from URLStreamHandler are able
+     * to use this method to set the values of the URL fields.
      *
      * @param   u         the URL to modify.
      * @param   protocol  the protocol name. This value is ignored since 1.2.