Eclipse中HashMap/Hashtable出现警告Type safety

来源:互联网 发布:王者荣耀 账号数据互通 编辑:程序博客网 时间:2024/06/05 17:20

症状:

Type safety: The method put(Object, Object) belongs to the raw type HashMap. References to generic type HashMap<K,V> should be parameterized
解决:
HashMap<Object,Object>  cachedDs=new HashMap<Object,Object> ();
cachedDs.put("ds", ds);