changeset 7941:be79440b8026

4880778: URL final class has protected methods Summary: The two set() methods have been defined to be package private. Reviewed-by: alanb, chegar, khazra
author jzavgren
date Tue, 05 Mar 2013 09:50:53 -0500
parents b5bef1f71de6
children f960a34f05ce
files src/share/classes/java/net/URL.java src/share/classes/java/net/URLStreamHandler.java
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/net/URL.java	Tue Mar 05 14:30:18 2013 +0000
+++ b/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/src/share/classes/java/net/URLStreamHandler.java	Tue Mar 05 14:30:18 2013 +0000
+++ b/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.