harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Wu (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-1700) [classlib][archive] URL.openStream() should throw FileNotFoundEx if file not exists in jar file.
Date Fri, 26 Jan 2007 01:46:49 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-1700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Tony Wu updated HARMONY-1700:
-----------------------------

    Attachment: harmony-1700-archive-2.diff

And there is a testcase in archive needs modification

> [classlib][archive] URL.openStream() should throw FileNotFoundEx if file not exists in
jar file.
> ------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1700
>                 URL: https://issues.apache.org/jira/browse/HARMONY-1700
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: ALL
>            Reporter: Nikolay Chugunov
>         Assigned To: Paulex Yang
>            Priority: Minor
>         Attachments: harmony-1700-2.diff, harmony-1700-archive-2.diff, harmony-1700.diff,
hello.jar
>
>
> URL.openStream() should throw FileNotFoundException if file not exists in jar file.
> Code for reproducing:
> package test;
> import java.io.FileNotFoundException;
> import java.net.URL;
> import junit.framework.TestCase;
> public class Bug extends TestCase {
>     public void test() throws Exception {
>         try {
>             URL url = new URL("jar:file:/C:/alternate.jar!/foo.jar!/bar");
>             url.openStream();
>         } catch (FileNotFoundException e) {
>             e.printStackTrace();
>             System.out.println("PASSED");
>         }
>     }
> }
> alternate.jar is in attachment.
> Output on RI:
> java.io.FileNotFoundException: JAR entry foo.jar!/bar not found in C:\alternate.jar
>         at
> sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:114)
>         at
> sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)
>         at java.net.URL.openStream(URL.java:1007)
>         at test.Bug.test(Bug.java:14)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at junit.framework.TestCase.runTest(TestCase.java:154)
>         at junit.framework.TestCase.runBare(TestCase.java:127)
>         at junit.framework.TestResult$1.protect(TestResult.java:106)
>         at junit.framework.TestResult.runProtected(TestResult.java:124)
>         at junit.framework.TestResult.run(TestResult.java:109)
>         at junit.framework.TestCase.run(TestCase.java:118)
> PASSED
> Output on latest Harmony build r450941:
> java.util.zip.ZipException: Unable to open: C:\alternate.jar!\foo.jar
>         at java.util.zip.ZipFile.openZip(ZipFile.java:117)
>         at java.util.zip.ZipFile.<init>(ZipFile.java:90)
>         at java.util.jar.JarFile.<init>(JarFile.java:173)
>         at
> org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.openJarFile(JarURLConnection.java:237)
>         at
> org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.findJarFile(JarURLConnection.java:175)
>         at
> org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:142)
>         at
> org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:297)
>         at java.net.URL.openStream(URL.java:645)
>         at test.Bug.test(Bug.java:12)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message