You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Igor V. Stolyarov (JIRA)" <ji...@apache.org> on 2006/08/22 10:29:17 UTC
[jira] Created: (HARMONY-1254) [classlib][luni]
org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
caches jar resource always
[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
[jira] Closed: (HARMONY-1254) [classlib][luni]
org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
caches jar resource always
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1254?page=all ]
Paulex Yang closed HARMONY-1254.
--------------------------------
Verified by Igor.
> [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
> Assigned To: Paulex Yang
> Attachments: Harmony-1254.patch, JarURLConnection.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
[jira] Commented: (HARMONY-1254) [classlib][luni]
org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
caches jar resource always
Posted by "Igor V. Stolyarov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1254?page=comments#action_12429963 ]
Igor V. Stolyarov commented on HARMONY-1254:
--------------------------------------------
Works for me. Thank you Paulex.
> [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
> Assigned To: Paulex Yang
> Attachments: Harmony-1254.patch, JarURLConnection.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
[jira] Updated: (HARMONY-1254) [classlib][luni]
org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
caches jar resource always
Posted by "Igor V. Stolyarov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1254?page=all ]
Igor V. Stolyarov updated HARMONY-1254:
---------------------------------------
Attachment: JarURLConnection.patch
Paulex, I've had error during compilation:
[javac] /nfs/pb/home/ivstolya/Temp/Harmony/modules/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnection.java:229: inconvertible types
[javac] found : java.lang.ref.Reference<capture of ? extends java.util.jar.JarFile>
[javac] required: org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection.CacheEntry
[javac] while ((entry = (CacheEntry) cacheQueue.poll()) != null)
[javac] ^
[javac] Note: * uses or overrides a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
When I've applied new patch all starts works for me
> [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
> Assigned To: Paulex Yang
> Attachments: Harmony-1254.patch, JarURLConnection.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
[jira] Updated: (HARMONY-1254) [classlib][luni]
org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
caches jar resource always
Posted by "Igor V. Stolyarov (JIRA)" <ji...@apache.org>.
[ 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
[jira] Assigned: (HARMONY-1254) [classlib][luni]
org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
caches jar resource always
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1254?page=all ]
Paulex Yang reassigned HARMONY-1254:
------------------------------------
Assignee: Paulex Yang
> [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
> Assigned To: Paulex Yang
> 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
[jira] Commented: (HARMONY-1254) [classlib][luni]
org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
caches jar resource always
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1254?page=comments#action_12429961 ]
Paulex Yang commented on HARMONY-1254:
--------------------------------------
It was me, my generic lifting caused compile errors, fix at revision r434005, please verify the problem is resoved, thank you.
> [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
> Assigned To: Paulex Yang
> Attachments: Harmony-1254.patch, JarURLConnection.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
[jira] Resolved: (HARMONY-1254) [classlib][luni]
org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
caches jar resource always
Posted by "Paulex Yang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-1254?page=all ]
Paulex Yang resolved HARMONY-1254.
----------------------------------
Resolution: Fixed
Igor, patch applied at revision r433988 with changes on generics lift, thanks a lot for this enhancement, please verify that the problem is fully fixed as you expected. And it would be nice if you also merge the regression tests.
> [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
> Assigned To: Paulex Yang
> 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