harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jimmy, Jing Lv" <firep...@gmail.com>
Subject [classlib] imcompatible with RI?
Date Thu, 27 Jul 2006 03:34:49 GMT
Hi:
     I find that RI behaves strange in 
java.nio.channels.SelectableChannel.register. in NIO, channels and 
selector must be created by Provider. The doc reads: (Invoking 
register() should throw) "IllegalSelectorException - If this channel was 
not created by the same provider as the given selector". To check if the 
two providers are the same, Harmony use 
"if(selector.provider()==selector.provider)... ", however it seems not 
correct.
     If we mock a channel extends SelectableChannel, put the same 
provider of selector as its provider, and register this channel to 
selector, RI fails with a IllegalSelectorException though two providers 
are the same. I have no idea if how RI do without checking providers are 
the same?
     Another thing is that if a selector has no channels register on it, 
invoke an operation of select() surely has nothing to do. In this way, 
Harmony returns immediately even invoking a block select(), however RI 
wait forever there, for nothing. I think Harmony's behavior is logical, 
but not compatible with RI. It seems a bug of RI, I suggest keep it as 
it is.

-- 

Best Regards!

Jimmy, Jing Lv
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