Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 85044 invoked from network); 25 Jan 2007 09:30:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jan 2007 09:30:10 -0000 Received: (qmail 58752 invoked by uid 500); 25 Jan 2007 09:30:16 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 58733 invoked by uid 500); 25 Jan 2007 09:30:16 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 58724 invoked by uid 99); 25 Jan 2007 09:30:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 01:30:16 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jan 2007 01:30:09 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 76ED47142D6 for ; Thu, 25 Jan 2007 01:29:49 -0800 (PST) Message-ID: <26148865.1169717389483.JavaMail.jira@brutus> Date: Thu, 25 Jan 2007 01:29:49 -0800 (PST) From: "Paulex Yang (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-1700) [classlib][archive] URL.openStream() should throw FileNotFoundEx if file not exists in jar file. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-1700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467302 ] Paulex Yang commented on HARMONY-1700: -------------------------------------- Tony, JarURLConnectionTest.test_getJarFile29 fails on my Linux.IA32 with your patch, did you see this issue? > [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.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.(ZipFile.java:90) > at java.util.jar.JarFile.(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.