Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
-
Patch Available
Description
Reading from InputStream which was opened on some JarFile
is allowed even if this JarFile was closed .
java.util.jar.JarFile inherits close() method from java.util.zip.ZipFile and
specification of this method ensure that if JarFile is closed all InputStreams that were obtained
via getInputStream() method will be closed. But JarFile behaves in a different manner.
Code to reproduce this problem:
import java.util.jar.*;
import java.io.*;
public class TestJarFileClose{
public static void main(String[] args) {
byte[] b = new byte[1024];
try
catch (Exception e)
{ System.out.println("Test passed: "+e); }
}
}
Output on RI:
Test passed: java.lang.IllegalStateException: zip file closed
Output on Harmony:
Test failed, readed from closed JAR file: 427
Attachments
Attachments
Issue Links
- relates to
-
HARMONY-5281 [drlvm][startup][performance][classloader] mapping bootstrap jars directly into memory
- Resolved
-
HARMONY-4150 [classlib][archive]RI could read some bytes from an InputStream even if the jar file has been closed
- Closed