mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8231921: (se) SelectorImpl.register does not need to set the attachment when it is null
Reviewed-by: bpb
This commit is contained in:
parent
f8f7cdcbe3
commit
51e94d8dac
2 changed files with 15 additions and 9 deletions
|
@ -208,7 +208,8 @@ public abstract class SelectorImpl
|
|||
if (!(ch instanceof SelChImpl))
|
||||
throw new IllegalSelectorException();
|
||||
SelectionKeyImpl k = new SelectionKeyImpl((SelChImpl)ch, this);
|
||||
k.attach(attachment);
|
||||
if (attachment != null)
|
||||
k.attach(attachment);
|
||||
|
||||
// register (if needed) before adding to key set
|
||||
implRegister(k);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue