Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 92487 invoked from network); 22 Aug 2006 08:32:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Aug 2006 08:32:23 -0000 Received: (qmail 55164 invoked by uid 500); 22 Aug 2006 08:32:22 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 55131 invoked by uid 500); 22 Aug 2006 08:32:22 -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 55120 invoked by uid 99); 22 Aug 2006 08:32:22 -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:32:22 -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:32:22 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3181C7142F9 for ; Tue, 22 Aug 2006 08:29:17 +0000 (GMT) Message-ID: <7026257.1156235357200.JavaMail.jira@brutus> Date: Tue, 22 Aug 2006 01:29:17 -0700 (PDT) From: "Igor V. Stolyarov (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Created: (HARMONY-1254) [classlib][luni] org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection caches jar resource always 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 [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 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