Author: sebb Date: Sat Aug 1 02:33:03 2009 New Revision: 799789 URL: http://svn.apache.org/viewvc?rev=799789&view=rev Log: JIRA: BSF-35 Wrong parameter type for [Simple]Bindings.put - key must be a String, not an object.
Modified: jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/Bindings.java jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleBindings.java Modified: jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/Bindings.java URL: http://svn.apache.org/viewvc/jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/Bindings.java?rev=799789&r1=799788&r2=799789&view=diff ============================================================================== --- jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/Bindings.java (original) +++ jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/Bindings.java Sat Aug 1 02:33:03 2009 @@ -42,7 +42,7 @@ * @throws ClassCastException if the key is not a String * @throws IllegalArgumentException if the key is an empty string */ - public Object put(Object key,Object value); + public Object put(String key, Object value); /** * Copies all of the mappings from the specified map to this map. @@ -57,7 +57,7 @@ * if some key in the map is an empty String * @throws ClassCastException if some key in the map is not a String */ - public void putAll(Map toMerge); + public void putAll(Map/*<? extends String,? extends Object>*/ toMerge); /** * Returns true if this map contains a mapping for the specified key. Modified: jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleBindings.java URL: http://svn.apache.org/viewvc/jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleBindings.java?rev=799789&r1=799788&r2=799789&view=diff ============================================================================== --- jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleBindings.java (original) +++ jakarta/bsf/trunk/bsf3/bsf-api/src/main/java/javax/script/SimpleBindings.java Sat Aug 1 02:33:03 2009 @@ -87,12 +87,6 @@ } } - /** {...@inheritdoc} */ - public Object put(Object key, Object value) { - validateKey(key); - return put((String) key, value); - } - /** * Associates the specified value with the specified key in a * java.util.Map. If the map previously contained a mapping for @@ -113,7 +107,7 @@ } /** {...@inheritdoc} */ - public void putAll(Map toMerge) { + public void putAll(Map/*<? extends String,? extends Object>*/ toMerge) { Set keySet= toMerge.keySet(); Iterator keys= keySet.iterator(); @@ -156,7 +150,7 @@ } /** {...@inheritdoc} */ - public Set entrySet() { + public Set/*<Map.Entry<String,Object>>*/ entrySet() { return map.entrySet(); } @@ -167,7 +161,7 @@ } /** {...@inheritdoc} */ - public Set keySet() { + public Set/*<String*/ keySet() { return map.keySet(); } --------------------------------------------------------------------- To unsubscribe, e-mail: bsf-dev-unsubscr...@jakarta.apache.org For additional commands, e-mail: bsf-dev-h...@jakarta.apache.org