You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Andrew Zhang (JIRA)" <ji...@apache.org> on 2006/07/17 09:45:14 UTC
[jira] Created: (HARMONY-889) [classlib][nio]
SocketChannel.socket().getInputStream/getOutputStream should delegate all
of its operations to the associated channel.
[classlib][nio] SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
---------------------------------------------------------------------------------------------------------------------------------------
Key: HARMONY-889
URL: http://issues.apache.org/jira/browse/HARMONY-889
Project: Harmony
Issue Type: Bug
Components: Classlib
Reporter: Andrew Zhang
SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
Currently, Harmony's implementation doesn't delegate the operations to channel, but to super.getInputStream/getOutputStream.
Following test reproduces a bug caused by current implementation:
public void test_getOutputStream() throws Exception {
ServerSocket ss = new ServerSocket(0);
SocketChannel sc = SocketChannel.open();
sc.connect(new InetSocketAddress("127.0.0.1", ss.getLocalPort()));
OutputStream os = sc.socket().getOutputStream();
os.close();
try {
os.write(1);
fail("should throw ClosedChannelException");
} catch (ClosedChannelException e) {
// expected
}
}
The test passes against RI while fails against Harmony.
I'll upload a patch to fix this problem and supplement more tests.
Thanks.
Best regards,
Andrew
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (HARMONY-889) [classlib][nio]
SocketChannel.socket().getInputStream/getOutputStream should delegate all
of its operations to the associated channel.
Posted by "Andrew Zhang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-889?page=comments#action_12421762 ]
Andrew Zhang commented on HARMONY-889:
--------------------------------------
Hello George,
The fix looks good. Many thanks!
Best regards,
Andrew
> [classlib][nio] SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-889
> URL: http://issues.apache.org/jira/browse/HARMONY-889
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Andrew Zhang
> Assigned To: George Harley
> Attachments: nio.diff
>
>
> SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> Currently, Harmony's implementation doesn't delegate the operations to channel, but to super.getInputStream/getOutputStream.
> Following test reproduces a bug caused by current implementation:
> public void test_getOutputStream() throws Exception {
> ServerSocket ss = new ServerSocket(0);
> SocketChannel sc = SocketChannel.open();
> sc.connect(new InetSocketAddress("127.0.0.1", ss.getLocalPort()));
> OutputStream os = sc.socket().getOutputStream();
> os.close();
> try {
> os.write(1);
> fail("should throw ClosedChannelException");
> } catch (ClosedChannelException e) {
> // expected
> }
> }
> The test passes against RI while fails against Harmony.
> I'll upload a patch to fix this problem and supplement more tests.
> Thanks.
> Best regards,
> Andrew
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (HARMONY-889) [classlib][nio]
SocketChannel.socket().getInputStream/getOutputStream should delegate all
of its operations to the associated channel.
Posted by "Andrew Zhang (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-889?page=all ]
Andrew Zhang updated HARMONY-889:
---------------------------------
Attachment: nio.diff
Hello,
Would you please try my patch? Thanks!
The patch fixes following problems:
1. Revise SocketChannelInputStream and SocketChannelOutputStream, delegate all operations to the associated channel according to spec.
2. An exception thrown compatibility bug.
Best regards,
Andrew
> [classlib][nio] SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-889
> URL: http://issues.apache.org/jira/browse/HARMONY-889
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Andrew Zhang
> Attachments: nio.diff
>
>
> SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> Currently, Harmony's implementation doesn't delegate the operations to channel, but to super.getInputStream/getOutputStream.
> Following test reproduces a bug caused by current implementation:
> public void test_getOutputStream() throws Exception {
> ServerSocket ss = new ServerSocket(0);
> SocketChannel sc = SocketChannel.open();
> sc.connect(new InetSocketAddress("127.0.0.1", ss.getLocalPort()));
> OutputStream os = sc.socket().getOutputStream();
> os.close();
> try {
> os.write(1);
> fail("should throw ClosedChannelException");
> } catch (ClosedChannelException e) {
> // expected
> }
> }
> The test passes against RI while fails against Harmony.
> I'll upload a patch to fix this problem and supplement more tests.
> Thanks.
> Best regards,
> Andrew
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (HARMONY-889) [classlib][nio]
SocketChannel.socket().getInputStream/getOutputStream should delegate all
of its operations to the associated channel.
Posted by "George Harley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-889?page=all ]
George Harley resolved HARMONY-889.
-----------------------------------
Resolution: Fixed
Hi Andrew,
Patch committed in revision 422702. Please could you verify that it has been applied as expected.
Many thanks for this enhancement.
Best regards,
George
> [classlib][nio] SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-889
> URL: http://issues.apache.org/jira/browse/HARMONY-889
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Andrew Zhang
> Assigned To: George Harley
> Attachments: nio.diff
>
>
> SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> Currently, Harmony's implementation doesn't delegate the operations to channel, but to super.getInputStream/getOutputStream.
> Following test reproduces a bug caused by current implementation:
> public void test_getOutputStream() throws Exception {
> ServerSocket ss = new ServerSocket(0);
> SocketChannel sc = SocketChannel.open();
> sc.connect(new InetSocketAddress("127.0.0.1", ss.getLocalPort()));
> OutputStream os = sc.socket().getOutputStream();
> os.close();
> try {
> os.write(1);
> fail("should throw ClosedChannelException");
> } catch (ClosedChannelException e) {
> // expected
> }
> }
> The test passes against RI while fails against Harmony.
> I'll upload a patch to fix this problem and supplement more tests.
> Thanks.
> Best regards,
> Andrew
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (HARMONY-889) [classlib][nio]
SocketChannel.socket().getInputStream/getOutputStream should delegate all
of its operations to the associated channel.
Posted by "George Harley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-889?page=all ]
George Harley reassigned HARMONY-889:
-------------------------------------
Assignee: George Harley
> [classlib][nio] SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-889
> URL: http://issues.apache.org/jira/browse/HARMONY-889
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Andrew Zhang
> Assigned To: George Harley
> Attachments: nio.diff
>
>
> SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> Currently, Harmony's implementation doesn't delegate the operations to channel, but to super.getInputStream/getOutputStream.
> Following test reproduces a bug caused by current implementation:
> public void test_getOutputStream() throws Exception {
> ServerSocket ss = new ServerSocket(0);
> SocketChannel sc = SocketChannel.open();
> sc.connect(new InetSocketAddress("127.0.0.1", ss.getLocalPort()));
> OutputStream os = sc.socket().getOutputStream();
> os.close();
> try {
> os.write(1);
> fail("should throw ClosedChannelException");
> } catch (ClosedChannelException e) {
> // expected
> }
> }
> The test passes against RI while fails against Harmony.
> I'll upload a patch to fix this problem and supplement more tests.
> Thanks.
> Best regards,
> Andrew
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (HARMONY-889) [classlib][nio]
SocketChannel.socket().getInputStream/getOutputStream should delegate all
of its operations to the associated channel.
Posted by "George Harley (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/HARMONY-889?page=all ]
George Harley closed HARMONY-889.
---------------------------------
Verified by Andrew.
> [classlib][nio] SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> --------------------------------------------------------------------------------------------------------------------------------------
>
> Key: HARMONY-889
> URL: http://issues.apache.org/jira/browse/HARMONY-889
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Andrew Zhang
> Assigned To: George Harley
> Attachments: nio.diff
>
>
> SocketChannel.socket().getInputStream/getOutputStream should delegate all of its operations to the associated channel.
> Currently, Harmony's implementation doesn't delegate the operations to channel, but to super.getInputStream/getOutputStream.
> Following test reproduces a bug caused by current implementation:
> public void test_getOutputStream() throws Exception {
> ServerSocket ss = new ServerSocket(0);
> SocketChannel sc = SocketChannel.open();
> sc.connect(new InetSocketAddress("127.0.0.1", ss.getLocalPort()));
> OutputStream os = sc.socket().getOutputStream();
> os.close();
> try {
> os.write(1);
> fail("should throw ClosedChannelException");
> } catch (ClosedChannelException e) {
> // expected
> }
> }
> The test passes against RI while fails against Harmony.
> I'll upload a patch to fix this problem and supplement more tests.
> Thanks.
> Best regards,
> Andrew
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira