I fixed the putClientProperty method, so that if a null value is specified, the corresponding key is removed from the Hashtable. Otherwise we would get a NPE here.

2005-07-21  Roman Kennke  <[EMAIL PROTECTED]>

       * javax/swing/JComponent.java
       (putClientProperty): If value == null, remove the key from the
       Hashtable, otherwise we would get an NPE here.

/Roman

Index: javax/swing/JComponent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComponent.java,v
retrieving revision 1.53
diff -u -r1.53 JComponent.java
--- javax/swing/JComponent.java 21 Jul 2005 08:26:09 -0000      1.53
+++ javax/swing/JComponent.java 21 Jul 2005 14:31:43 -0000
@@ -451,7 +451,10 @@
    */
   public final void putClientProperty(Object key, Object value)
   {
-    getClientProperties().put(key, value);
+    if (value != null)
+      getClientProperties().put(key, value);
+    else
+      getClientProperties().remove(key);
   }
 
   /**
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to