diff -r 4e1939e6e6b5 -r 392dd6db361a jdk/src/share/classes/javax/management/namespace/JMXDomain.java --- a/jdk/src/share/classes/javax/management/namespace/JMXDomain.java Tue Dec 09 19:44:22 2008 +0100 +++ b/jdk/src/share/classes/javax/management/namespace/JMXDomain.java Tue Dec 09 20:20:48 2008 +0100 @@ -35,7 +35,6 @@ import javax.management.InstanceNotFoundException; import javax.management.MBeanServer; import javax.management.MBeanServerDelegate; -import javax.management.MalformedObjectNameException; import javax.management.ObjectName; /** @@ -291,12 +290,9 @@ public static ObjectName getDomainObjectName(String domain) { if (domain == null) return null; if (domain.contains(NAMESPACE_SEPARATOR)) - throw new IllegalArgumentException(domain); - try { - return ObjectName.getInstance(domain, "type", TYPE); - } catch (MalformedObjectNameException x) { - throw new IllegalArgumentException(domain,x); - } + throw new IllegalArgumentException("domain contains " + + NAMESPACE_SEPARATOR+": "+domain); + return ObjectName.valueOf(domain, "type", TYPE); }