Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 45028 invoked from network); 20 May 2010 09:45:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 May 2010 09:45:48 -0000 Received: (qmail 3650 invoked by uid 500); 20 May 2010 09:45:47 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 3604 invoked by uid 500); 20 May 2010 09:45:46 -0000 Mailing-List: contact dev-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 dev@harmony.apache.org Received: (qmail 3595 invoked by uid 99); 20 May 2010 09:45:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 May 2010 09:45:46 +0000 X-ASF-Spam-Status: No, hits=-1.1 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of xu.regis@gmail.com designates 74.125.83.49 as permitted sender) Received: from [74.125.83.49] (HELO mail-gw0-f49.google.com) (74.125.83.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 May 2010 09:45:39 +0000 Received: by gwj15 with SMTP id 15so485458gwj.36 for ; Thu, 20 May 2010 02:45:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=pis9e1HsQD82SoHpOOiiqIBhbEguUlgyseHEG0Q6SuA=; b=Eh8RX2GURtPNtrSRb4EYGQYcuMMRVcb301j+OpbTZdX6A7GjCOztyYcupvJqv/XXAF KLpYGM5e68zyXcEWq5EhV5XzCZ3YzJVVTi1SE+H6eNhL7ex2wG5RpHkf7lU86dTbHpop KwDnRwHhGohcJQTrLQI5d+bwEbsgT2WZRSW0s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=V/q0i+BRYA4i5abMRcqV8SfViqiNMC4gTAzc/Ctc2GHxoemxzZ1Qkg9yC1tt51EU1u u03+b7/nNnCHMogw5HDhyw/u4IunQOEhwT03/fkGpzz2XQwMPYeuzUGEnXqNkoNLKjx0 Q9oGXGjbXAZyNzRP0ax4nQHjPIqsytlbL7mRY= Received: by 10.151.2.38 with SMTP id e38mr1231090ybi.78.1274348717195; Thu, 20 May 2010 02:45:17 -0700 (PDT) Received: from [9.123.237.184] ([220.248.0.145]) by mx.google.com with ESMTPS id p5sm8832560ybe.12.2010.05.20.02.45.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 20 May 2010 02:45:16 -0700 (PDT) Message-ID: <4BF504A6.3020902@gmail.com> Date: Thu, 20 May 2010 17:45:10 +0800 From: Regis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: [general] Code Freeze for Milestone 5.0M14 and 6.0M2 References: <201005142248.o4EMmGXL008475@d06av02.portsmouth.uk.ibm.com> <4BF3B231.301@googlemail.com> <4BF4EC09.3090407@gmail.com> <201005200846.o4K8kYKw030351@d06av04.portsmouth.uk.ibm.com> <4BF4F9A4.6050201@gmail.com> <201005200919.o4K9J8iZ025141@d12av01.megacenter.de.ibm.com> In-Reply-To: <201005200919.o4K9J8iZ025141@d12av01.megacenter.de.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2010-05-20 17:19, Mark Hindess wrote: > > In message<4BF4F9A4.6050201@gmail.com>, Regis writes: >> >> On 2010-05-20 16:46, Mark Hindess wrote: >>> >>> In message<4BF4EC09.3090407@gmail.com>, Regis writes: >>>> >>>> On 2010-05-19 20:45, Catherine Hope wrote: >>>>> I also see these 2 tests failing in the same way. It seems to be >>>>> caused by Regis' commit 944119 "SocketChannelImpl.SocketAdapter's >>>>> remote address should be updated after channel connected" on >>>>> 14/05/2010. It could be that the tests are invalid though - >>>>> the first one is checking that the SocketAddress returned by >>>>> getRemoteAddress() is a different object to the one that was passed >>>>> to connect(), though as SocketAddress is immutable would this cause >>>>> a problem? >>>>> >>>> >>>> The test case expect behaviors to be exactly same with RI, but I don't >>>> think it's a big deal, I intend to delete this assert. >>>> >>>> for - testSocket_NonBlock_BasicStatusAfterConnect, isConnected() >>>> should check first, following patch can fix it. And again, the test >>>> failed at same line as BasicStatusAfterConnect. >>>> >>>> Following patch can fix these failures, I'd like to commit it if >>>> second committer agree this. >>> >>> -1 >>> >>> I am +1 for the patch to SocketChannelImpl.java because this fixes >>> behaviour. >>> >>> However, I am -1 for the patch to SocketChannelTest.java because we >>> don't fix broken tests during code freeze. >> >> All right, how about this (create new InetSocketAddress instance everytime): > > -1 > > Fix the behaviour for testSocket_NonBlock_BasicStatusAfterConnect. > > Do not make any changes for the other failure - i.e. leave it failing - > and remove it after the code freeze. > > -Mark. > > > Do you mean this? Index: modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java ===================================================================== --- modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java +++ modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SocketChannelImpl.java @@ -1008,6 +1008,10 @@ class SocketChannelImpl extends SocketChannel implements FileDescriptorHandler { @Override public InetAddress getInetAddress() { + if (!isConnected()) { + return null; + } + if (channel.connectAddress == null && super.getInetAddress() != null) { channel.connectAddress = new InetSocketAddress(super.getInetAddress(), super.getPort()); } @@ -1019,6 +1023,9 @@ class SocketChannelImpl extends SocketChannel implements FileDescriptorHandler { @Override public SocketAddress getRemoteSocketAddress() { + if (!isConnected()) { + return null; + } if (channel.connectAddress == null && super.getInetAddress() != null) { channel.connectAddress = new InetSocketAddress(super.getInetAddress(), super.getPort()); } @@ -1027,6 +1034,9 @@ class SocketChannelImpl extends SocketChannel implements FileDescriptorHandler { @Override public int getPort() { + if (!isConnected()) { + return 0; + } if (channel.connectAddress == null && super.getInetAddress() != null) { channel.connectAddress = new InetSocketAddress(super.getInetAddress(), super.getPort()); } -- Best Regards, Regis.