equal
deleted
inserted
replaced
206 Object attachment) |
206 Object attachment) |
207 { |
207 { |
208 if (!(ch instanceof SelChImpl)) |
208 if (!(ch instanceof SelChImpl)) |
209 throw new IllegalSelectorException(); |
209 throw new IllegalSelectorException(); |
210 SelectionKeyImpl k = new SelectionKeyImpl((SelChImpl)ch, this); |
210 SelectionKeyImpl k = new SelectionKeyImpl((SelChImpl)ch, this); |
211 k.attach(attachment); |
211 if (attachment != null) |
|
212 k.attach(attachment); |
212 |
213 |
213 // register (if needed) before adding to key set |
214 // register (if needed) before adding to key set |
214 implRegister(k); |
215 implRegister(k); |
215 |
216 |
216 // add to the selector's key set, removing it immediately if the selector |
217 // add to the selector's key set, removing it immediately if the selector |