You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2006/05/26 23:39:03 UTC

svn commit: r409754 - /incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java

Author: tellison
Date: Fri May 26 14:39:02 2006
New Revision: 409754

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

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java?rev=409754&r1=409753&r2=409754&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java Fri May 26 14:39:02 2006
@@ -134,7 +134,7 @@
 			// Only close initialized instances
 			closeZipImpl();
 			if ((mode & OPEN_DELETE) != 0) {
-				AccessController.doPrivileged(new PrivilegedAction() {
+				AccessController.doPrivileged(new PrivilegedAction<Object>() {
 					public Object run() {
 						new File(fileName).delete();
 						return null;
@@ -149,7 +149,7 @@
 	 * 
 	 * @return an Enumeration of the zip entries
 	 */
-	public Enumeration entries() {
+	public Enumeration<? extends ZipEntry> entries() {
 		return new ZFEnum();
 	}
 
@@ -221,10 +221,10 @@
 
 	private static native void ntvinit();
 
-	class ZFEnum implements Enumeration {
+	class ZFEnum<T extends ZipEntry> implements Enumeration<T> {
 		private long nextEntryPointer;
 
-		private ZipEntry current;
+		private T current;
 
 		ZFEnum() {
 			nextEntryPointer = resetZip(descriptor);
@@ -233,8 +233,7 @@
 
 		private native long resetZip(long descriptor1);
 
-		private native ZipEntry getNextEntry(long descriptor1,
-				long nextEntryPointer1);
+		private native T getNextEntry(long descriptor1, long nextEntryPointer1);
 
 		public boolean hasMoreElements() {
 			if(descriptor == -1) {
@@ -244,10 +243,10 @@
 			return current != null;
 		}
 
-		public Object nextElement() {
+		public T nextElement() {
 			if (current == null)
 				throw new NoSuchElementException();
-			ZipEntry ze = current;
+			T ze = current;
 			current = getNextEntry(descriptor, nextEntryPointer);
 			return ze;
 		}