diff options
Diffstat (limited to 'openjdk/sun')
-rw-r--r-- | openjdk/sun/management/ManagementFactoryHelper.java | 6 | ||||
-rw-r--r-- | openjdk/sun/nio/ch/DatagramChannelImpl.java | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/openjdk/sun/management/ManagementFactoryHelper.java b/openjdk/sun/management/ManagementFactoryHelper.java index 684a96b1..0e54032d 100644 --- a/openjdk/sun/management/ManagementFactoryHelper.java +++ b/openjdk/sun/management/ManagementFactoryHelper.java @@ -170,7 +170,8 @@ public class ManagementFactoryHelper { ObjectName result = objname; if (result == null) { synchronized (this) { - if (objname == null) { + result = objname; + if (result == null) { result = Util.newObjectName(LOGGING_MXBEAN_NAME); objname = result; } @@ -227,7 +228,8 @@ public class ManagementFactoryHelper { ObjectName result = objname; if (result == null) { synchronized (this) { - if (objname == null) { + result = objname; + if (result == null) { result = Util.newObjectName(BUFFER_POOL_MXBEAN_NAME + ",name=" + pool.getName()); objname = result; diff --git a/openjdk/sun/nio/ch/DatagramChannelImpl.java b/openjdk/sun/nio/ch/DatagramChannelImpl.java index 4fa9796e..a987bbc4 100644 --- a/openjdk/sun/nio/ch/DatagramChannelImpl.java +++ b/openjdk/sun/nio/ch/DatagramChannelImpl.java @@ -505,8 +505,15 @@ class DatagramChannelImpl int rem = (pos <= lim ? lim - pos : 0); boolean preferIPv6 = (family != StandardProtocolFamily.INET); - int written = send0(preferIPv6, fd, bb.array(), bb.arrayOffset() + pos, + int written; + try { + written = send0(preferIPv6, fd, bb.array(), bb.arrayOffset() + pos, rem, target); + } catch (PortUnreachableException pue) { + if (isConnected()) + throw pue; + written = rem; + } if (written > 0) bb.position(pos + written); return written; |