void (URI uri, SocketAddress sa, IOException ioe) { LOG.info("connect failed to " + uri.toString() + ", sa: " + sa.toString(), ioe); final Map<String, ProxySelector> copy; synchronized (myLock) { copy = new HashMap<>(myCustom); } for (Map.Entry<String, ProxySelector> entry : copy.entrySet()) { entry.getValue().connectFailed(uri, sa, ioe); } }