diff options
Diffstat (limited to 'libjava/classpath/gnu/java/net/loader')
3 files changed, 16 insertions, 15 deletions
diff --git a/libjava/classpath/gnu/java/net/loader/JarURLLoader.java b/libjava/classpath/gnu/java/net/loader/JarURLLoader.java index 9385760..40194be 100644 --- a/libjava/classpath/gnu/java/net/loader/JarURLLoader.java +++ b/libjava/classpath/gnu/java/net/loader/JarURLLoader.java @@ -32,7 +32,7 @@ public final class JarURLLoader extends URLLoader // Base jar: url for all resources loaded from jar. final URL baseJarURL; // The "Class-Path" attribute of this Jar's manifest. - ArrayList classPath; + ArrayList<URLLoader> classPath; // If not null, a mapping from INDEX.LIST for this jar only. // This is a set of all prefixes and top-level files that // ought to be available in this jar. @@ -90,20 +90,20 @@ public final class JarURLLoader extends URLLoader IndexListParser parser = new IndexListParser(jarfile, baseJarURL, baseURL); - LinkedHashMap indexMap = parser.getHeaders(); + LinkedHashMap<URL, Set<String>> indexMap = parser.getHeaders(); if (indexMap != null) { // Note that the index also computes // the resulting Class-Path -- there are jars out there // where the index lists some required jars which do // not appear in the Class-Path attribute in the manifest. - this.classPath = new ArrayList(); - Iterator it = indexMap.entrySet().iterator(); + this.classPath = new ArrayList<URLLoader>(); + Iterator<Map.Entry<URL, Set<String>>> it = indexMap.entrySet().iterator(); while (it.hasNext()) { - Map.Entry entry = (Map.Entry) it.next(); - URL subURL = (URL) entry.getKey(); - Set prefixes = (Set) entry.getValue(); + Map.Entry<URL, Set<String>> entry = it.next(); + URL subURL = entry.getKey(); + Set<String> prefixes = entry.getValue(); if (subURL.equals(baseURL)) this.indexSet = prefixes; else @@ -127,7 +127,7 @@ public final class JarURLLoader extends URLLoader = attributes.getValue(Attributes.Name.CLASS_PATH)) != null)) { - this.classPath = new ArrayList(); + this.classPath = new ArrayList<URLLoader>(); StringTokenizer st = new StringTokenizer(classPathString, " "); while (st.hasMoreElements ()) { @@ -144,7 +144,7 @@ public final class JarURLLoader extends URLLoader cache, factory, subURL, subURL); this.classPath.add(subLoader); - ArrayList extra = subLoader.getClassPath(); + ArrayList<URLLoader> extra = subLoader.getClassPath(); if (extra != null) this.classPath.addAll(extra); } @@ -208,7 +208,7 @@ public final class JarURLLoader extends URLLoader } } - public ArrayList getClassPath() + public ArrayList<URLLoader> getClassPath() { return classPath; } diff --git a/libjava/classpath/gnu/java/net/loader/URLLoader.java b/libjava/classpath/gnu/java/net/loader/URLLoader.java index d073c54..5228bca 100644 --- a/libjava/classpath/gnu/java/net/loader/URLLoader.java +++ b/libjava/classpath/gnu/java/net/loader/URLLoader.java @@ -140,7 +140,7 @@ public abstract class URLLoader * Return a list of new URLLoader objects representing any * class path entries added by this container. */ - public ArrayList getClassPath() + public ArrayList<URLLoader> getClassPath() { return null; } diff --git a/libjava/classpath/gnu/java/net/loader/URLStreamHandlerCache.java b/libjava/classpath/gnu/java/net/loader/URLStreamHandlerCache.java index 295a15d..b7b8bf1 100644 --- a/libjava/classpath/gnu/java/net/loader/URLStreamHandlerCache.java +++ b/libjava/classpath/gnu/java/net/loader/URLStreamHandlerCache.java @@ -51,7 +51,8 @@ public class URLStreamHandlerCache * private protocol handler cache (also a HashMap), so we can avoid * creating handlers each time the same protocol comes. */ - private HashMap factoryCache = new HashMap(5); + private HashMap<URLStreamHandlerFactory, HashMap<String, URLStreamHandler>> factoryCache + = new HashMap<URLStreamHandlerFactory, HashMap<String, URLStreamHandler>>(5); public URLStreamHandlerCache() { @@ -62,7 +63,7 @@ public class URLStreamHandlerCache // Since we only support three protocols so far, 5 is enough // for cache initial size. if (factory != null && factoryCache.get(factory) == null) - factoryCache.put(factory, new HashMap(5)); + factoryCache.put(factory, new HashMap<String, URLStreamHandler>(5)); } public synchronized URLStreamHandler get(URLStreamHandlerFactory factory, @@ -71,8 +72,8 @@ public class URLStreamHandlerCache if (factory == null) return null; // Check if there're handler for the same protocol in cache. - HashMap cache = (HashMap) factoryCache.get(factory); - URLStreamHandler handler = (URLStreamHandler) cache.get(protocol); + HashMap<String, URLStreamHandler> cache = factoryCache.get(factory); + URLStreamHandler handler = cache.get(protocol); if (handler == null) { // Add it to cache. |