Does anyone knows how to cast a HashMap to HashMap? The code always get "uses unchecked or unsafe operations", as the session.getAttribute return only a HashMap not HashMap. However, if not using the HashMap , it also raise the "uses unchecked or unsafe operations" warning. HashMap hmpUnreportedDetail = new HashMap(); hmpUnreportedDetail = (HashMap)session.getAttribute("UnreportedDetailObjects"); Thanks!