@Test public void testIndexOverflow() { final SingleCoreIOReactor reactor = new SingleCoreIOReactor(null, mock(IOEventHandlerFactory.class), IOReactorConfig.DEFAULT, null, null, null); final IOWorkers.Selector selector = IOWorkers.newSelector(new SingleCoreIOReactor[]{reactor, reactor, reactor}); for (long i = 0; i < (long) Integer.MAX_VALUE + 10; i++) { selector.next(); } }
static Selector newSelector(final SingleCoreIOReactor[] dispatchers) { return isPowerOfTwo(dispatchers.length) ? new PowerOfTwoSelector(dispatchers) : new GenericSelector(dispatchers); }
IOWorkers { static Selector newSelector(final SingleCoreIOReactor[] dispatchers) { return isPowerOfTwo(dispatchers.length) ? new PowerOfTwoSelector(dispatchers) : new GenericSelector(dispatchers); } }
IOWorkers { static Selector newSelector(final SingleCoreIOReactor[] dispatchers) { return isPowerOfTwo(dispatchers.length) ? new PowerOfTwoSelector(dispatchers) : new GenericSelector(dispatchers); }  }
IOWorkers { static Selector newSelector(final SingleCoreIOReactor[] dispatchers) { return isPowerOfTwo(dispatchers.length) ? new PowerOfTwoSelector(dispatchers) : new GenericSelector(dispatchers); }   }
IOWorkers { static Selector newSelector(final SingleCoreIOReactor[] dispatchers) { return isPowerOfTwo(dispatchers.length) ? new PowerOfTwoSelector(dispatchers) : new GenericSelector(dispatchers); }    }