Looking at the code here: ServletWebContextTestCase:178,640,701
// Test putAll()
Map values = new HashMap();
values.put(new Integer(1), "One"); // <-- I want to delete
this line (elijah)
values.put("2", "Two");
map.putAll(values);
The test case is testing a putAll operation with incompatible key
types if we were using generics. I'm not sure that this is a valid
test case because there I can't find any keys in the
javax.servlet.ServletContext that aren't stored as strings.
Specifically, the API is coded as following:
public Object getAttribute(String name);
Which tells us the contract for attributes keys is to use a string.
Moreover, this same pattern in unit tests is shared among other
classes in the servlet package in chain. My vote is to modify the unit
test because I believe it represents a misunderstanding of the
contract of the servlet API.
That said, I could be totally wrong and missing something key.
Thanks in advance,
-Elijah
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]