harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paulex Yang <paulex.y...@gmail.com>
Subject Re: Bug to bug compatibility: SocketChannel.socket().getLocalPort() returns 0 while Harmony returns -1
Date Thu, 22 Jun 2006 07:54:48 GMT
Andrew,

How the current Harmony codes looks like?

According to our compatibility guideline[1],  we should stick to Spec if 
it is clearly stated.

[1] 
http://incubator.apache.org/harmony/subcomponents/classlibrary/compat.html

Andrew Zhang wrote:
> 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!
>
>


-- 
Paulex Yang
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


Mime
View raw message