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.