diff options
Diffstat (limited to 'libjava/java/net')
-rw-r--r-- | libjava/java/net/URLStreamHandler.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java index 9198370..a05e474 100644 --- a/libjava/java/net/URLStreamHandler.java +++ b/libjava/java/net/URLStreamHandler.java @@ -478,11 +478,13 @@ public abstract class URLStreamHandler } if (host.length() != 0) - sb.append("//").append(host); + { + sb.append("//").append(host); - // Append port if port was in URL spec. - if (port != -1) - sb.append(':').append(port); + // Append port if port was in URL spec. + if (port >= 0) + sb.append(':').append(port); + } sb.append(file); |