From e9d34968823670f95b9b2caba30f007ac9f383c5 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Fri, 23 Apr 2004 07:21:46 +0000 Subject: 2004-04-23 Michael Koch * java/net/URL.java (hashcode): Don't initialize with default value explicitely. (getContent): Removed redundant "final" keyword. (openStream): Likewise. (getURLStreamHandler): Fixed coding style. * java/net/URLConnection.java (defaultAllowUserInteraction): Don't initialize with default value explicitely. (connected): Likewise. (doOutput): Likewise. (ifModifiedSince): Likewise. (dateformats_initialized): Likewise. (setURLStreamHander): Use StreamTokenizer where it belongs to. From-SVN: r81080 --- libjava/java/net/URLConnection.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libjava/java/net/URLConnection.java') diff --git a/libjava/java/net/URLConnection.java b/libjava/java/net/URLConnection.java index 39fbd32..867a534 100644 --- a/libjava/java/net/URLConnection.java +++ b/libjava/java/net/URLConnection.java @@ -432,10 +432,10 @@ public abstract class URLConnection String type = getContentType(); ContentHandler ch = setContentHandler(type); - if (ch != null) - return ch.getContent(this); + if (ch == null) + return getInputStream(); - return getInputStream(); + return ch.getContent(this); } /** @@ -993,7 +993,6 @@ public abstract class URLConnection // Replace the '/' character in the content type with '.' and // all other non-alphabetic, non-numeric characters with '_'. - StringTokenizer pkgPrefix = new StringTokenizer(propVal, "|"); char[] cArray = contentType.toCharArray(); for (int i = 0; i < cArray.length; i++) { @@ -1007,6 +1006,7 @@ public abstract class URLConnection String contentClass = new String(cArray); // See if a class of this content type exists in any of the packages. + StringTokenizer pkgPrefix = new StringTokenizer(propVal, "|"); do { String facName = pkgPrefix.nextToken() + "." + contentClass; -- cgit v1.1