harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Regis <xu.re...@gmail.com>
Subject Re: svn commit: r824625 - in /harmony/enhanced/classlib/trunk/modules/nio/src: main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SelectorTest.java
Date Tue, 13 Oct 2009 08:20:45 GMT
regisxu@apache.org wrote:
> Author: regisxu
> Date: Tue Oct 13 07:35:56 2009
> New Revision: 824625
> 
> URL: http://svn.apache.org/viewvc?rev=824625&view=rev
> Log:
> return value of Selector.select() should be same with selectedKeys.size()
> 
> Modified:
>     harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java
>     harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SelectorTest.java
> 
> Modified: harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java?rev=824625&r1=824624&r2=824625&view=diff
> ==============================================================================
> --- harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java
(original)
> +++ harmony/enhanced/classlib/trunk/modules/nio/src/main/java/common/org/apache/harmony/nio/internal/SelectorImpl.java
Tue Oct 13 07:35:56 2009
> @@ -496,7 +496,10 @@
>  
>                      doCancel();
>  
> -                    return selected;
> +                    if (selected != 0) {
> +                        return selectedKeys.size();
> +                    }
> +                    return 0;
>                  }
>              }
>          }
> 
> Modified: harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SelectorTest.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/SelectorTest.java?rev=824625&r1=824624&r2=824625&view=diff
> ==============================================================================
> --- harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SelectorTest.java
(original)
> +++ harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SelectorTest.java
Tue Oct 13 07:35:56 2009
> @@ -398,6 +398,7 @@
>          thread.start();
>          do {
>              assertEquals(0, selector.select(5000)); // blocks
> +            assertEquals(0, selector.selectedKeys().size());
>          } while (!complete.get()); // avoid spurious interrupts
>          assertFalse(key.isValid());
>  
> 
> 
> 

This commit is incorrect and causes SelectorTest failed on Windows, I'll fix it 
soon.

-- 
Best Regards,
Regis.

Mime
View raw message