GenericEntity.get(Object) does an immediate cast to String.  This is
*not allowed*.  The spec for java.util.Map says that *any* object can
be passed, and if it isn't contained in the map, to return null.  This
includes objects that don't match the generics signature(String in
this case).

Related to this, get(String) has a Debug.logWarning call, that says
it's printing an IllegalArgumentException when an invalid field is
passed.  This isn't so; no such exception actually *is* printed.
Plus, the map contract allows for unknown fields to be looked up,
without an error.

Related to this latter problem, is that remove() and containsKey()
don't do this unknown field warning.

I found these two problems, because I noticed the warning message in
my log, and wanted to fix my code, but then discovered that there
isn't really an exception.

Reply via email to