diff options
Diffstat (limited to 'libjava/classpath/java/net/URL.java')
-rw-r--r-- | libjava/classpath/java/net/URL.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libjava/classpath/java/net/URL.java b/libjava/classpath/java/net/URL.java index 8f72d0687e4..16a606fbc7e 100644 --- a/libjava/classpath/java/net/URL.java +++ b/libjava/classpath/java/net/URL.java @@ -190,7 +190,8 @@ public final class URL implements Serializable * This a table where we cache protocol handlers to avoid the overhead * of looking them up each time. */ - private static HashMap ph_cache = new HashMap(); + private static HashMap<String, URLStreamHandler> ph_cache + = new HashMap<String, URLStreamHandler>(); /** * Whether or not to cache protocol handlers. @@ -901,7 +902,7 @@ public final class URL implements Serializable // First, see if a protocol handler is in our cache. if (cache_handlers) { - if ((ph = (URLStreamHandler) ph_cache.get(protocol)) != null) + if ((ph = ph_cache.get(protocol)) != null) return ph; } @@ -934,9 +935,9 @@ public final class URL implements Serializable // Cache the systemClassLoader if (systemClassLoader == null) { - systemClassLoader = (ClassLoader) AccessController.doPrivileged - (new PrivilegedAction() { - public Object run() + systemClassLoader = AccessController.doPrivileged + (new PrivilegedAction<ClassLoader>() { + public ClassLoader run() { return ClassLoader.getSystemClassLoader(); } |