aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/URLConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/net/URLConnection.java')
-rw-r--r--libjava/java/net/URLConnection.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/libjava/java/net/URLConnection.java b/libjava/java/net/URLConnection.java
index 5233a56..55b9d66 100644
--- a/libjava/java/net/URLConnection.java
+++ b/libjava/java/net/URLConnection.java
@@ -983,17 +983,22 @@ public abstract class URLConnection
if (contentType == null || contentType.equals(""))
return null;
- ContentHandler handler;
+ ContentHandler handler = null;
// See if a handler has been cached for this content type.
// For efficiency, if a content type has been searched for but not
// found, it will be in the hash table but as the contentType String
// instead of a ContentHandler.
- if ((handler = (ContentHandler) handlers.get(contentType)) != null)
- if (handler instanceof ContentHandler)
- return handler;
- else
- return null;
+ {
+ Object cachedHandler;
+ if ((cachedHandler = handlers.get(contentType)) != null)
+ {
+ if (cachedHandler instanceof ContentHandler)
+ return (ContentHandler)cachedHandler;
+ else
+ return null;
+ }
+ }
// If a non-default factory has been set, use it.
if (factory != null)