You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by gh...@apache.org on 2006/06/20 16:30:20 UTC

svn commit: r415654 - in /incubator/harmony/enhanced/classlib/trunk/modules/nio/src: main/java/org/apache/harmony/nio/internal/DatagramChannelImpl.java test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java

Author: gharley
Date: Tue Jun 20 07:30:19 2006
New Revision: 415654

URL: http://svn.apache.org/viewvc?rev=415654&view=rev
Log:
HARMONY-616 : Remove one FIXME from "receive(ByteBuffer)" method of org.apache.harmony.nio.internal.DatagramChannelImpl

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/DatagramChannelImpl.java
    incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/DatagramChannelImpl.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/DatagramChannelImpl.java?rev=415654&r1=415653&r2=415654&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/DatagramChannelImpl.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/org/apache/harmony/nio/internal/DatagramChannelImpl.java Tue Jun 20 07:30:19 2006
@@ -229,17 +229,6 @@
         checkOpen();
 
         if (!isBound) {
-            // FIXME RI seems does not perform as datagram socket
-            // SecurityManager security = System.getSecurityManager();
-            // if (security != null)
-            // security.checkListen(0);
-            // final byte[] any = new byte[] { 0, 0, 0, 0 };
-            // try {
-            // networkSystem.bind(fd, 0, InetAddress.getByAddress(any));
-            // } catch (UnknownHostException e) {
-            // // impossible,do nothing
-            // }
-            // isBound = true;
             return null;
         }
 
@@ -729,4 +718,4 @@
             super.disconnect();
         }
     }
-}
\ No newline at end of file
+}

Modified: incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java?rev=415654&r1=415653&r2=415654&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/org/apache/harmony/tests/java/nio/channels/DatagramChannelTest.java Tue Jun 20 07:30:19 2006
@@ -1354,8 +1354,9 @@
         // not bound
         sendByChannel("some normal string in testReceiveSend_Normal",
                 localAddr2);
-        ByteBuffer buf = ByteBuffer.wrap(new byte[CAPACITY_NORMAL]);
-        assertNull((InetSocketAddress) this.channel1.receive(buf));
+        ByteBuffer buf = ByteBuffer.allocate(CAPACITY_NORMAL);
+        assertNull(channel1.receive(buf));
+        assertFalse(channel1.socket().isBound());
     }
 
     public void testReceiveSend_NonBlock_NotBound() throws Exception {