Skip to content

Commit

Permalink
8255477: Remove unused method URL.set(String protocol, String host, i…
Browse files Browse the repository at this point in the history
…nt port, String file, String ref)

Reviewed-by: dfuchs
  • Loading branch information
stsypanov authored and dfuch committed Dec 14, 2020
1 parent e69ae07 commit 1548104
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/java.base/share/classes/java/net/URL.java
Expand Up @@ -774,39 +774,6 @@ private void checkSpecifyHandler(SecurityManager sm) {
sm.checkPermission(SecurityConstants.SPECIFY_HANDLER_PERMISSION);
}

/**
* Sets the fields of the URL. This is not a public method so that
* only URLStreamHandlers can modify URL fields. URLs are
* otherwise constant.
*
* @param protocol the name of the protocol to use
* @param host the name of the host
* @param port the port number on the host
* @param file the file on the host
* @param ref the internal reference in the URL
*/
void set(String protocol, String host, int port,
String file, String ref) {
synchronized (this) {
this.protocol = protocol;
this.host = host;
authority = port == -1 ? host : host + ":" + port;
this.port = port;
this.file = file;
this.ref = ref;
/* This is very important. We must recompute this after the
* URL has been changed. */
hashCode = -1;
hostAddress = null;
int q = file.lastIndexOf('?');
if (q != -1) {
query = file.substring(q+1);
path = file.substring(0, q);
} else
path = file;
}
}

/**
* Sets the specified 8 fields of the URL. This is not a public method so
* that only URLStreamHandlers can modify URL fields. URLs are otherwise
Expand Down

1 comment on commit 1548104

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.