This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]