FYI: A third javax.management fix

Gary Benson gbenson@redhat.com
Thu Feb 15 09:16:00 GMT 2007


Hi all,

Tomcat is failing with Classpath's javax.management because it assumes
the result of javax.management.ObjectName.toString() is a valid string
representation of the item.  This patch makes our toString() return
the canonical representation.

Cheers,
Gary
-------------- next part --------------
Index: ChangeLog.gcj
===================================================================
--- ChangeLog.gcj	(revision 121955)
+++ ChangeLog.gcj	(working copy)
@@ -1,3 +1,8 @@
+2007-02-14  Gary Benson  <gbenson@redhat.com>
+
+	* javax/management/ObjectName.java
+	(toString): Return this item's canonical name.
+
 2007-02-12  Tom Tromey  <tromey@redhat.com>
 
 	* java/util/Collections.java (UnmodifiableMap.toArray): Imported
Index: javax/management/ObjectName.java
===================================================================
--- javax/management/ObjectName.java	(revision 121955)
+++ javax/management/ObjectName.java	(working copy)
@@ -1,5 +1,5 @@
 /* ObjectName.java -- Represent the name of a bean, or a pattern for a name.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -716,19 +716,18 @@
 
   /**
    * Returns a textual representation of the object name.
-   * The format is unspecified, but it should be expected that
-   * two equivalent object names will return the same string
-   * from this method.
    *
+   * <p>The format is unspecified beyond that equivalent object
+   * names will return the same string from this method, but note
+   * that Tomcat depends on the string returned by this method
+   * being a valid textual representation of the object name and
+   * will fail to start if it is not.
+   *
    * @return a textual representation of the object name.
    */
   public String toString()
   {
-    return getClass().toString() +
-      "[domain = " + domain +
-      ",properties = " + properties +
-      ",propertyPattern = " + propertyPattern +
-      "]";
+    return getCanonicalName();
   }
 
   /**


More information about the Java-patches mailing list