harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From py...@apache.org
Subject svn commit: r434005 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java
Date Wed, 23 Aug 2006 10:24:01 GMT
Author: pyang
Date: Wed Aug 23 03:23:50 2006
New Revision: 434005

URL: http://svn.apache.org/viewvc?rev=434005&view=rev
Log:
Revert the generic lift on Reference object to fix HARMONY-1266 (JarURLConnection does not
compile)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java?rev=434005&r1=434004&r2=434005&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java
Wed Aug 23 03:23:50 2006
@@ -48,7 +48,7 @@
  * 
  */
 public class JarURLConnection extends java.net.JarURLConnection {
-	static Hashtable<String,CacheEntry> jarCache = new Hashtable<String,CacheEntry>();
+	static Hashtable<Object,CacheEntry> jarCache = new Hashtable<Object,CacheEntry>();
 
 	InputStream jarInput;
 
@@ -56,9 +56,9 @@
 
 	private JarEntry jarEntry;
 
-	ReferenceQueue<JarFile> cacheQueue = new ReferenceQueue<JarFile>();
+	ReferenceQueue cacheQueue = new ReferenceQueue();
 
-	static TreeSet<LRUKey> lru = new TreeSet<LRUKey>(new LRUComparitor());
+	static TreeSet lru = new TreeSet(new LRUComparitor());
 
 	static int Limit;
 	static {
@@ -70,10 +70,10 @@
 		VM.closeJars();
 	}
 
-	static final class CacheEntry extends WeakReference<JarFile> {
-		String key;
+	static final class CacheEntry extends WeakReference {
+		Object key;
 
-		CacheEntry(JarFile jar, String key, ReferenceQueue<JarFile> queue) {
+		CacheEntry(Object jar, String key, ReferenceQueue queue) {
 			super(jar, queue);
 			this.key = key;
 		}
@@ -97,18 +97,18 @@
 		}
 	}
 
-	static final class LRUComparitor implements Comparator<LRUKey> {
+	static final class LRUComparitor implements Comparator {
 		LRUComparitor() {
 		}
 
 		/**
 		 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
 		 */
-		public int compare(LRUKey o1, LRUKey o2) {
-			if (o1.ts > o2.ts) {
+		public int compare(Object o1, Object o2) {
+			if (((LRUKey) o1).ts > ((LRUKey) o2).ts) {
 				return 1;
 			}
-			return o1.ts == o2.ts ? 0 : -1;
+			return ((LRUKey) o1).ts == ((LRUKey) o2).ts ? 0 : -1;
 		}
 
 		/**
@@ -228,9 +228,9 @@
 		    CacheEntry entry;
             while ((entry = (CacheEntry) cacheQueue.poll()) != null)
                 jarCache.remove(entry.key);
-            entry = jarCache.get(key);
+            entry = (CacheEntry) jarCache.get(key);
             if (entry != null)
-                jar = entry.get();
+                jar = (JarFile) entry.get();
             if (jar == null && fileString != null) {
                 int flags = ZipFile.OPEN_READ
                         + (temp ? ZipFile.OPEN_DELETE : 0);



Mime
View raw message