Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 34242 invoked from network); 22 Jun 2006 14:46:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jun 2006 14:46:50 -0000 Received: (qmail 56040 invoked by uid 500); 22 Jun 2006 14:46:46 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 55994 invoked by uid 500); 22 Jun 2006 14:46:46 -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 55983 invoked by uid 99); 22 Jun 2006 14:46:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 07:46:46 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mloenko@gmail.com designates 64.233.184.234 as permitted sender) Received: from [64.233.184.234] (HELO wr-out-0506.google.com) (64.233.184.234) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2006 07:46:45 -0700 Received: by wr-out-0506.google.com with SMTP id i3so415833wra for ; Thu, 22 Jun 2006 07:46:24 -0700 (PDT) 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=r99X2XRDlYp6ZsstimdrdC08vPfirEeS+/uYNg7YqgFKrydJ2p5PA66uFrbkKJZuzULdKlhP8QDwgvtPdX0iXAzFGoLmtOQRsTC2seLmZAvJGfZNR3QIqPlq/GERW6Kh2F+kdgii+oHtTnvhzA+HLiZvvpemMHJSOSqbeLIPfLU= Received: by 10.54.104.18 with SMTP id b18mr3442777wrc; Thu, 22 Jun 2006 07:46:24 -0700 (PDT) Received: by 10.70.28.12 with HTTP; Thu, 22 Jun 2006 07:46:23 -0700 (PDT) Message-ID: <906dd82e0606220746x78eceb06g9cfd857af568e613@mail.gmail.com> Date: Thu, 22 Jun 2006 21:46:23 +0700 From: "Mikhail Loenko" To: harmony-dev@incubator.apache.org Subject: Re: Bug to bug compatibility: SocketChannel.socket().getLocalPort() returns 0 while Harmony returns -1 In-Reply-To: <4d0b24970606220042w47590be6ha6c8b6bc93daa9ba@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4d0b24970606220042w47590be6ha6c8b6bc93daa9ba@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Andrew, have you noticed, does RI return 0 for any unbound socket or only for the sockets obtained from SocketChannel? Thanks, Mikhail 2006/6/22, Andrew Zhang : > Hi everybody, > > I found a bug of SocketChannel.socket() of RI. > > Consider following test case: > > public void test_socket() throws IOException { > SocketChannel sc = SocketChannel.open(); > Socket socket = sc.socket(); > assertFalse(socket.isBound()); > // RI returns 0 instead of -1 here. > assertEquals(-1, socket.getLocalPort()); > } > > RI 1.5 fails while Harmony passes. > > "returns the local port number to which this socket is bound or -1 if the > socket is not bound yet." That's how spec describes getLocalPort method. > > RI returns 0 for an unbound socket, violates spec apparently. > > How shall we deal with this bug to bug compatibility? > > Any suggestions? Thank you very much! > > > -- > Andrew Zhang > China Software Development Lab, IBM > > --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org