From 187388328471411d1708b87aad332329131f9fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Prante?= Date: Fri, 22 Sep 2023 16:44:13 +0200 Subject: [PATCH] more work on nio event loop --- src/main/java/org/xbib/event/loop/nio/NioEventLoop.java | 5 +---- .../org/xbib/event/loop/nio/SelectedSelectionKeySet.java | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/org/xbib/event/loop/nio/NioEventLoop.java b/src/main/java/org/xbib/event/loop/nio/NioEventLoop.java index f0750ae..c44da14 100644 --- a/src/main/java/org/xbib/event/loop/nio/NioEventLoop.java +++ b/src/main/java/org/xbib/event/loop/nio/NioEventLoop.java @@ -136,11 +136,9 @@ public final class NioEventLoop extends SingleThreadEventLoop { } catch (IOException e) { throw new EventLoopException("failed to open a new selector", e); } - if (DISABLE_KEY_SET_OPTIMIZATION) { return new SelectorTuple(unwrappedSelector); } - Class maybeSelectorImplClass = null; try { maybeSelectorImplClass = Class.forName("sun.nio.ch.SelectorImpl", false, @@ -148,7 +146,6 @@ public final class NioEventLoop extends SingleThreadEventLoop { } catch (ClassNotFoundException e) { // } - // ensure the current selector implementation is what we can instrument. if (maybeSelectorImplClass == null || !maybeSelectorImplClass.isAssignableFrom(unwrappedSelector.getClass())) { return new SelectorTuple(unwrappedSelector); @@ -751,7 +748,7 @@ public final class NioEventLoop extends SingleThreadEventLoop { private static boolean isExplicitTryReflectionSetAccessible() { // we disable reflective access boolean defaultValue = javaVersion() < 9 || System.getProperties().containsKey("org.graalvm.nativeimage.imagecode"); - return Boolean.parseBoolean(System.getProperties().getProperty("io.netty.tryReflectionSetAccessible", + return Boolean.parseBoolean(System.getProperties().getProperty("org.xbib.tryReflectionSetAccessible", Boolean.toString(defaultValue))); } diff --git a/src/main/java/org/xbib/event/loop/nio/SelectedSelectionKeySet.java b/src/main/java/org/xbib/event/loop/nio/SelectedSelectionKeySet.java index 93021ae..ddc8aba 100644 --- a/src/main/java/org/xbib/event/loop/nio/SelectedSelectionKeySet.java +++ b/src/main/java/org/xbib/event/loop/nio/SelectedSelectionKeySet.java @@ -20,12 +20,10 @@ final class SelectedSelectionKeySet extends AbstractSet { if (o == null) { return false; } - keys[size++] = o; if (size == keys.length) { increaseCapacity(); } - return true; }