# HG changeset patch # User jzavgren # Date 1362495053 18000 # Node ID 311a101eb72ca3b070c0e3215b3cd9a9182f0a22 # Parent a7cdb40ea8e8767926fd617bc055d730f9c21c3d 4880778: URL final class has protected methods Summary: The two set() methods have been defined to be package private. Reviewed-by: alanb, chegar, khazra diff -r a7cdb40ea8e8 -r 311a101eb72c jdk/src/share/classes/java/net/URL.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; diff -r a7cdb40ea8e8 -r 311a101eb72c jdk/src/share/classes/java/net/URLStreamHandler.java --- 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 URL 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 URL 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.