[cp-patches] ObjectName.java: Handle 0-length names

Andrew Haley aph at redhat.com
Fri Mar 30 16:30:31 UTC 2007


Here's another one.  Verified by comparison with the Sun JDK.

Andrew.


2007-03-30  Andrew Haley  <aph at 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



More information about the Classpath-patches mailing list