8343838: Test EmptyDomainNotificationTest.java fails with ListenerNotFoundException

Reviewed-by: dholmes
This commit is contained in:
Kevin Walls 2024-11-11 12:26:38 +00:00
parent 36e12955b2
commit 5016132291
2 changed files with 13 additions and 3 deletions

View File

@ -162,10 +162,22 @@ public class ServerNotifForwarder {
connectionId, name, getSubject());
}
// 6238731: set the default domain if no domain is set.
ObjectName nn = name;
if (name.getDomain() == null || name.getDomain().isEmpty()) {
try {
nn = ObjectName.getInstance(mbeanServer.getDefaultDomain(),
name.getKeyPropertyList());
} catch (MalformedObjectNameException mfoe) {
// impossible, but...
throw new IOException(mfoe.getMessage(), mfoe);
}
}
Exception re = null;
for (int i = 0 ; i < listenerIDs.length ; i++) {
try {
removeNotificationListener(name, listenerIDs[i]);
removeNotificationListener(nn, listenerIDs[i]);
} catch (Exception e) {
// Give back the first exception
//

View File

@ -563,8 +563,6 @@ javax/management/monitor/DerivedGaugeMonitorTest.java 8042211 generic-
javax/management/remote/mandatory/connection/BrokenConnectionTest.java 8262312 linux-all
javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java 8343838 generic-all
############################################################################
# jdk_net