@@ -166,21 +166,20 @@ private final List<IdleChannel> closeChannels(List<IdleChannel> candidates) {
166
166
List <IdleChannel > closedChannels = null ;
167
167
for (int i = 0 ; i < candidates .size (); i ++) {
168
168
IdleChannel idleChannel = candidates .get (i );
169
- if (!isChannelCloseable (idleChannel .channel ))
170
- if (isChannelCloseable (idleChannel .channel )) {
171
- LOGGER .debug ("Closing Idle Channel {}" , idleChannel .channel );
172
- close (idleChannel .channel );
173
- if (closedChannels != null ) {
174
- closedChannels .add (idleChannel );
175
- }
176
-
177
- } else if (closedChannels == null ) {
178
- // first non closeable to be skipped, copy all
179
- // previously skipped closeable channels
180
- closedChannels = new ArrayList <>(candidates .size ());
181
- for (int j = 0 ; j < i ; j ++)
182
- closedChannels .add (candidates .get (j ));
169
+ if (isChannelCloseable (idleChannel .channel )) {
170
+ LOGGER .debug ("Closing Idle Channel {}" , idleChannel .channel );
171
+ close (idleChannel .channel );
172
+ if (closedChannels != null ) {
173
+ closedChannels .add (idleChannel );
183
174
}
175
+
176
+ } else if (closedChannels == null ) {
177
+ // first non closeable to be skipped, copy all
178
+ // previously skipped closeable channels
179
+ closedChannels = new ArrayList <>(candidates .size ());
180
+ for (int j = 0 ; j < i ; j ++)
181
+ closedChannels .add (candidates .get (j ));
182
+ }
184
183
}
185
184
186
185
return closedChannels != null ? closedChannels : candidates ;
0 commit comments