< prev index next >
src/java.base/share/classes/java/net/URLStreamHandler.java
Print this page
@@ -248,19 +248,19 @@
if (spec.charAt(start) == '/') {
path = spec.substring(start, limit);
} else if (path != null && path.length() > 0) {
isRelPath = true;
int ind = path.lastIndexOf('/');
- String seperator = "";
+ String separator = "";
if (ind == -1 && authority != null)
- seperator = "/";
- path = path.substring(0, ind + 1) + seperator +
+ separator = "/";
+ path = path.substring(0, ind + 1) + separator +
spec.substring(start, limit);
} else {
- String seperator = (authority != null) ? "/" : "";
- path = seperator + spec.substring(start, limit);
+ String separator = (authority != null) ? "/" : "";
+ path = separator + spec.substring(start, limit);
}
} else if (queryOnly && path != null) {
int ind = path.lastIndexOf('/');
if (ind < 0)
ind = 0;
@@ -312,20 +312,20 @@
setURL(u, protocol, host, port, authority, userInfo, path, query, ref);
}
/**
* Returns the default port for a URL parsed by this handler. This method
- * is meant to be overidden by handlers with default port numbers.
+ * is meant to be overridden by handlers with default port numbers.
* @return the default port for a {@code URL} parsed by this handler.
* @since 1.3
*/
protected int getDefaultPort() {
return -1;
}
/**
- * Provides the default equals calculation. May be overidden by handlers
+ * Provides the default equals calculation. May be overridden by handlers
* for other protocols that have different requirements for equals().
* This method requires that none of its arguments is null. This is
* guaranteed by the fact that it is only called by java.net.URL class.
* @param u1 a URL object
* @param u2 a URL object
@@ -340,11 +340,11 @@
return (ref1 == ref2 || (ref1 != null && ref1.equals(ref2))) &&
sameFile(u1, u2);
}
/**
- * Provides the default hash calculation. May be overidden by handlers for
+ * Provides the default hash calculation. May be overridden by handlers for
* other protocols that have different requirements for hashCode
* calculation.
* @param u a URL object
* @return an {@code int} suitable for hash table indexing
* @since 1.3
< prev index next >