harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r410661 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
Date Wed, 31 May 2006 20:36:23 GMT
Author: tellison
Date: Wed May 31 13:36:23 2006
New Revision: 410661

URL: http://svn.apache.org/viewvc?rev=410661&view=rev
Log:
Generics uplift for URLClassLoader

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java?rev=410661&r1=410660&r2=410661&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/URLClassLoader.java
Wed May 31 13:36:23 2006
@@ -58,11 +58,11 @@
 
 	URL[] urls, orgUrls;
 
-	private IdentityHashMap resCache = new IdentityHashMap(32);
+	private IdentityHashMap<URL, JarFile> resCache = new IdentityHashMap<URL, JarFile>(32);
 
 	private URLStreamHandlerFactory factory;
 
-	HashMap extensions;
+	HashMap<URL, URL[]> extensions;
 
 	Hashtable[] indexes;
 
@@ -94,7 +94,7 @@
 		 * @exception ClassNotFoundException
 		 *                If the class could not be found.
 		 */
-		protected synchronized Class loadClass(String className,
+		protected synchronized Class<?> loadClass(String className,
 				boolean resolveClass) throws ClassNotFoundException {
 			SecurityManager sm = System.getSecurityManager();
 			if (sm != null && !checkingPackageAccess) {
@@ -197,19 +197,19 @@
 	 *                thrown if an IO Exception occurs while attempting to
 	 *                connect
 	 */
-	public Enumeration findResources(final String name) throws IOException {
+	public Enumeration<URL> findResources(final String name) throws IOException {
 		if (name == null)
 			return null;
-		Vector result = AccessController.doPrivileged(
-                new PrivilegedAction<Vector>() {
-                    public Vector run() {
-                        return findResources(urls, name, new Vector());
+		Vector<URL> result = AccessController.doPrivileged(
+                new PrivilegedAction<Vector<URL>>() {
+                    public Vector<URL> run() {
+                        return findResources(urls, name, new Vector<URL>());
                     }
                 }, currentContext);
 		SecurityManager sm;
 		int length = result.size();
 		if (length > 0 && (sm = System.getSecurityManager()) != null) {
-			Vector reduced = new Vector(length);
+			Vector<URL> reduced = new Vector<URL>(length);
 			for (int i = 0; i < length; i++) {
 				URL url = (URL) result.elementAt(i);
 				try {
@@ -235,7 +235,7 @@
 	 * @param name
 	 *            java.lang.String the name of the requested resource
 	 */
-	Vector findResources(URL[] searchURLs, String name, Vector result) {
+	Vector<URL> findResources(URL[] searchURLs, String name, Vector<URL> result)
{
 		boolean findInExtensions = searchURLs == urls;
 		for (int i = 0; i < searchURLs.length; i++) {
 			if (searchURLs[i] != null) {
@@ -276,7 +276,7 @@
 	 *            boolean if true a URL should be returned as the non null
 	 *            element, if false a Class should be returned.
 	 */
-	Object findInIndex(int i, String name, Vector resources, boolean url) {
+	Object findInIndex(int i, String name, Vector<URL> resources, boolean url) {
 		Hashtable index = indexes[i];
 		if (index != null) {
 			int pos = name.lastIndexOf("/");
@@ -344,7 +344,7 @@
 	 *            element, if false a Class should be returned.
 	 */
 	Object findInExtensions(URL[] newExtensions, String name, int i,
-			Vector resources, boolean url) {
+			Vector<URL> resources, boolean url) {
 		if (newExtensions != null) {
 			for (int k = 0; k < newExtensions.length; k++) {
 				if (newExtensions[k] != null) {
@@ -565,7 +565,7 @@
 		urls = new URL[nbUrls];
 		orgUrls = new URL[nbUrls];
 		// Search each jar for CLASS-PATH attribute in manifest
-		extensions = new HashMap(nbUrls * 2);
+		extensions = new HashMap<URL, URL[]>(nbUrls * 2);
 		for (int i = 0; i < nbUrls; i++) {
 			try {
 				urls[i] = createSearchURL(searchUrls[i]);
@@ -590,7 +590,7 @@
 	 * @exception java.lang.ClassNotFoundException
 	 *                if the class cannot be loaded
 	 */
-	protected Class findClass(final String clsName)
+	protected Class<?> findClass(final String clsName)
 			throws ClassNotFoundException {
 		Class cls = AccessController.doPrivileged(
 				new PrivilegedAction<Class>() {
@@ -876,7 +876,7 @@
 	private URL[] getInternalURLs(URL root, String classpath) {
 		// Class-path attribute is composed of space-separated values.
 		StringTokenizer tokenizer = new java.util.StringTokenizer(classpath);
-		Vector addedURLs = new Vector();
+		Vector<URL> addedURLs = new Vector<URL>();
 		String file = root.getFile();
 		file = file.substring(0, file.lastIndexOf("/",
 				file.lastIndexOf("!/") - 1) + 1);



Mime
View raw message