harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-605) [classlib][util] java.util.jar.getManifest() doesn't throw IllegalStateException if the jar file has been closed
Date Thu, 15 Jun 2006 08:58:30 GMT
 [classlib][util] java.util.jar.getManifest() doesn't throw IllegalStateException if the jar
file has been closed
-----------------------------------------------------------------------------------------------------------------

         Key: HARMONY-605
         URL: http://issues.apache.org/jira/browse/HARMONY-605
     Project: Harmony
        Type: Bug

    Reporter: Vladimir Ivanov


Compatibility issue: Harmony java.util.jar.getManifest() doesn't throw IllegalStateException
if the jar file has been closed while RI does.

According to J2SE specification
IllegalStateException - may be thrown if the jar file has been closed

=========================== test.java
import java.io.File; 
import java.util.jar.JarFile; 

public class test {          
    public static void main(String args[]) throws Exception { 
        try { 
            File f = new File("FilenoManifest.jar"); 
            JarFile jf = new JarFile(f, false); 
            jf.close(); 
            jf.getManifest(); 
            System.out.println("Failed");
        } catch (IllegalStateException e) {
            System.out.println("Passed");
        } 
    } 
}

Steps to Reproduce: 
1.Compile test.java 
% javac -d test.java

2. create jar file "FileNoManifest.jar" without manifest  
3. Run test class


The output on Harmony: 
Failed 

The output on RI: 
passed

 


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message