src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java
Print this page
@@ -146,11 +146,11 @@
/** maps an endpoint key containing custom socket factories to
* their own unique endpoint */
// TBD: should this be a weak hash table?
private static final
Map<TCPEndpoint,LinkedList<TCPEndpoint>> localEndpoints =
- new HashMap<TCPEndpoint,LinkedList<TCPEndpoint>>();
+ new HashMap<>();
/**
* Create an endpoint for a specified host and port.
* This should not be used by external classes to create endpoints
* for servers in this VM; use getLocalEndpoint instead.
@@ -621,14 +621,13 @@
} catch (IOException e) {
// We might have simply run out of file descriptors
try {
TCPEndpoint.shedConnectionCaches();
// REMIND: should we retry createSocket?
- } catch (OutOfMemoryError mem) {
+ } catch (OutOfMemoryError | Exception mem) {
// don't quit if out of memory
- } catch (Exception ex) {
- // don't quit if shed fails non-catastrophically
+ // or shed fails non-catastrophically
}
throw new ConnectIOException("Exception creating connection to: " +
host, e);
}