438 |
// ignores a non-default port if host is null or "". That is inconsistent |
// ignores a non-default port if host is null or "". That is inconsistent |
439 |
// with the spec since the result of this method is spec'ed so it can be |
// with the spec since the result of this method is spec'ed so it can be |
440 |
// used to construct a new URL that is equivalent to the original. |
// used to construct a new URL that is equivalent to the original. |
441 |
boolean port_needed = port >= 0 && port != getDefaultPort(); |
boolean port_needed = port > 0 && port != getDefaultPort(); |
442 |
if (port_needed) |
if (port_needed) |
443 |
sb.append(':').append(port); |
sb.append(':').append(port); |
444 |
|
|