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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]