Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 93017 invoked from network); 22 Aug 2006 08:34:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Aug 2006 08:34:25 -0000 Received: (qmail 56751 invoked by uid 500); 22 Aug 2006 08:34:25 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 56649 invoked by uid 500); 22 Aug 2006 08:34:25 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 56638 invoked by uid 99); 22 Aug 2006 08:34:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Aug 2006 01:34:25 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Aug 2006 01:34:24 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id BE9087142F7 for ; Tue, 22 Aug 2006 08:31:14 +0000 (GMT) Message-ID: <32384870.1156235474778.JavaMail.jira@brutus> Date: Tue, 22 Aug 2006 01:31:14 -0700 (PDT) From: "Igor V. Stolyarov (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Updated: (HARMONY-1254) [classlib][luni] org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection caches jar resource always In-Reply-To: <7026257.1156235357200.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-1254?page=all ] Igor V. Stolyarov updated HARMONY-1254: --------------------------------------- Attachment: Harmony-1254.patch Fix attached Output when patch was applied: java version 1.5 (subset) (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. META-INF/ META-INF/MANIFEST.MF Hello.class Hello.class > [classlib][luni] org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection caches jar resource always > ------------------------------------------------------------------------------------------------------------------ > > Key: HARMONY-1254 > URL: http://issues.apache.org/jira/browse/HARMONY-1254 > Project: Harmony > Issue Type: Bug > Reporter: Igor V. Stolyarov > Attachments: Harmony-1254.patch > > > org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection doesn't respond on setUseCaches(false) and caches jar resource always > Test-------------------------------------------------------------------------- > public class Hello{ > public static void main(String argv[]){ > System.out.println("Hello world!"); > } > } > 1. Compile Hello.java > 2. Create hello.jar and put Hello.class into hello.jar > import java.io.IOException; > import java.net.JarURLConnection; > import java.net.MalformedURLException; > import java.net.URL; > import java.util.Enumeration; > import java.util.jar.JarEntry; > import java.util.jar.JarFile; > public class JarURLConnectionTest { > > public static void main(String argv[]){ > try { > URL jarUrl = new URL("jar", "", "file:hello.jar!/META-INF/"); > JarURLConnection juc = (JarURLConnection)jarUrl.openConnection(); > juc.setUseCaches(false); > JarFile jf = juc.getJarFile(); > for(Enumeration e = jf.entries();e.hasMoreElements();){ > JarEntry entry = (JarEntry)e.nextElement(); > System.out.println(entry.getName()); > } > jf.close(); > juc = (JarURLConnection)jarUrl.openConnection(); > jf = juc.getJarFile(); > System.out.println(jf.getEntry("Hello.class")); > } catch (MalformedURLException e) { > e.printStackTrace(); > } catch (IOException e) { > e.printStackTrace(); > } > } > } > RunrURLConnectionTest > Outpup-------------------------------------------------------------------------------------------------- > JRockit: > java version "1.5.0" > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64) > BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System optimized over throughput (initial strategy singleparpar)) > META-INF/ > META-INF/MANIFEST.MF > Hello.class > Hello.class > Harmony: > java version 1.5 (subset) > > (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable. > META-INF/ > META-INF/MANIFEST.MF > Hello.class > Exception in thread "main" java.lang.IllegalStateException: > at java.util.zip.ZipFile.getEntryImpl(Native Method) > at java.util.zip.ZipFile.getEntry(ZipFile.java:166) > at java.util.jar.JarFile.getEntry(JarFile.java:368) > at java.util.jar.JarFile.getJarEntry(JarFile.java:245) > at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.findJarEntry(JarURLConnection.java:274) > at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:144) > at org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:159) > at JarURLConnectionTest.main(JarURLConnectionTest.java:36) -- 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