gordon.jackson@east 1998-08-12
java.util.jar.Attributes specifies the following:
/**
* Associates the specified value with the specified attribute name
* (key) in this Map. If the Map previously contained a mapping for
* the attribute name, the old value is replaced.
*
* @param name the attribute name
* @param value the attribute value
* @return the previous value of the attribute, or null if none
* @exception ClassCastException if the name is not a Attributes.Name
* or the value is not a String
*/
public Object put(Object name, Object value) {
return map.put(name, value);
}
The bug is that above method neither checks to ensure that the name/value
are as they are specified to be - Attributes.Name/String - nor does it
throw a ClassCastException if they are not.
In this case, the method implementation is inconsistent with the javadoc generated API.
- duplicates
-
JDK-4199913 java.util.jar.Attributes.put() doesn't throw ClassCastException
-
- Closed
-
- relates to
-
JDK-4167600 java.util.jar.Attributes putAll() should be restricted to Attributes objects
-
- Resolved
-
-
JDK-4167898 java.util.jar.Attributes get() should accept only Attributes.Name parameter type
-
- Closed
-