Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 62354 invoked from network); 30 Mar 2006 11:20:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Mar 2006 11:20:07 -0000 Received: (qmail 29517 invoked by uid 500); 30 Mar 2006 11:20:02 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 29473 invoked by uid 500); 30 Mar 2006 11:20:02 -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 29458 invoked by uid 99); 30 Mar 2006 11:20:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2006 03:20:01 -0800 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mloenko@gmail.com designates 64.233.182.188 as permitted sender) Received: from [64.233.182.188] (HELO nproxy.gmail.com) (64.233.182.188) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2006 03:20:01 -0800 Received: by nproxy.gmail.com with SMTP id p48so324415nfa for ; Thu, 30 Mar 2006 03:19:40 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=CRRQrGb+5BePVTmKd/G2fPhkwTB7dUoqR3fNbsTFLYNKLGJr03oumnrkEHmQscftpYjQ0qYZ/9Ma5riQnToKmWAhI6tZDk91c1vaSHFKL6uAoYRT+FmWSTZww9n8utVo2zTT12wLGjA/pLyBKvKH5HxWZO1Ke7C1dZMB3fRomRk= Received: by 10.48.213.10 with SMTP id l10mr847826nfg; Thu, 30 Mar 2006 03:19:39 -0800 (PST) Received: by 10.49.6.5 with HTTP; Thu, 30 Mar 2006 03:19:39 -0800 (PST) Message-ID: <906dd82e0603300319j475acfcauc172142b39ae7a8d@mail.gmail.com> Date: Thu, 30 Mar 2006 18:19:39 +0700 From: "Mikhail Loenko" To: harmony-dev@incubator.apache.org Subject: Re: bug-to-bug compatiblity case: Proxy handling In-Reply-To: <442B73B2.1020105@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <442B73B2.1020105@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I think this is the case when me might choose "follow the spec" Most likely we will not break existing applications if we weaken requirements for method arguments. But advanced users would be able to use our benefits. Thanks, Mikhail 2006/3/30, Paulex Yang : > Hi, > About the Internet proxy properties, the Java 5 document says '*' can be > used as wild card character for matching, as below > > "http.nonProxyHosts indicates the hosts which should be connected too > directly and not through the proxy server. The value can be a list of > hosts, each seperated by a |, and in addition a wild card character (*) > can be used for matching. For example: > -Dhttp.nonProxyHosts=3D"*.foo.com|localhost". " > > But RI's behavior looks strange. The wildcard character works only if > it's the first or last character in "host" String. Test case below shows > the details. Shall we make Harmony be compatible with RI? > > public void testNonProxyHosts() throws URISyntaxException { > ProxySelector selector =3D ProxySelector.getDefault(); > List proxyList; > Proxy proxy; > > // set http proxy > System.setProperty("http.proxyHost", "192.168.0.1"); > > // RI works as expected if '*' is the last character > System.setProperty("http.nonProxyHosts", "10.10.*"); > proxyList =3D selector.select(new URI("http://10.10.1.2")); > proxy =3D (Proxy) proxyList.get(0); > assertEquals(Proxy.NO_PROXY, proxy); > > // If '*' is neither the first character nor the last character, '= *' > // RI consider '*' as a common character instead of wild card > System.setProperty("http.nonProxyHosts", "10.10.*.2"); > proxyList =3D selector.select(new URI("http://10.10.*.2")); > proxy =3D (Proxy) proxyList.get(0); > assertEquals(Proxy.NO_PROXY, proxy); > > // the test below confirms that the '*' is not considered as > wild card > System.setProperty("http.nonProxyHosts", "10.10.*.2"); > proxyList =3D selector.select(new URI("http://10.10.1.2")); > proxy =3D (Proxy) proxyList.get(0); > assertEquals(Proxy.Type.HTTP, proxy.type()); > assertEquals("192.168.0.1:80", proxy.address().toString()); > } > > -- > Paulex Yang > China Software Development Lab > IBM > > >