W
Wojtek
In the context of a servlet, if I have:
---------------------------
HashMap<String,String> foo = new HashMap<String,String>();
session.setAttribute("foo",foo);
---------------------------
Ok, this is legal and it works. Now to get it out...
---------------------------
HashMap<String,String> bar =
(HashMap<String,String>) session.getAttribute("foo");
---------------------------
This causes an "unchecked" warning and I need to use a @suppress
annotation for the entire method.
So how do I cast from Object to HashMap<String,String> ?
---------------------------
HashMap<String,String> foo = new HashMap<String,String>();
session.setAttribute("foo",foo);
---------------------------
Ok, this is legal and it works. Now to get it out...
---------------------------
HashMap<String,String> bar =
(HashMap<String,String>) session.getAttribute("foo");
---------------------------
This causes an "unchecked" warning and I need to use a @suppress
annotation for the entire method.
So how do I cast from Object to HashMap<String,String> ?