Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 14047 invoked from network); 25 Sep 2010 07:14:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Sep 2010 07:14:00 -0000 Received: (qmail 5710 invoked by uid 500); 25 Sep 2010 07:14:00 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 5600 invoked by uid 500); 25 Sep 2010 07:13:58 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 5593 invoked by uid 99); 25 Sep 2010 07:13:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Sep 2010 07:13:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Sep 2010 07:13:56 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8P7DaO0010286 for ; Sat, 25 Sep 2010 07:13:36 GMT Message-ID: <2852675.398401285398816324.JavaMail.jira@thor> Date: Sat, 25 Sep 2010 03:13:36 -0400 (EDT) From: "Li Jing Qin (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-6656) [classlib][luni]HttpURLConnection.connect should throw ConnectException instead of IllegalArgumentException when the port is set to -1. In-Reply-To: <17402457.398381285398693406.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HARMONY-6656?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Li Jing Qin updated HARMONY-6656: --------------------------------- Attachment: HARMONY-6656.diff > [classlib][luni]HttpURLConnection.connect should throw ConnectException instead of IllegalArgumentException when the port is set to -1. > --------------------------------------------------------------------------------------------------------------------------------------- > > Key: HARMONY-6656 > URL: https://issues.apache.org/jira/browse/HARMONY-6656 > Project: Harmony > Issue Type: Bug > Components: Classlib > Affects Versions: 5.0M15 > Environment: All > Reporter: Li Jing Qin > Fix For: 5.0M16 > > Attachments: HARMONY-6656.diff > > > The root cause is we set port is -1. Below is the description: > 1. -1 is set to be the default port. For example, http will set port to 80, https will set port to 443. See org.apache.harmony.luni.internal.net.www.protocol.http.HttpConfiguration. > 2. The uri in the HttpConfiguration is from the url.toURI(). If the url's port is -1, url.toURI().getHost() will return null (as expected). > 3. The connection will new a InetSocketAddress, whose parameter will be host(null) and port(default port). This will cause a IllegalArgumentException. > What's in the patch: > 1. use uri.toURL().getHost() to get the orignal host instead of null. > 2. add the test case > 3. remove the unused code in the HttpConfiguration(URI uri, Proxy proxy). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.