Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 3545 invoked from network); 16 Feb 2006 14:00:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Feb 2006 14:00:55 -0000 Received: (qmail 53036 invoked by uid 500); 16 Feb 2006 14:00:45 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 52963 invoked by uid 500); 16 Feb 2006 14:00:45 -0000 Mailing-List: contact harmony-dev-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-dev@incubator.apache.org Received: (qmail 52916 invoked by uid 99); 16 Feb 2006 14:00:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Feb 2006 06:00:44 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=RCVD_IN_SORBS_WEB,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 217.158.94.220 is neither permitted nor denied by domain of t.p.ellison@gmail.com) Received: from [217.158.94.220] (HELO cirrus.purplecloud.com) (217.158.94.220) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Feb 2006 06:00:43 -0800 Received: (qmail 23137 invoked from network); 16 Feb 2006 14:00:21 +0000 Received: from blueice4n2.uk.ibm.com (HELO ?9.20.183.163?) (195.212.29.92) by smtp.purplecloud.net with (DHE-RSA-AES256-SHA encrypted) SMTP; 16 Feb 2006 14:00:21 +0000 Message-ID: <43F48574.7050703@gmail.com> Date: Thu, 16 Feb 2006 14:00:20 +0000 From: Tim Ellison User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [jira] Commented: (HARMONY-71) java.net.URLConnection.setUseCaches throws unspecified IllegalAccessError References: <442279057.1140095945880.JavaMail.jira@ajax.apache.org> In-Reply-To: <442279057.1140095945880.JavaMail.jira@ajax.apache.org> X-Enigmail-Version: 0.94.0.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 I would rather that you just opened a new JIRA issue for that as it doesn't relate to the original problem. FYI there is a local server incoming in the HARMONY-57 contribution, so don't spend any time on it, see: \Harmony\Harmony_Tests\src\test\java\tests\support\Support_HttpServer.java Regards, Tim Stepan Mishura (JIRA) wrote: > [ http://issues.apache.org/jira/browse/HARMONY-71?page=comments#action_12366637 ] > > Stepan Mishura commented on HARMONY-71: > --------------------------------------- > > Tim, > > Added test case (test_setUseCachesZ) depends on network and it fails if it can not create connection with apache.org. The same for HARMONY-72. I'm going to attach a patch file with a local server in it. Could you reopen this JIRA? > > Thanks, > Stepan. > >> java.net.URLConnection.setUseCaches throws unspecified IllegalAccessError >> -------------------------------------------------------------------------- >> >> Key: HARMONY-71 >> URL: http://issues.apache.org/jira/browse/HARMONY-71 >> Project: Harmony >> Type: Bug >> Components: Classlib >> Reporter: Svetlana Samoilenko >> Assignee: Tim Ellison > >> According to j2se 1.4.2 specification method java.net.URLConnection.setUseCaches(boolean) throws IllegalStateException, if already connected. Harmony throws java.lang.IllegalAccessError instead, that contradicts the specification. >> Code to reproduce: >> import java.io.IOException; >> import java.net.*; >> public class test2 { >> public static void main(String[] args) { >> HttpURLConnection u=null; >> try { >> u=(HttpURLConnection)(new URL("http://intel.com").openConnection()); >> u.connect(); >> } catch (MalformedURLException e) { >> System.out.println("unexpected MalformedURLException"+e); >> } catch (IOException f) { >> System.out.println("unexpected IOException"+f); >> } >> try { >> u.setUseCaches(true); >> } catch (IllegalStateException e) { >> System.out.println("OK. Expected IllegalStateException"); >> e.printStackTrace(); >> }; >> } >> } >> Steps to Reproduce: >> 1. Build Harmony (check-out on 2006-01-30) j2se subset as described in README.txt. >> 2. Compile test2.java using BEA 1.4 javac >>> javac -d . test2.java >> 3. Run java using compatible VM (J9) >>> java -showversion test2 >> Output: >> C:\tmp>C:\jrockit-j2sdk1.4.2_04\bin\java.exe -showversion test2 >> java version "1.4.2_04" >> Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) >> BEA WebLogic JRockit(TM) 1.4.2_04 JVM (build ari-31788-20040616-1132-win-ia32, Native Threads, GC strategy: parallel) >> OK. Expected IllegalStateException >> java.lang.IllegalStateException: Already connected >> at java.net.URLConnection.setUseCaches(Z)V(URLConnection.java:828) >> at test2.main([Ljava.lang.String;)V(test2.java:17) >> C:\tmp>C:\harmony\trunk\deploy\jre\bin\java -showversion test2 >> (c) Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable. >> java.lang.IllegalAccessError: Connection already established >> at java.net.URLConnection.setUseCaches(URLConnection.java:923) >> at test2.main(test2.java:17) >> Suggested junit test case: >> ------------------------ URLConnectionTest.java ------------------------------------------------- >> import java.io.IOException; >> import java.net.*; >> import junit.framework.*; >> public class URLConnectionTest extends TestCase { >> public static void main(String[] args) { >> junit.textui.TestRunner.run(URLConnectionTest.class); >> } >> public void test_setUseCaches () { >> HttpURLConnection u=null; >> try { >> u=(HttpURLConnection)(new URL("http://intel.com").openConnection()); >> u.connect(); >> } catch (MalformedURLException e) { >> fail("unexpected MalformedURLException"+e); >> } catch (IOException f) { >> fail("unexpected IOException"+f); >> } >> try { >> u.setUseCaches(true); >> } catch (IllegalStateException e) { //expected >> }; >> } >> } > -- Tim Ellison (t.p.ellison@gmail.com) IBM Java technology centre, UK.