diff --git a/src/share/classes/sun/nio/ch/Util.java b/src/share/classes/sun/nio/ch/Util.java index 73b66e072962775da72610b95a2f134c51c79055..da9c3344ca76805ba32a0eb02237ddcdaca64068 100644 --- a/src/share/classes/sun/nio/ch/Util.java +++ b/src/share/classes/sun/nio/ch/Util.java @@ -142,11 +142,10 @@ class Util { || ((sel = selWrapper.get()) == null) || (sel.provider() != sc.provider())) { sel = sc.provider().openSelector(); - localSelector.set(new SoftReference( - new SelectorWrapper(sel))); - } else { - localSelectorWrapper.set(selWrapper); + selWrapper = new SelectorWrapper(sel); + localSelector.set(new SoftReference(selWrapper)); } + localSelectorWrapper.set(selWrapper); return sel; }