[bug] sun.nio.ch.WindowsSelectorImpl uses Pipe.open

Matthias-Christian Ott ott at mirix.org
Thu Dec 3 10:54:03 UTC 2015


Expected behaviour:
sun.nio.ch.WindowsSelectorImpl#wakeup works if
sun.nio.ch.WindowsSelectorProvider is not the provider for
java.nio.channels.Pipe#open.

Actual behaviour:
sun.nio.ch.WindowsSelectorImpl#WindowsSelectorImpl uses
java.nio.channels.Pipe#open to create a pipe for
java.nio.Selector#wakeup and then casts the Pipe to sun.nio.ch.SelChImpl
to get its file descriptor. If sun.nio.ch.WindowsSelectorProvider is not
the provider that creates the pipe through Pipe#open the Pipe object
might not be castable to SelChImpl and also the file descriptor is very
likely meaningless to WindowsSelectorImpl.

Suggested fix:
WindowsSelectorImpl should call sun.nio.ch.PipeImpl directly.




More information about the core-libs-dev mailing list