This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
ObjectName.java: Handle 0-length names
- From: Andrew Haley <aph at redhat dot com>
- To: classpath-patches <classpath-patches at gnu dot org>, java-patches at gcc dot gnu dot org
- Date: Fri, 30 Mar 2007 17:30:31 +0100
- Subject: ObjectName.java: Handle 0-length names
Here's another one. Verified by comparison with the Sun JDK.
Andrew.
2007-03-30 Andrew Haley <aph@redhat.com>
* javax/management/ObjectName.java: Handle 0-length names.
Index: ObjectName.java
===================================================================
--- ObjectName.java (revision 123156)
+++ ObjectName.java (working copy)
@@ -143,6 +143,9 @@
public ObjectName(String name)
throws MalformedObjectNameException
{
+ if (name.length() == 0)
+ name = "*:*";
+
int domainSep = name.indexOf(':');
if (domainSep == -1)
throw new MalformedObjectNameException("No domain separator was found.");
--
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903