Gary Benson wrote:
> 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. Ours isn't, but I guess
> Sun's and MX4J's must or they'd be failing too. The javadoc does
> not specify the format of the returned string except to say that
> users can expect it to be the same for equivalent ObjectNames.
>
> This patch makes our toString() return the canonical representation.
Committed.
Cheers,
Gary
Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.9108
diff -u -r1.9108 ChangeLog
--- ChangeLog 12 Feb 2007 21:39:20 -0000 1.9108
+++ ChangeLog 13 Feb 2007 14:41:44 -0000
@@ -1,3 +1,8 @@
+2007-02-13 Gary Benson <[EMAIL PROTECTED]>
+
+ * javax/management/ObjectName.java
+ (toString): Return this item's canonical name.
+
2007-02-12 Francis Kung <[EMAIL PROTECTED]>
* gnu/java/awt/ClasspathToolkit.java:
Index: javax/management/ObjectName.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/management/ObjectName.java,v
retrieving revision 1.4
diff -u -r1.4 ObjectName.java
--- javax/management/ObjectName.java 9 Feb 2007 17:23:30 -0000 1.4
+++ javax/management/ObjectName.java 13 Feb 2007 14:41:44 -0000
@@ -715,19 +715,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();
}
/**