harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r433609 - in /incubator/harmony/enhanced/classlib/trunk/modules/archive/src: main/java/java/util/zip/ZipInputStream.java test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java
Date Tue, 22 Aug 2006 12:14:16 GMT
Author: mloenko
Date: Tue Aug 22 05:14:16 2006
New Revision: 433609

URL: http://svn.apache.org/viewvc?rev=433609&view=rev
Log:
applied patch for HARMONY-1101
[classlib][archive] unexpected IOException for double ZipInputStream().close()

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipInputStream.java
    incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipInputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipInputStream.java?rev=433609&r1=433608&r2=433609&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipInputStream.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipInputStream.java
Tue Aug 22 05:14:16 2006
@@ -74,13 +74,15 @@
 	}
 
 	/**
-	 * Closes this ZipInputStream.
-	 */
-	public void close() throws IOException {
-		closeEntry(); // Close the current entry
-		zipClosed = true;
-		super.close();
-	}
+     * Closes this ZipInputStream.
+     */
+    public void close() throws IOException {
+        if (zipClosed != true) {
+            closeEntry(); // Close the current entry
+            zipClosed = true;
+            super.close();
+        }
+    }
 
 	/**
 	 * Closes the current zip entry and positions to read the next entry.

Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java?rev=433609&r1=433608&r2=433609&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipInputStreamTest.java
Tue Aug 22 05:14:16 2006
@@ -65,6 +65,19 @@
 	}
 
 	/**
+     * @tests java.util.zip.ZipInputStream#close()
+     */
+    public void test_close2() {
+        // Regression for HARMONY-1101
+        try {
+            zis.close();
+            zis.close();
+        } catch (java.io.IOException e) {
+            fail("No exception expected: " + e);
+        }
+    }
+
+	/**
 	 * @tests java.util.zip.ZipInputStream#closeEntry()
 	 */
 	public void test_closeEntry() {



Mime
View raw message