Skip to content

Commit 5016132

Browse files
committed
8343838: Test EmptyDomainNotificationTest.java fails with ListenerNotFoundException
Reviewed-by: dholmes
1 parent 36e1295 commit 5016132

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/java.management/share/classes/com/sun/jmx/remote/internal/ServerNotifForwarder.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,22 @@ public void removeNotificationListener(ObjectName name,
162162
connectionId, name, getSubject());
163163
}
164164

165+
// 6238731: set the default domain if no domain is set.
166+
ObjectName nn = name;
167+
if (name.getDomain() == null || name.getDomain().isEmpty()) {
168+
try {
169+
nn = ObjectName.getInstance(mbeanServer.getDefaultDomain(),
170+
name.getKeyPropertyList());
171+
} catch (MalformedObjectNameException mfoe) {
172+
// impossible, but...
173+
throw new IOException(mfoe.getMessage(), mfoe);
174+
}
175+
}
176+
165177
Exception re = null;
166178
for (int i = 0 ; i < listenerIDs.length ; i++) {
167179
try {
168-
removeNotificationListener(name, listenerIDs[i]);
180+
removeNotificationListener(nn, listenerIDs[i]);
169181
} catch (Exception e) {
170182
// Give back the first exception
171183
//

test/jdk/ProblemList.txt

-2
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,6 @@ javax/management/monitor/DerivedGaugeMonitorTest.java 8042211 generic-
563563

564564
javax/management/remote/mandatory/connection/BrokenConnectionTest.java 8262312 linux-all
565565

566-
javax/management/remote/mandatory/notif/EmptyDomainNotificationTest.java 8343838 generic-all
567-
568566
############################################################################
569567

570568
# jdk_net

0 commit comments

Comments
 (0)