You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2005/08/31 12:30:50 UTC

svn commit: r265004 - /myfaces/api/trunk/src/java/javax/faces/component/_ComponentAttributesMap.java

Author: mmarinschek
Date: Wed Aug 31 03:30:46 2005
New Revision: 265004

URL: http://svn.apache.org/viewcvs?rev=265004&view=rev
Log:
fix for MYFACES-458

Modified:
    myfaces/api/trunk/src/java/javax/faces/component/_ComponentAttributesMap.java

Modified: myfaces/api/trunk/src/java/javax/faces/component/_ComponentAttributesMap.java
URL: http://svn.apache.org/viewcvs/myfaces/api/trunk/src/java/javax/faces/component/_ComponentAttributesMap.java?rev=265004&r1=265003&r2=265004&view=diff
==============================================================================
--- myfaces/api/trunk/src/java/javax/faces/component/_ComponentAttributesMap.java (original)
+++ myfaces/api/trunk/src/java/javax/faces/component/_ComponentAttributesMap.java Wed Aug 31 03:30:46 2005
@@ -75,7 +75,7 @@
 
     public boolean containsKey(Object key)
     {
-        checkKeyAndValue(key);
+        checkKey(key);
         if (getPropertyDescriptor((String)key) == null)
         {
             return _attributes.containsKey(key);
@@ -120,7 +120,7 @@
 
     public Object get(Object key)
     {
-        checkKeyAndValue(key);
+        checkKey(key);
         PropertyDescriptor propertyDescriptor
            = getPropertyDescriptor((String)key);
         if (propertyDescriptor != null)
@@ -142,7 +142,7 @@
 
     public Object remove(Object key)
     {
-        checkKeyAndValue(key);
+        checkKey(key);
         PropertyDescriptor propertyDescriptor = getPropertyDescriptor((String)key);
         if (propertyDescriptor != null)
         {
@@ -157,7 +157,7 @@
      */
     public Object put(Object key, Object value)
     {
-        checkKeyAndValue(key);
+        checkKeyAndValue(key, value);
         PropertyDescriptor propertyDescriptor = getPropertyDescriptor((String)key);
         if (propertyDescriptor != null)
         {
@@ -249,8 +249,13 @@
 
     private void checkKeyAndValue(Object key, Object value)
     {
-        if (key == null) throw new NullPointerException("key");
         if (value == null) throw new NullPointerException("value");
+        checkKey(key);
+    }
+
+    private void checkKey(Object key)
+    {
+        if (key == null) throw new NullPointerException("key");
         if (!(key instanceof String)) throw new ClassCastException("key is not a String");
     }