Having the returned value be unmodifiable is optional,
so we fix PR30217 by removing the cast and the call
to Collections.unmodifiableMap.  The contents of the hashtable
will still be unaffected as the values will be copied to the
new one.

Changelog:

2006-12-22  Andrew John Hughes  <[EMAIL PROTECTED]>

        PR classpath/30217:
        * javax/management/ObjectName.java:
        (getKeyPropertyList()): Remove cast and call
        to UnmodifiableMap.

-- 
Andrew :-)

Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }
Index: javax/management/ObjectName.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/management/ObjectName.java,v
retrieving revision 1.2
diff -u -3 -p -u -r1.2 ObjectName.java
--- javax/management/ObjectName.java    27 Sep 2006 23:52:42 -0000      1.2
+++ javax/management/ObjectName.java    22 Dec 2006 17:52:31 -0000
@@ -565,16 +565,15 @@ public class ObjectName
   /**
    * Returns the properties in a [EMAIL PROTECTED] java.util.Hashtable}.  The 
table
    * contains each of the properties as keys mapped to their value.  The
-   * returned table may be unmodifiable.  If the case that the table is
-   * modifiable, changes made to it will not be reflected in the object
-   * name.
+   * returned table is not unmodifiable, but changes made to it will not
+   * be reflected in the object name.
    *
    * @return a [EMAIL PROTECTED] java.util.Hashtable}, containing each of the 
object
    *         name's properties.
    */
   public Hashtable getKeyPropertyList()
   {
-    return (Hashtable) Collections.unmodifiableMap(new Hashtable(properties));
+    return new Hashtable(properties);
   }
 
   /**

Attachment: signature.asc
Description: Digital signature

Reply via email to