--- old/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java 2015-11-13 17:39:24.000000000 +0100 +++ new/src/java.management/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java 2015-11-13 17:39:24.000000000 +0100 @@ -535,6 +535,10 @@ synchronized (ClientNotifForwarder.this) { currentFetchThread = null; + if (nr != null && !shouldStop()) { + executor.execute(this); + return; + } } if (nr == null) { @@ -544,21 +548,18 @@ + "notification server is terminated."); } } - if (nr == null || shouldStop()) { - // tell that the thread is REALLY stopped - setState(STOPPED); - - try { - removeListenerForMBeanRemovedNotif(mbeanRemovedNotifID); - } catch (Exception e) { - if (logger.traceOn()) { - logger.trace("NotifFetcher-run", - "removeListenerForMBeanRemovedNotif", e); - } + + try { + removeListenerForMBeanRemovedNotif(mbeanRemovedNotifID); + } catch (Exception e) { + if (logger.traceOn()) { + logger.trace("NotifFetcher-run", + "removeListenerForMBeanRemovedNotif", e); } - } else { - executor.execute(this); } + + // tell that the thread is REALLY stopped + setState(STOPPED); } void dispatchNotification(TargetedNotification tn,