--- old/src/java.base/windows/classes/sun/nio/ch/WindowsSelectorImpl.java 2018-02-07 11:23:43.000000000 +0000 +++ new/src/java.base/windows/classes/sun/nio/ch/WindowsSelectorImpl.java 2018-02-07 11:23:43.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,6 @@ import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; /** * A multi-threaded implementation of Selector for Windows. @@ -60,7 +59,7 @@ // array, where the corresponding entry is occupied by the wakeupSocket private SelectionKeyImpl[] channelArray = new SelectionKeyImpl[INIT_CAP]; - // The global native poll array holds file decriptors and event masks + // The global native poll array holds file descriptors and event masks private PollArrayWrapper pollWrapper; // The number of valid entries in poll array, including entries occupied @@ -81,7 +80,7 @@ private final int wakeupSourceFd, wakeupSinkFd; // Lock for close cleanup - private Object closeLock = new Object(); + private final Object closeLock = new Object(); // Maps file descriptors to their indices in pollArray private static final class FdMap extends HashMap { @@ -520,7 +519,7 @@ } pollWrapper.free(); pollWrapper = null; - selectedKeys = null; + selectedKeys.clear(); channelArray = null; // Make all remaining helper threads exit for (SelectThread t: threads)