harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r711495 - in /harmony/enhanced/classlib/trunk/modules/nio/src: main/java/common/java/nio/channels/spi/AbstractSelectableChannel.java test/java/common/org/apache/harmony/nio/tests/java/nio/channels/spi/AbstractSelectableChannelTest.java
Date Wed, 05 Nov 2008 02:30:17 GMT
Author: tellison
Date: Tue Nov  4 18:30:16 2008
New Revision: 711495

URL: http://svn.apache.org/viewvc?rev=711495&view=rev
Log:
Allow specifying selectors that have an empty interest set.
See http://markmail.org/message/avkiv3kmcv2zvn2v

Modified:
    harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelectableChannel.java
    harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/spi/AbstractSelectableChannelTest.java

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelectableChannel.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelectableChannel.java?rev=711495&r1=711494&r2=711495&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelectableChannel.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/java/nio/channels/spi/AbstractSelectableChannel.java
Tue Nov  4 18:30:16 2008
@@ -132,10 +132,6 @@
                 // throw NPE exactly to keep consistency
                 throw new NullPointerException();
             }
-            if (0 == interestSet) {
-                // throw ISE exactly to keep consistency
-                throw new IllegalSelectorException();
-            }
             SelectionKey key = keyFor(selector);
             if (null == key) {
                 key = ((AbstractSelector) selector).register(this, interestSet,

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/spi/AbstractSelectableChannelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/spi/AbstractSelectableChannelTest.java?rev=711495&r1=711494&r2=711495&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/spi/AbstractSelectableChannelTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/spi/AbstractSelectableChannelTest.java
Tue Nov  4 18:30:16 2008
@@ -120,6 +120,15 @@
         //test that sc.register invokes Selector.register()
         acceptKey = sc.register(acceptSelector2, SelectionKey.OP_READ, null);
         assertNull(acceptKey);
+        
+        // Regression test to ensure acceptance of a selector with empty
+        // interest set.
+        SocketChannel channel = SocketChannel.open();
+        channel.configureBlocking(false);
+        Selector selector = Selector.open();
+        channel.register(selector, 0);
+        selector.close();
+        channel.close();
     }
 
     /**



Mime
View raw message