提交 db20276b 编写于 作者: J jzavgren

4880778: URL final class has protected methods

Summary: The two set() methods have been defined to be package private.
Reviewed-by: alanb, chegar, khazra
上级 14f7c5d6
...@@ -661,8 +661,8 @@ public final class URL implements java.io.Serializable { ...@@ -661,8 +661,8 @@ public final class URL implements java.io.Serializable {
* @param file the file on the host * @param file the file on the host
* @param ref the internal reference in the URL * @param ref the internal reference in the URL
*/ */
protected void set(String protocol, String host, void set(String protocol, String host, int port,
int port, String file, String ref) { String file, String ref) {
synchronized (this) { synchronized (this) {
this.protocol = protocol; this.protocol = protocol;
this.host = host; this.host = host;
...@@ -698,9 +698,9 @@ public final class URL implements java.io.Serializable { ...@@ -698,9 +698,9 @@ public final class URL implements java.io.Serializable {
* @param query the query part of this URL * @param query the query part of this URL
* @since 1.3 * @since 1.3
*/ */
protected void set(String protocol, String host, int port, void set(String protocol, String host, int port,
String authority, String userInfo, String path, String authority, String userInfo, String path,
String query, String ref) { String query, String ref) {
synchronized (this) { synchronized (this) {
this.protocol = protocol; this.protocol = protocol;
this.host = host; this.host = host;
......
...@@ -509,8 +509,8 @@ public abstract class URLStreamHandler { ...@@ -509,8 +509,8 @@ public abstract class URLStreamHandler {
/** /**
* Sets the fields of the <code>URL</code> argument to the indicated values. * Sets the fields of the <code>URL</code> argument to the indicated values.
* Only classes derived from URLStreamHandler are supposed to be able * Only classes derived from URLStreamHandler are able
* to call the set method on a URL. * to use this method to set the values of the URL fields.
* *
* @param u the URL to modify. * @param u the URL to modify.
* @param protocol the protocol name. * @param protocol the protocol name.
...@@ -539,8 +539,8 @@ public abstract class URLStreamHandler { ...@@ -539,8 +539,8 @@ public abstract class URLStreamHandler {
/** /**
* Sets the fields of the <code>URL</code> argument to the indicated values. * Sets the fields of the <code>URL</code> argument to the indicated values.
* Only classes derived from URLStreamHandler are supposed to be able * Only classes derived from URLStreamHandler are able
* to call the set method on a URL. * to use this method to set the values of the URL fields.
* *
* @param u the URL to modify. * @param u the URL to modify.
* @param protocol the protocol name. This value is ignored since 1.2. * @param protocol the protocol name. This value is ignored since 1.2.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册